[LLVMbugs] [Bug 18078] New: Assertion (E && hasScalarEvaluationKind(E->getType()) && "Invalid scalar expression to emit"); failed

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Nov 27 07:26:22 PST 2013


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

            Bug ID: 18078
           Summary: Assertion (E && hasScalarEvaluationKind(E->getType())
                    &&          "Invalid scalar expression to emit");
                    failed
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jyoti.allur at samsung.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Test Snippet :

//initlist68.cpp

typedef __SIZE_TYPE__ size_t;
void* operator new[](size_t, void *p) { return p; }
template <typename T = size_t>
void f ()
{
  size_t coord [2][2];
  new (&coord) size_t [2][2]
   {
     {0,0},
     {0,0},
   };
}

int main ()
{
  f<>();
}

command line options used :-
clang++ -std=c++0x initlist68.cpp

Please note that clang was Debug enabled.
cmake ../llvm -DCMAKE_BUILD_TYPE=Debug -DLLVM_TARGETS_TO_BUILD="X86;ARM"


CallStack :-

clang-3.5:
/home/jyoti.allur/LLVM_SVN_16_08_2013/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp:3245:
llvm::Value* clang::CodeGen::CodeGenFunction::EmitScalarExpr(const
clang::Expr*, bool): Assertion `E && hasScalarEvaluationKind(E->getType()) &&
"Invalid scalar expression to emit"' failed.
0  clang-3.5       0x094af19a llvm::sys::PrintStackTrace(_IO_FILE*) + 50
1  clang-3.5       0x094af3ed
2  clang-3.5       0x094aede1
3  libpthread.so.0 0xb76ddf38
4  ld-linux.so.2   0xb770e1b2
5  libc.so.6       0xb741f1df gsignal + 79
6  libc.so.6       0xb7422825 abort + 373
7  libc.so.6       0xb7418085
8  libc.so.6       0xb7418137
9  clang-3.5       0x0966c7f7
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 113
10 clang-3.5       0x09618f3c
clang::CodeGen::CodeGenFunction::EmitScalarInit(clang::Expr const*,
clang::ValueDecl const*, clang::CodeGen::LValue, bool) + 78
11 clang-3.5       0x0965787c
12 clang-3.5       0x09657bee
clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(clang::CXXNewExpr
const*, clang::QualType, llvm::Value*, llvm::Value*) + 532
13 clang-3.5       0x0965830b
14 clang-3.5       0x096598b4
clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(clang::CXXNewExpr const*) +
2646
15 clang-3.5       0x0965ea60
16 clang-3.5       0x0966d832
17 clang-3.5       0x0965db72
18 clang-3.5       0x0966c83d
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 183
19 clang-3.5       0x0962c0b6
clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*,
clang::CodeGen::AggValueSlot, bool) + 100
20 clang-3.5       0x0962c02b
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) + 101
21 clang-3.5       0x09531a1f
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 417
22 clang-3.5       0x09532047
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) + 85
23 clang-3.5       0x0954b347
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) + 99
24 clang-3.5       0x0954ba7d
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 1335
25 clang-3.5       0x0955c572
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl)
+ 1072
26 clang-3.5       0x09559ce4
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 398
27 clang-3.5       0x0955885f clang::CodeGen::CodeGenModule::EmitDeferred() +
331
28 clang-3.5       0x09555a82 clang::CodeGen::CodeGenModule::Release() + 30
29 clang-3.5       0x094e6436
30 clang-3.5       0x094e51ad
31 clang-3.5       0x09882725 clang::ParseAST(clang::Sema&, bool, bool) + 683
32 clang-3.5       0x0978d46c clang::ASTFrontendAction::ExecuteAction() + 306
33 clang-3.5       0x094e4283 clang::CodeGenAction::ExecuteAction() + 1311
34 clang-3.5       0x0978cfe9 clang::FrontendAction::Execute() + 183
35 clang-3.5       0x09767bc5
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 745
36 clang-3.5       0x094b5773
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 943
37 clang-3.5       0x0876d91f cc1_main(char const**, char const**, char const*,
void*) + 749
38 clang-3.5       0x087684ab main + 815
39 libc.so.6       0xb740a4d3 __libc_start_main + 243
40 clang-3.5       0x08767061
Stack dump:
0.      Program arguments: /usr/local/bin/clang-3.5 -cc1 -triple
i386-pc-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
initlist68.cpp -mrelocation-model static -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu pentium4
-resource-dir /usr/local/bin/../lib/clang/3.5 -internal-isystem
/usr/lib/gcc/i686-linux-gnu/4.7/../../../../include/c++/4.7 -internal-isystem
/usr/lib/gcc/i686-linux-gnu/4.7/../../../../include/c++/4.7/i686-linux-gnu
-internal-isystem
/usr/lib/gcc/i686-linux-gnu/4.7/../../../../include/c++/4.7/backward
-internal-isystem
/usr/lib/gcc/i686-linux-gnu/4.7/../../../../include/i686-linux-gnu/c++/4.7
-internal-isystem /usr/local/include -internal-isystem
/usr/local/bin/../lib/clang/3.5/include -internal-externc-isystem
/usr/include/i386-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++0x -fdeprecated-macro
-fdebug-compilation-dir /home/jyoti.allur/work/c++11_issues -ferror-limit 19
-fmessage-length 157 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -vectorize-slp -o
/tmp/initlist68-3aaa3e.o -x c++ initlist68.cpp
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      initlist68.cpp:7:6: Generating code for declaration 'f'
clang-3.5: error: unable to execute command: Aborted (core dumped)
clang-3.5: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5 (195722)
Target: i386-pc-linux-gnu
Thread model: posix
clang-3.5: note: diagnostic msg: PLEASE submit a bug report to  and include the
crash backtrace, preprocessed source, and associated run script.
clang-3.5: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.5: note: diagnostic msg: /tmp/initlist68-ca4098.cpp
clang-3.5: note: diagnostic msg: /tmp/initlist68-ca4098.sh
clang-3.5: note: diagnostic msg:

********************
jyoti.allur at jyotia-ubuntu:~/work/c++11_issues$ clang++ -std=c++0x
initlist68.cpp
clang-3.5:
/home/jyoti.allur/LLVM_SVN_16_08_2013/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp:3245:
llvm::Value* clang::CodeGen::CodeGenFunction::EmitScalarExpr(const
clang::Expr*, bool): Assertion `E && hasScalarEvaluationKind(E->getType()) &&
"Invalid scalar expression to emit"' failed.
0  clang-3.5       0x094af19a llvm::sys::PrintStackTrace(_IO_FILE*) + 50
1  clang-3.5       0x094af3ed
2  clang-3.5       0x094aede1
3  libpthread.so.0 0xb76c6f38
4  ld-linux.so.2   0xb76f71b2
5  libc.so.6       0xb74081df gsignal + 79
6  libc.so.6       0xb740b825 abort + 373
7  libc.so.6       0xb7401085
8  libc.so.6       0xb7401137
9  clang-3.5       0x0966c7f7
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 113
10 clang-3.5       0x09618f3c
clang::CodeGen::CodeGenFunction::EmitScalarInit(clang::Expr const*,
clang::ValueDecl const*, clang::CodeGen::LValue, bool) + 78
11 clang-3.5       0x0965787c
12 clang-3.5       0x09657bee
clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(clang::CXXNewExpr
const*, clang::QualType, llvm::Value*, llvm::Value*) + 532
13 clang-3.5       0x0965830b
14 clang-3.5       0x096598b4
clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(clang::CXXNewExpr const*) +
2646
15 clang-3.5       0x0965ea60
16 clang-3.5       0x0966d832
17 clang-3.5       0x0965db72
18 clang-3.5       0x0966c83d
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 183
19 clang-3.5       0x0962c0b6
clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*,
clang::CodeGen::AggValueSlot, bool) + 100
20 clang-3.5       0x0962c02b
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) + 101
21 clang-3.5       0x09531a1f
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 417
22 clang-3.5       0x09532047
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) + 85
23 clang-3.5       0x0954b347
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) + 99
24 clang-3.5       0x0954ba7d
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 1335
25 clang-3.5       0x0955c572
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl)
+ 1072
26 clang-3.5       0x09559ce4
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 398
27 clang-3.5       0x0955885f clang::CodeGen::CodeGenModule::EmitDeferred() +
331
28 clang-3.5       0x09555a82 clang::CodeGen::CodeGenModule::Release() + 30
29 clang-3.5       0x094e6436
30 clang-3.5       0x094e51ad
31 clang-3.5       0x09882725 clang::ParseAST(clang::Sema&, bool, bool) + 683
32 clang-3.5       0x0978d46c clang::ASTFrontendAction::ExecuteAction() + 306
33 clang-3.5       0x094e4283 clang::CodeGenAction::ExecuteAction() + 1311
34 clang-3.5       0x0978cfe9 clang::FrontendAction::Execute() + 183
35 clang-3.5       0x09767bc5
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 745
36 clang-3.5       0x094b5773
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 943
37 clang-3.5       0x0876d91f cc1_main(char const**, char const**, char const*,
void*) + 749
38 clang-3.5       0x087684ab main + 815
39 libc.so.6       0xb73f34d3 __libc_start_main + 243
40 clang-3.5       0x08767061
Stack dump:
0.      Program arguments: /usr/local/bin/clang-3.5 -cc1 -triple
i386-pc-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
initlist68.cpp -mrelocation-model static -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu pentium4
-resource-dir /usr/local/bin/../lib/clang/3.5 -internal-isystem
/usr/lib/gcc/i686-linux-gnu/4.7/../../../../include/c++/4.7 -internal-isystem
/usr/lib/gcc/i686-linux-gnu/4.7/../../../../include/c++/4.7/i686-linux-gnu
-internal-isystem
/usr/lib/gcc/i686-linux-gnu/4.7/../../../../include/c++/4.7/backward
-internal-isystem
/usr/lib/gcc/i686-linux-gnu/4.7/../../../../include/i686-linux-gnu/c++/4.7
-internal-isystem /usr/local/include -internal-isystem
/usr/local/bin/../lib/clang/3.5/include -internal-externc-isystem
/usr/include/i386-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++0x -fdeprecated-macro
-fdebug-compilation-dir /home/jyoti.allur/work/c++11_issues -ferror-limit 19
-fmessage-length 157 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -vectorize-slp -o
/tmp/initlist68-031df4.o -x c++ initlist68.cpp
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      initlist68.cpp:7:6: Generating code for declaration 'f'
clang-3.5: error: unable to execute command: Aborted (core dumped)
clang-3.5: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5 (195722)
Target: i386-pc-linux-gnu
Thread model: posix
clang-3.5: note: diagnostic msg: PLEASE submit a bug report to  and include the
crash backtrace, preprocessed source, and associated run script.
clang-3.5: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.5: note: diagnostic msg: /tmp/initlist68-666c85.cpp
clang-3.5: note: diagnostic msg: /tmp/initlist68-666c85.sh
clang-3.5: note: diagnostic msg:

********************

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131127/f4cee755/attachment.html>


More information about the llvm-bugs mailing list