public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/100942] New: ccmp is not used if the value is used later
@ 2021-06-07  7:51 pinskia at gcc dot gnu.org
  2023-12-12  1:18 ` [Bug middle-end/100942] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-06-07  7:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100942
           Summary: ccmp is not used if the value is used later
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64-linux-gnu

Take:
void foo(void);
int f1(int a, int b)
{
  int c = a == 0 || b == 0;
  if (c) foo();
  return c;
}
------ CUT -----
Right now we produce at -O2:
        stp     x29, x30, [sp, -32]!
        cmp     w0, 0
        mov     x29, sp
        str     x19, [sp, 16]
        cset    w19, eq
        cmp     w1, 0
        cset    w0, eq
        orr     w19, w19, w0
        cbnz    w19, .L8
        mov     w0, w19
        ldr     x19, [sp, 16]
        ldp     x29, x30, [sp], 32
        ret

Notice how we have cmp/cset/cmp/cset/orr.
This is a (much) reduced testcase from Xalan in SPEC 2k6.

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

end of thread, other threads:[~2024-01-24 18:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07  7:51 [Bug middle-end/100942] New: ccmp is not used if the value is used later pinskia at gcc dot gnu.org
2023-12-12  1:18 ` [Bug middle-end/100942] " pinskia at gcc dot gnu.org
2023-12-12  3:40 ` pinskia at gcc dot gnu.org
2023-12-12  8:23 ` pinskia at gcc dot gnu.org
2024-01-23 17:43 ` cvs-commit at gcc dot gnu.org
2024-01-24 18:29 ` 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).