[LLVMbugs] [Bug 9494] New: CodeGen failure: returned temporary as template function argument

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 16 04:30:39 PDT 2011


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

           Summary: CodeGen failure: returned temporary as template
                    function argument
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: Axel.Naumann at cern.ch
                CC: llvmbugs at cs.uiuc.edu


$ cat t.cxx
struct AnyS { bool b; };
template <class T> bool aE(const T&);
template <typename ValueType> ValueType any_cast();
void property_list() { aE(any_cast<AnyS>().b); }

$ clang++ --version
clang version 3.0 (trunk 127728)
Target: x86_64-unknown-linux-gnu
Thread model: posix

$ clang++ -c t.cxx

triggers an assert with

clang: /build/llvm/src/lib/VMCore/Instructions.cpp:196: void
llvm::CallInst::init(llvm::Value*, llvm::Value* const*, unsigned int):
Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) ==
Params[i]->getType()) && "Calling a function with a bad signature!"' failed.
0  clang           0x000000000151d61f
1  clang           0x000000000151f892
2  libpthread.so.0 0x00007f920b32ab40
3  libc.so.6       0x00007f920a628ba5 gsignal + 53
4  libc.so.6       0x00007f920a62c6b0 abort + 384
5  libc.so.6       0x00007f920a621a71 __assert_fail + 241
6  clang           0x000000000144ba82 llvm::CallInst::init(llvm::Value*,
llvm::Value* const*, unsigned int) + 418
7  clang           0x0000000000753970
clang::CodeGen::CodeGenFunction::EmitCall(clang::CodeGen::CGFunctionInfo
const&, llvm::Value*, clang::CodeGen::ReturnValueSlot,
clang::CodeGen::CallArgList const&, clang::Decl const*, llvm::Instruction**) +
1376
8  clang           0x0000000000789829
clang::CodeGen::CodeGenFunction::EmitCall(clang::QualType, llvm::Value*,
clang::CodeGen::ReturnValueSlot, clang::ConstExprIterator,
clang::ConstExprIterator, clang::Decl const*) + 841
9  clang           0x000000000078a058
clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*,
clang::CodeGen::ReturnValueSlot) + 344
10 clang           0x00000000007b0c63
11 clang           0x00000000007b92f6
12 clang           0x00000000007b9b80
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 96
13 clang           0x000000000079053f
clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*,
clang::CodeGen::AggValueSlot, bool) + 255
14 clang           0x000000000080dc88
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 856
15 clang           0x0000000000810a60
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, clang::CodeGen::AggValueSlot) + 272
16 clang           0x0000000000810d16
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 262
17 clang           0x000000000080d957
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 39
18 clang           0x000000000082e526
clang::CodeGen::CodeGenFunction::GenerateCode(clang::CodeGen::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 694
19 clang           0x000000000072cc65
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::CodeGen::GlobalDecl)
+ 789
20 clang           0x000000000072eb2c
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::CodeGen::GlobalDecl)
+ 188
21 clang           0x000000000072f03d
clang::CodeGen::CodeGenModule::EmitGlobal(clang::CodeGen::GlobalDecl) + 861
22 clang           0x000000000072f64b
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 411
23 clang           0x00000000007224d4
24 clang           0x0000000000721ec1
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) + 161
25 clang           0x0000000000847055 clang::ParseAST(clang::Sema&, bool) + 165
26 clang           0x00000000007213d4 clang::CodeGenAction::ExecuteAction() +
68
27 clang           0x000000000061603b
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 347
28 clang           0x00000000005efc24
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1268
29 clang           0x00000000005e756f cc1_main(char const**, char const**, char
const*, void*) + 431
30 clang           0x00000000005eebfb main + 4827
31 libc.so.6       0x00007f920a613d8e __libc_start_main + 254
32 clang           0x00000000005e5c89
Stack dump:
0.    Program arguments: /build/llvm/opt-inst/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
t.cxx -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.20.51 -momit-leaf-frame-pointer -resource-dir
/build/llvm/opt-inst/bin/../lib/clang/3.0 -ferror-limit 19 -fmessage-length 149
-fcxx-exceptions -fexceptions -fgnu-runtime -fdiagnostics-show-option
-fcolor-diagnostics -o t.o -x c++ t.cxx 
1.    <eof> parser at end of file
2.    t.cxx:4:6: LLVM IR generation of declaration 'property_list'
3.    t.cxx:4:6: Generating code for declaration 'property_list'
4.    t.cxx:4:22: LLVM IR generation of compound statement ('{}')
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)

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