public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/104639] New: Useless loop not fully optimized anymore
@ 2022-02-22 12:53 denis.campredon at gmail dot com
  2022-02-22 13:07 ` [Bug tree-optimization/104639] [12 Regression] " jakub at gcc dot gnu.org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: denis.campredon at gmail dot com @ 2022-02-22 12:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104639
           Summary: Useless loop not fully 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: ---

the following code compiled with -02
-------------------
bool foo(int i) {
    while (i == 4)
        i += 2;
    return i;
}
------------------

Trunk generates the following assembly
---------
foo(int):
        cmp     edi, 4
        mov     eax, 6
        cmove   edi, eax
        test    edi, edi
        setne   al
        ret
---------

whereas 11.2 generate more optimized assembly

---------
foo(int):
        test    edi, edi
        setne   al
        ret
--------

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

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

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-22 12:53 [Bug tree-optimization/104639] New: Useless loop not fully optimized anymore denis.campredon at gmail dot com
2022-02-22 13:07 ` [Bug tree-optimization/104639] [12 Regression] " jakub at gcc dot gnu.org
2022-02-22 13:16 ` jakub at gcc dot gnu.org
2022-02-22 15:23 ` rguenth at gcc dot gnu.org
2022-02-22 15:36 ` jakub at gcc dot gnu.org
2022-02-22 17:40 ` denis.campredon at gmail dot com
2022-02-22 18:06 ` jakub at gcc dot gnu.org
2022-03-03 11:36 ` aldyh at gcc dot gnu.org
2022-03-03 13:57 ` amacleod at redhat dot com
2022-03-03 14:04 ` aldyh at gcc dot gnu.org
2022-03-03 14:28 ` amacleod at redhat dot com
2022-03-03 15:04 ` aldyh at gcc dot gnu.org
2022-04-04 13:58 ` jakub at gcc dot gnu.org
2022-04-08 16:44 ` jakub at gcc dot gnu.org
2022-04-11  8:45 ` cvs-commit at gcc dot gnu.org
2022-04-11  9:03 ` 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).