public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/102008] New: [12 Regression] no cmov generated for loads next to each other
@ 2021-08-21 20:00 pinskia at gcc dot gnu.org
  2021-08-21 20:00 ` [Bug rtl-optimization/102008] " pinskia at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-21 20:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102008
           Summary: [12 Regression] no cmov generated for loads next to
                    each other
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: x86_64-*-*

Take:
struct Foo {  int a;  int b; };

int test(int side, const Foo *foo) {
  if (side == 1) return foo->a;
  return foo->b;
}
----- CUT ----
Before r12-897, GCC was able to produce a cmov for this case but now we don't.
Note for aarch64 we produce now:
        cmp     w0, 1
        add     x0, x1, 4
        csel    x0, x0, x1, ne
        ldr     w0, [x0]
Which is actually reasonible still.

Note I noticed this while looking into PR 68274.

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

end of thread, other threads:[~2022-03-16 13:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-21 20:00 [Bug tree-optimization/102008] New: [12 Regression] no cmov generated for loads next to each other pinskia at gcc dot gnu.org
2021-08-21 20:00 ` [Bug rtl-optimization/102008] " pinskia at gcc dot gnu.org
2021-08-23  9:02 ` rguenth at gcc dot gnu.org
2021-09-07  2:03 ` luoxhu at gcc dot gnu.org
2021-09-07  2:14 ` luoxhu at gcc dot gnu.org
2022-03-16 10:00 ` rguenth at gcc dot gnu.org
2022-03-16 10:02 ` jakub at gcc dot gnu.org
2022-03-16 10:09 ` rguenth at gcc dot gnu.org
2022-03-16 10:20 ` jakub at gcc dot gnu.org
2022-03-16 12:39 ` rguenth at gcc dot gnu.org
2022-03-16 13:00 ` cvs-commit at gcc dot gnu.org
2022-03-16 13:01 ` 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).