[Bug target/120588] [14/15/16/17 regression] poor code when returning struct
"arthur.j.odwyer at gmail dot com via Gcc-bugs" <[email protected]>
| Newsgroups | gmane.comp.gcc.bugs |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120588
Arthur O'Dwyer <arthur.j.odwyer at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |arthur.j.odwyer at gmail dot com
--- Comment #6 from Arthur O'Dwyer <arthur.j.odwyer at gmail dot com> ---
Just ran into this with a test case that boils down to:
// https://godbolt.org/z/GabG6j4ca
struct S {
int a, b, c, d;
};
S combine(int a, int b, int c, int d) {
return {a,0,0,d};
}
GCC 14+ gives similarly bad codegen for returning {a,b,c,d}, {a,b,0,d},
{0,b,0,d}, etc. If there's an easy way to regression-test all the possible
combinations, that would be nice.