public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/104645] New: [12 Regression] i ? i % 2 : 0 not optimized anymore
@ 2022-02-22 19:13 denis.campredon at gmail dot com
  2022-02-22 19:16 ` [Bug tree-optimization/104645] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: denis.campredon at gmail dot com @ 2022-02-22 19:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104645
           Summary: [12 Regression] i ? i % 2 : 0 not optimized anymore
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: denis.campredon at gmail dot com
  Target Milestone: ---

Was told to file a new PR for that case :

------------------
int foo(unsigned i) {
    return i ? i % 2 : 0;
}
------------------

With trunk
------------------------
foo(unsigned int):
        mov     eax, edi
        xor     edx, edx
        and     eax, 1
        test    edi, edi
        cmove   eax, edx
        ret
-----------------------

With 11.2
-----------------------
foo(unsigned int):
        mov     eax, edi
        and     eax, 1
        ret
-----------------------

According to Jakub Jelinek in PR104639 it started with
r12-5358-g32221357007666124409ec3ee0d3a1cf263ebc9e

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

end of thread, other threads:[~2022-04-01  9:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-22 19:13 [Bug tree-optimization/104645] New: [12 Regression] i ? i % 2 : 0 not optimized anymore denis.campredon at gmail dot com
2022-02-22 19:16 ` [Bug tree-optimization/104645] " pinskia at gcc dot gnu.org
2022-02-22 19:17 ` jakub at gcc dot gnu.org
2022-02-22 20:15 ` pinskia at gcc dot gnu.org
2022-02-22 20:18 ` pinskia at gcc dot gnu.org
2022-02-23  8:23 ` rguenth at gcc dot gnu.org
2022-03-31 13:09 ` jakub at gcc dot gnu.org
2022-03-31 13:10 ` jakub at gcc dot gnu.org
2022-04-01  9:51 ` cvs-commit at gcc dot gnu.org
2022-04-01  9:52 ` jakub 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).