[llvm-bugs] [Bug 45334] New: VirtualBox miscompiled after LLVM r345163 / 18bfb3a5ec41

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Mar 27 19:57:19 PDT 2020


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

            Bug ID: 45334
           Summary: VirtualBox miscompiled after LLVM r345163 /
                    18bfb3a5ec41
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: kevans at FreeBSD.org
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

After r345163 ("[CodeGen] skip lifetime end marker in isInTailCallPosition"),
LLVM 8.0+ no longer compile VirtualBox 5.2.x correctly -- notably, new machines
result in failure/segfault.

Both reverting this commit (see diff at the end of this e-mail) and building a
Debug build (so no more -O2) fix the observed behavior.

I'm still trying to work out where the problem's actually happening so that I
can produce a minimal reproducer... the code involved in the problematic area
(New VM wizard -> actual machine creation) is a twisty maze of C++ with various
bits like local variables that manage an object and then set a pointer in their
dtor and other fun lifetime-related tricks.

--- lib/CodeGen/Analysis.cpp.orig       2020-03-26 15:48:08 UTC
+++ lib/CodeGen/Analysis.cpp
@@ -538,11 +538,10 @@ bool llvm::isInTailCallPosition(ImmutableCallSite CS, 
       // Debug info intrinsics do not get in the way of tail call
optimization.
       if (isa<DbgInfoIntrinsic>(BBI))
         continue;
-      // A lifetime end or assume intrinsic should not stop tail call
+      // An assume intrinsic should not stop tail call
       // optimization.
       if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(BBI))
-        if (II->getIntrinsicID() == Intrinsic::lifetime_end ||
-            II->getIntrinsicID() == Intrinsic::assume)
+        if (II->getIntrinsicID() == Intrinsic::assume)
           continue;
       if (BBI->mayHaveSideEffects() || BBI->mayReadFromMemory() ||
           !isSafeToSpeculativelyExecute(&*BBI))

-- 
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/20200328/ed789696/attachment.html>


More information about the llvm-bugs mailing list