[LLVMbugs] [Bug 19490] New: Assertion with std::atomic<X> where X is a class type.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Apr 19 09:26:05 PDT 2014


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

            Bug ID: 19490
           Summary: Assertion with std::atomic<X> where X is a class type.
           Product: compiler-rt
           Version: unspecified
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: compiler-rt
          Assignee: unassignedbugs at nondot.org
          Reporter: roman at binarylife.net
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

$ cat test.cc 
#include <atomic>
struct X {
  int i = 0, j = 0;
};
int main() {
  return std::atomic<X>().load().i;
}

$ clang++ -std=c++11 test.cc
clang: /home/heap/llvm/tools/clang/lib/CodeGen/CGValue.h:54: llvm::Value
*clang::CodeGen::RValue::getScalarVal() const: Assertion `isScalar() && "Not a
scalar!"' failed.
0  clang           0x0000000003b89f6e llvm::sys::PrintStackTrace(_IO_FILE*) +
46
1  clang           0x0000000003b8a24b
2  clang           0x0000000003b8b60e
3  libpthread.so.0 0x00007f8e70898340
4  libc.so.6       0x00007f8e6f8abf79 gsignal + 57
5  libc.so.6       0x00007f8e6f8af388 abort + 328
6  libc.so.6       0x00007f8e6f8a4e36
7  libc.so.6       0x00007f8e6f8a4ee2
8  clang           0x0000000000d12aea
9  clang           0x0000000000edbffb
10 clang           0x0000000000ed7c88
11 clang           0x0000000000ecc358
12 clang           0x0000000000ecc275
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 181
13 clang           0x0000000000e8fa77
clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*,
clang::CodeGen::AggValueSlot, bool) + 167
14 clang           0x0000000000e8f96d
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) + 109
15 clang           0x0000000000d09c59
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 441
16 clang           0x0000000000d10b6b
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) + 139
17 clang           0x0000000000d329c7
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) + 167
18 clang           0x0000000000d3319d
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 1709
19 clang           0x0000000000d4a47b
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) + 987
20 clang           0x0000000000d47082
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) + 418
21 clang           0x0000000000d426f8
clang::CodeGen::CodeGenModule::EmitDeferred() + 376
22 clang           0x0000000000d421bc clang::CodeGen::CodeGenModule::Release()
+ 28
23 clang           0x0000000000cac0a1
24 clang           0x0000000000ca9fb2
25 clang           0x0000000000f81b4c clang::ParseAST(clang::Sema&, bool, bool)
+ 796
26 clang           0x00000000009a6179 clang::ASTFrontendAction::ExecuteAction()
+ 345
27 clang           0x0000000000ca9742 clang::CodeGenAction::ExecuteAction() +
1474
28 clang           0x00000000009a5998 clang::FrontendAction::Execute() + 120
29 clang           0x000000000096c28d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 797
30 clang           0x000000000092aaf3
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1043
31 clang           0x000000000091649a cc1_main(char const**, char const**, char
const*, void*) + 698
32 clang           0x0000000000923cd7 main + 759
33 libc.so.6       0x00007f8e6f896ec5 __libc_start_main + 245
34 clang           0x0000000000915979
Stack dump:
0.      Program arguments: /home/heap/local/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
test.cc -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.2 -resource-dir
/home/heap/local/bin/../lib/clang/3.5.0 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8
-internal-isystem /usr/local/include -internal-isystem
/home/heap/local/bin/../lib/clang/3.5.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /home/heap/tmp -ferror-limit 19 -fmessage-length 212
-mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o
/tmp/test-63e013.o -x c++ test.cc 
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.     
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/atomic:206:7:
Generating code for declaration 'std::atomic<X>::load'
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5.0 (trunk 206678)
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: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/test-29ebbc.cpp
clang: note: diagnostic msg: /tmp/test-29ebbc.sh
clang: 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/20140419/81fbc396/attachment.html>


More information about the llvm-bugs mailing list