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

--- Comment #1 from Julius Werner <jwerner at chromium dot org> ---
For reference, clang 10.0.0 manages to do this optimization correctly:

0000000000000000 <test> (File Offset: 0x40):
   0:   b8 01 00 00 00          mov    $0x1,%eax
   5:   81 ff 23 45 67 89       cmp    $0x89674523,%edi
   b:   74 08                   je     15 <test+0x15> (File Offset: 0x55)
   d:   81 ff 12 34 56 78       cmp    $0x78563412,%edi
  13:   75 01                   jne    16 <test+0x16> (File Offset: 0x56)
  15:   c3                      retq   
  16:   31 c0                   xor    %eax,%eax
  18:   c3                      retq

Reply via email to