public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/114510] New: [14 Regression] missed proping of multiply by 2 into address of load/stores
@ 2024-03-28  6:58 pinskia at gcc dot gnu.org
  2024-03-28  7:05 ` [Bug target/114510] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-28  6:58 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114510
           Summary: [14 Regression] missed proping of multiply by 2 into
                    address of load/stores
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64

Take:
```
int f(short *a, short *c, __SIZE_TYPE__ b)
{
        return a[b] + c[b];
}

int f1(short *a, short *c, int b)
{
        return a[b] + c[b];
}
```
These used to produce in GCC 13:
```
f:
        ldrsh   w3, [x0, x2, lsl 1]
        ldrsh   w0, [x1, x2, lsl 1]
        add     w0, w3, w0
        ret
f1:
        ldrsh   w3, [x0, w2, sxtw 1]
        ldrsh   w0, [x1, w2, sxtw 1]
        add     w0, w3, w0
        ret
```

But now f produces as of r14-9692-g839bc42772ba7a (but it looks like the change
happened much earlier):
```
f:
        lsl     x2, x2, 1
        ldrsh   w3, [x0, x2]
        ldrsh   w0, [x1, x2]
        add     w0, w3, w0
```

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

end of thread, other threads:[~2024-05-07  7:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-28  6:58 [Bug target/114510] New: [14 Regression] missed proping of multiply by 2 into address of load/stores pinskia at gcc dot gnu.org
2024-03-28  7:05 ` [Bug target/114510] " pinskia at gcc dot gnu.org
2024-03-28  7:05 ` pinskia at gcc dot gnu.org
2024-03-28  7:08 ` pinskia at gcc dot gnu.org
2024-03-29 23:45 ` law at gcc dot gnu.org
2024-04-03 16:16 ` tnfchris at gcc dot gnu.org
2024-05-07  7:45 ` [Bug target/114510] [14/15 " rguenth 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).