public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/107270] New: [10/11/12/13 Regression] return for structure is not as good as before
@ 2022-10-15  1:08 pinskia at gcc dot gnu.org
  2022-10-15  1:08 ` [Bug rtl-optimization/107270] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-15  1:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107270

            Bug ID: 107270
           Summary: [10/11/12/13 Regression] return for structure is not
                    as good as before
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64-*-*

Take:
```

struct b
{
  int t;
  int tt;
};

union a
{
  long long t;
  struct b b;
};

struct b f(int i, int t)
{
  return (struct b){i, t};
}

long long f1(int i, int t)
{
  struct b b = {i, t};
  union a a;
  a.b = b;
  return a.t;
}
```
In GCC 8.x, GCC -O2 would produce:
```
f:
        .cfi_startproc
        bfi     x0, x1, 32, 32
        ret
f1:
        .cfi_startproc
        bfi     x0, x1, 32, 32
        ret
```
But in GCC 9 and above GCC produces:
```
f:
        .cfi_startproc
        uxtw    x0, w0
        orr     x0, x0, x1, lsl 32
        ret
f1:
        .cfi_startproc
        uxtw    x0, w0
        orr     x0, x0, x1, lsl 32
        ret
```

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-02-23  4:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-15  1:08 [Bug rtl-optimization/107270] New: [10/11/12/13 Regression] return for structure is not as good as before pinskia at gcc dot gnu.org
2022-10-15  1:08 ` [Bug rtl-optimization/107270] " pinskia at gcc dot gnu.org
2023-04-08 14:41 ` [Bug target/107270] " law at gcc dot gnu.org
2023-07-07 10:44 ` [Bug target/107270] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-02-22 15:56 ` rearnsha at gcc dot gnu.org
2024-02-23  1:21 ` pinskia at gcc dot gnu.org
2024-02-23  4:24 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).