[LLVMbugs] [Bug 14345] New: clang assert fails with noreturn attribute

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Nov 14 16:33:22 PST 2012


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

             Bug #: 14345
           Summary: clang assert fails with noreturn attribute
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: boulos at cs.stanford.edu
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Compiling a simple test case with ToT as:

clang -emit-llvm -c a.c

[a.c]
__attribute__((noreturn)) void foo();

void other() {
   foo();
}

Produces an overly protective assert.  I believe this used to work in
clang-3.1:


Assertion failed: (Attrs[i].Attrs.hasAttributes() && "Pointless attribute!"),
function get, file Attributes.cpp, line 421.
0  libLLVM-3.2svn.dylib 0x00000001019c5a82 PrintStackTrace(void*) + 34
1  libLLVM-3.2svn.dylib 0x00000001019c6079 SignalHandler(int) + 761
2  libSystem.B.dylib    0x00007fff852401ba _sigtramp + 26
3  libSystem.B.dylib    000000000000000000 _sigtramp + 2061237856
4  libLLVM-3.2svn.dylib 0x00000001019c5cd6 abort + 22
5  libLLVM-3.2svn.dylib 0x00000001019c5c98 __assert_rtn + 56
6  libLLVM-3.2svn.dylib 0x00000001014bcd00
llvm::AttrListPtr::get(llvm::ArrayRef<llvm::AttributeWithIndex>) + 992
7  clang                0x00000001002a67a0
clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributes(clang::Decl const*,
clang::CodeGen::CGFunctionInfo const&, llvm::Function*) + 112
8  clang                0x00000001002a6ee1
clang::CodeGen::CodeGenModule::SetFunctionAttributes(clang::GlobalDecl,
llvm::Function*, bool) + 161
9  clang                0x00000001002a883e
clang::CodeGen::CodeGenModule::GetOrCreateLLVMFunction(llvm::StringRef,
llvm::Type*, clang::GlobalDecl, bool, llvm::Attributes) + 350
....

-- 
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