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

--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Richard Biener from comment #2)

> Note that clang seems to propagate the constant equivalence which we
> instead un-propagate.  With -fdisable-tree-uncprop1 you'll get the
> expected code:
> 
> foo:
> .LFB0:
>         .cfi_startproc
>         cmpl    $-1, %edi
>         je      .L8
> .L2:
>         movl    $1, %eax
>         ret
>         .p2align 4,,10
>         .p2align 3
> .L8:
>         xorl    %eax, %eax
> #APP
> # 6 "t.c" 1
>         int3
> # 0 "" 2
> #NO_APP
>         je      .L2
>         ret

Even the above is not optimal. I'd expect:

...
.L8:
#APP
# 6 "t.c" 1
        int3
# 0 "" 2
#NO_APP
        je      .L2
        xorl    %eax, %eax
        ret

Reply via email to