[llvm-bugs] [Bug 41322] New: Inline assembly crash by pushing offset of static struct
via llvm-bugs
llvm-bugs at lists.llvm.org
Sun Mar 31 06:08:49 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=41322
Bug ID: 41322
Summary: Inline assembly crash by pushing offset of static
struct
Product: clang
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: demoth at yandex.ru
CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
neeilans at live.com, richard-llvm at metafoo.co.uk
Reproduce: https://godbolt.org/z/MwkGJH
Clang versions: 3.8 .. trunk
3.7 compiles it fine.
Sample:
int func() {
static struct {
char *pszStart;
char *pszEnd;
} std_string;
__asm
{
push offset std_string
}
}
Stack dump:
0. Program arguments:
/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9 -cc1 -triple
x86_64-unknown-linux-gnu -emit-llvm-bc -emit-llvm-uselists -disable-free
-disable-llvm-verifier -discard-value-names -main-file-name example.cpp
-mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu x86-64 -dwarf-column-info -debug-info-kind=limited -dwarf-version=4
-debugger-tuning=gdb -coverage-notes-file
/tmp/compiler-explorer-compiler119231-62-10tzxek.x031g/output.gcno
-resource-dir /opt/compiler-explorer/clang-trunk-20190331/lib/clang/9.0.0
-internal-isystem
/opt/compiler-explorer/gcc-8.3.0/lib/gcc/x86_64-linux-gnu/8.3.0/../../../../include/c++/8.3.0
-internal-isystem
/opt/compiler-explorer/gcc-8.3.0/lib/gcc/x86_64-linux-gnu/8.3.0/../../../../include/c++/8.3.0/x86_64-linux-gnu
-internal-isystem
/opt/compiler-explorer/gcc-8.3.0/lib/gcc/x86_64-linux-gnu/8.3.0/../../../../include/c++/8.3.0/backward
-internal-isystem /usr/local/include -internal-isystem
/opt/compiler-explorer/clang-trunk-20190331/lib/clang/9.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O0
-fdeprecated-macro -fdebug-compilation-dir
/tmp/compiler-explorer-compiler119231-62-10tzxek.x031g -ferror-limit 19
-fmessage-length 0 -fms-compatibility -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/compiler-explorer-compiler119231-62-10tzxek.x031g/output.s -x c++ <source>
-faddrsig
1. <source>:14:1: current parser token 'int'
2. <source>:1:5: LLVM IR generation of declaration 'func'
3. <source>:1:5: Generating code for declaration 'func'
#0 0x0000559c0bb4603a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x259e03a)
#1 0x0000559c0bb44014 llvm::sys::RunSignalHandlers()
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x259c014)
#2 0x0000559c0bb44152 SignalHandler(int)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x259c152)
#3 0x00007fd96ccf5890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
#4 0x0000559c0b4df05e llvm::StructLayout::StructLayout(llvm::StructType*,
llvm::DataLayout const&)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x1f3705e)
#5 0x0000559c0b4df75b llvm::DataLayout::getStructLayout(llvm::StructType*)
const (/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x1f3775b)
#6 0x0000559c0bf9da3b
clang::CodeGen::CodeGenFunction::emitAddrOfImagComponent(clang::CodeGen::Address,
clang::QualType)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x29f5a3b)
#7 0x0000559c0bf79daa
clang::CodeGen::CodeGenFunction::EmitUnaryOpLValue(clang::UnaryOperator const*)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x29d1daa)
#8 0x0000559c0bf77166 clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr
const*) (/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x29cf166)
#9 0x0000559c0bd92060
clang::CodeGen::CodeGenFunction::EmitAsmStmt(clang::AsmStmt const&)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x27ea060)
#10 0x0000559c0bd9803f clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x27f003f)
#11 0x0000559c0bd984d3
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x27f04d3)
#12 0x0000559c0bdd4061
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x282c061)
#13 0x0000559c0bddc51e
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x283451e)
#14 0x0000559c0be18c69
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x2870c69)
#15 0x0000559c0be16b65
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x286eb65)
#16 0x0000559c0be171d3
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x286f1d3)
#17 0x0000559c0be1c21f
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.4501)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x287421f)
#18 0x0000559c0c8345d1 (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x328c5d1)
#19 0x0000559c0c829a96
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x3281a96)
#20 0x0000559c0cfcdfa4 clang::ParseAST(clang::Sema&, bool, bool)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x3a25fa4)
#21 0x0000559c0c831827 clang::CodeGenAction::ExecuteAction()
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x3289827)
#22 0x0000559c0c1dcf46 clang::FrontendAction::Execute()
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x2c34f46)
#23 0x0000559c0c19febc
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x2bf7ebc)
#24 0x0000559c0c299763
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0x2cf1763)
#25 0x0000559c0a1d0600 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0xc28600)
#26 0x0000559c0a12879d main
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0xb8079d)
#27 0x00007fd96bbb3b97 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b97)
#28 0x0000559c0a1cdc3a _start
(/opt/compiler-explorer/clang-trunk-20190331/bin/clang-9+0xc25c3a)
clang-9: error: unable to execute command: Segmentation fault (core dumped)
clang-9: error: clang frontend command failed due to signal (use -v to see
invocation)
Compiler returned: 254:
--
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/20190331/2c8adbe9/attachment.html>
More information about the llvm-bugs
mailing list