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

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 5 11:19:24 PDT 2019


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

Nikita Kniazev <nok.raven at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---
                 CC|                            |nok.raven at gmail.com

--- Comment #4 from Nikita Kniazev <nok.raven at gmail.com> ---
This seems to be exactly the issue I was going to open. The following code
contains a tail call while it could just conditionally jump to the function
address:

void bar();

void foo(bool b)
{
    if (b) bar();
}

and MSVC does exactly this https://godbolt.org/z/zFv3eb

Moreover, the IR from the first post still does not embed the tail call address
into the conditional jump https://godbolt.org/z/Ehc02G. The expected output in
the test committed with https://reviews.llvm.org/rL295357 is not right, as for
me. Instead of

; WIN64: jne
; WIN64: jmp foo
; WIN64: jmp bar

It has to be:

; WIN64: jne bar
; WIN64: jmp foo

Probably, bug 41261 depends on this.

-- 
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/20190405/2234ba34/attachment-0001.html>


More information about the llvm-bugs mailing list