You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
small.c:3:1: parsing function body 'foo'
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.5 (trunk 202395)
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/small-75d5d5.c
clang: note: diagnostic msg: /tmp/small-75d5d5.sh
clang: note: diagnostic msg:
$
int
foo ()
{
lbl:
if (1)
goto lbl;
}
The text was updated successfully, but these errors were encountered:
Extended Description
The current clang trunk crashes when compiling the following testcase at -O0 (and above) in both 32-bit and 64-bit modes on x86_64-linux-gnu.
This is a regression from clang 3.4.
$ clang-trunk -v
clang version 3.5 (trunk 202395)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.1
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
$
$ clang-3.4 -O0 -c small.c
$
$ clang-trunk -O0 -c small.c
0 clang 0x00000000023992f5 llvm::sys::PrintStackTrace(_IO_FILE*) + 37
1 clang 0x0000000002399ae3
2 libpthread.so.0 0x00007fcb78bcecb0
3 clang 0x0000000000e125f7 clang::sema::AnalysisBasedWarnings::IssueWarnings(clang::sema::AnalysisBasedWarnings::Policy, clang::sema::FunctionScopeInfo*, clang::Decl const*, clang::BlockExpr const*) + 2903
4 clang 0x0000000000a91943 clang::Sema::PopFunctionScopeInfo(clang::sema::AnalysisBasedWarnings::Policy const*, clang::Decl const*, clang::BlockExpr const*) + 99
5 clang 0x0000000000b36e2e clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) + 3342
6 clang 0x0000000000a62f48 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) + 280
7 clang 0x00000000009f07dd clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) + 2093
8 clang 0x0000000000a0278d clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 1389
9 clang 0x00000000009efd59 clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) + 697
10 clang 0x00000000009ef7b3 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) + 403
11 clang 0x00000000009eeb67 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) + 2615
12 clang 0x00000000009ee05e clang::Parser::ParseTopLevelDecl(clang::OpaquePtrclang::DeclGroupRef&) + 446
13 clang 0x00000000009eaa00 clang::ParseAST(clang::Sema&, bool, bool) + 256
14 clang 0x000000000085a34e clang::CodeGenAction::ExecuteAction() + 142
15 clang 0x00000000006b0ea0 clang::FrontendAction::Execute() + 112
16 clang 0x000000000068be5d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 925
17 clang 0x000000000067273f clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2959
18 clang 0x0000000000669c5c cc1_main(char const**, char const**, char const*, void*) + 700
19 clang 0x00000000006707f8 main + 9864
20 libc.so.6 0x00007fcb779d776d __libc_start_main + 237
21 clang 0x00000000006698b9
Stack dump:
0. Program arguments: /usr/local/clang-trunk/bin/clang -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name small.c -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.22 -coverage-file /data2/c-hunter-results/C/trans-bugs/20140227-clang-m32-m64-O0-O1-O2-O3-Os-build-test152841/small.o -resource-dir /usr/local/clang-trunk/bin/../lib/clang/3.5 -internal-isystem /usr/local/include -internal-isystem /usr/local/clang-trunk/bin/../lib/clang/3.5/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O0 -fdebug-compilation-dir /data2/c-hunter-results/C/trans-bugs/20140227-clang-m32-m64-O0-O1-O2-O3-Os-build-test152841 -ferror-limit 19 -fmessage-length 131 -mstackrealign -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o small.o -x c small.c
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.5 (trunk 202395)
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/small-75d5d5.c
clang: note: diagnostic msg: /tmp/small-75d5d5.sh
clang: note: diagnostic msg:
$
int
foo ()
{
lbl:
if (1)
goto lbl;
}
The text was updated successfully, but these errors were encountered: