[LLVMbugs] [Bug 9450] New: clang++: BB's name affects generating IR (by NDEBUG)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 10 05:57:53 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=9450

           Summary: clang++: BB's name affects generating IR (by NDEBUG)
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: geek4civic at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=6304)
 --> (http://llvm.org/bugs/attachment.cgi?id=6304)
Preprocessed llvm-ar.cpp and linux-generated IRs

To build clang with both assertions.

In theory, stripped IRs might be identical regardless of Assertions.
attached ar-[ar].ll differs.
I met this issue on cygwin-1.7, though, I can reproduce on x86_64-linux.

Release/bin/clang++ -cc1 -triple=i686-pc-cygwin -O1 -emit-llvm -fcxx-exceptions
llvm-ar.ii -o - | opt -strip -S -o ar-r.ll
Release+Asserts/bin/clang++ -cc1 -triple=i686-pc-cygwin -O1 -emit-llvm
-fcxx-exceptions llvm-ar.ii -o - | opt -strip -S -o ar-a.ll

* with -O0, I can get same IRs.
* on +Asserts, I can get same IR if naming BB(s) is suppressed.

--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -1247,7 +1247,7 @@ public:
 #ifdef NDEBUG
     return llvm::BasicBlock::Create(getLLVMContext(), "", parent, before);
 #else
-    return llvm::BasicBlock::Create(getLLVMContext(), name, parent, before);
+    return llvm::BasicBlock::Create(getLLVMContext(), "", parent, before);
 #endif
   }

Excuse me, I could not reduce my testcase.

ps. I know ToT llvm backend for Win32 does not support exceptions.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list