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

Jan Schultke <janschultke at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |janschultke at googlemail dot 
com

--- Comment #8 from Jan Schultke <janschultke at googlemail dot com> ---
Another repro: https://godbolt.org/z/K4zc6GMjY

Given the code:

> void t(), f();
> 
> void decide(bool ok) {
>     if (ok) {
>         t();
>     } else  {
>         f();
>     }
> }


GCC emits:

> decide(bool):
>         test    dil, dil
>         je      .L2
>         jmp     t()
> .L2:
>         jmp     f()


This contains a je to a jmp instruction, which is obviously redundant. The
expected output (Clang, MSVC) is:

> decide(bool):
>         test    edi, edi
>         je      f()@PLT
>         jmp     t()@PLT

Reply via email to