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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to