public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/100857] New: Simple common code sinking is not performed
@ 2021-06-01 15:14 nok.raven at gmail dot com
  2021-06-02  7:58 ` [Bug tree-optimization/100857] " rguenth at gcc dot gnu.org
  2021-06-03  5:42 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: nok.raven at gmail dot com @ 2021-06-01 15:14 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100857
           Summary: Simple common code sinking is not performed
           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: nok.raven at gmail dot com
  Target Milestone: ---

void bar(int);

void foo(bool f)
{
    if (f) {
        bar(1);
    }
    else {
        bar(2);
    }
}

; GCC
foo(bool):
        test    dil, dil
        je      .L2
        mov     edi, 1
        jmp     bar(int)
.L2:
        mov     edi, 2
        jmp     bar(int)

; Clang
foo(bool):
        mov     eax, 2
        sub     eax, edi
        mov     edi, eax
        jmp     bar(int)

https://godbolt.org/z/4oEPY4ncb

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

end of thread, other threads:[~2021-06-03  5:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-01 15:14 [Bug tree-optimization/100857] New: Simple common code sinking is not performed nok.raven at gmail dot com
2021-06-02  7:58 ` [Bug tree-optimization/100857] " rguenth at gcc dot gnu.org
2021-06-03  5:42 ` 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).