[LLVMbugs] [Bug 14355] New: crash in IR generation

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Nov 15 08:43:56 PST 2012


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

             Bug #: 14355
           Summary: crash in IR generation
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: markus at trippelsdorf.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


arkus at x4 /tmp % cat test.ii
template<typename = int>struct B;
struct A
{};
template<typename>struct B : A
{};
namespace tools {
template<class F, class T>
void foo(F p1, T, T, T, int, int&)
{
  p1(0);
}
}
int a;
void
bar()
{
  typedef B<>F3 (double);
  F3 b;
  tools::foo(&b, 0, 0, 0, 0, a);
}

markus at x4 /tmp % clang++ -c test.ii
0  clang           0x0000000001a1727f
1  clang           0x0000000001a175d0
2  libpthread.so.0 0x00007f13ca5e4220
3  clang           0x0000000001930240
llvm::ConstantFoldCastInstruction(unsigned int, llvm::Constant*, llvm::Type*) +
96
4  clang           0x0000000001937979
5  clang           0x0000000000787244
6  clang           0x000000000078f4aa
clang::CodeGen::CodeGenFunction::EmitCall(clang::CodeGen::CGFunctionInfo
const&, llvm::Value*, clang::CodeGen::ReturnValueSlot,
clang::CodeGen::CallArgList const&, clang::Decl const*, llvm::Instruction**) +
6282
7  clang           0x00000000007c7592
clang::CodeGen::CodeGenFunction::EmitCall(clang::QualType, llvm::Value*,
clang::CodeGen::ReturnValueSlot, clang::ConstExprIterator,
clang::ConstExprIterator, clang::Decl const*) + 306
8  clang           0x00000000007d1e1d
clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*,
clang::CodeGen::ReturnValueSlot) + 285
9  clang           0x00000000007db44b
10 clang           0x00000000007d66e7
clang::CodeGen::CodeGenFunction::EmitAggExpr(clang::Expr const*,
clang::CodeGen::AggValueSlot) + 4071
11 clang           0x00000000007c3a81
clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*,
clang::CodeGen::AggValueSlot, bool) + 129
12 clang           0x00000000007ced8f
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) + 47
13 clang           0x00000000008545f7
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 87
14 clang           0x0000000000854870
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, clang::CodeGen::AggValueSlot) + 240
15 clang           0x0000000000856d8c
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 172
16 clang           0x00000000008545b5
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 21
17 clang           0x000000000086664e
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 526
18 clang           0x000000000074fc8d
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl)
+ 397
19 clang           0x00000000007599e3
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 291
20 clang           0x0000000000759b59
clang::CodeGen::CodeGenModule::EmitDeferred() + 153
21 clang           0x0000000000759b89 clang::CodeGen::CodeGenModule::Release()
+ 9
22 clang           0x0000000000744d40
23 clang           0x0000000000882843 clang::ParseAST(clang::Sema&, bool, bool)
+ 547
24 clang           0x0000000000606511 clang::FrontendAction::Execute() + 81
25 clang           0x00000000005e9022
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 290
26 clang           0x00000000005d2c86
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1478
27 clang           0x00000000005caf88 cc1_main(char const**, char const**, char
const*, void*) + 904
28 clang           0x00000000005d212f main + 7567
29 libc.so.6       0x00007f13c9cf3895 __libc_start_main + 245
30 clang           0x00000000005caa89
Stack dump:
0.      Program arguments: /usr/local/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name test.ii -mrelocation-model static
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -target-linker-version
2.23.51.20121113 -momit-leaf-frame-pointer -coverage-file /var/tmp/tmp/test.o
-resource-dir /usr/local/bin/../lib/clang/3.2 -fdeprecated-macro
-fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 174
-mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o test.o -x c++-cpp-output
test.ii 
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      test.ii:8:6: Generating code for declaration 'tools::foo'
4.      test.ii:9:1: LLVM IR generation of compound statement ('{}')
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.2 
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.


This testcase was obtained by further reducing the on of Bug 12774.

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