Skip to content

clang++: BB's name affects generating IR (by NDEBUG) #9822

Closed
@llvmbot

Description

@llvmbot
Bugzilla Link 9450
Resolution FIXED
Resolved on Mar 30, 2011 06:33
Version trunk
OS All
Blocks llvm/llvm-bugzilla-archive#9591
Attachments Preprocessed llvm-ar.cpp and linux-generated IRs
Reporter LLVM Bugzilla Contributor
CC @efriedma-quic,@rjmccall

Extended Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:codegenIR generation bugs: mangling, exceptions, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions