[llvm-bugs] [Bug 26302] [x86] Tail call with conditional jumps

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Apr 10 06:36:14 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=26302

Hans Wennborg <hans at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|REOPENED                    |RESOLVED

--- Comment #7 from Hans Wennborg <hans at chromium.org> ---
(In reply to Nikita Kniazev from comment #6)
> Correct me if I am wrong. The example in the first post is not affected by
> this comment, as folding will not change the branch direction in it.

But it does. Before the optimization:

        testb   $1, 4(%esp)
        je      .LBB0_2
        jmp     foo
  .LBB0_2:
        jmp     bar

The "je" branches "forward" due to the code layout.

After folding:

        testb   $1, 4(%esp)
        je      bar
        jmp     foo

The "je" might branch "forward" or "backward" depending on where the linker
puts "bar" in relation to the current code. The code layout done by the
compiler is lost.

At least that was the motivation for restricting this to optsize.

If you want to make the case that this optimization should fire also without
optsize, please open another bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190410/0cee6faf/attachment-0001.html>


More information about the llvm-bugs mailing list