[LLVMbugs] [Bug 22513] New: Combining -mllvm -polly and -flto in 3.6+ crashes... intermittently?

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Feb 9 01:37:03 PST 2015


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

            Bug ID: 22513
           Summary: Combining -mllvm -polly and -flto in 3.6+ crashes...
                    intermittently?
           Product: new-bugs
           Version: 3.6
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: geoff at geoff.codes
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13826
  --> http://llvm.org/bugs/attachment.cgi?id=13826&action=edit
Generated llvm-config.h

I've been testing the 3.6 release branch, and have run into the following:

Clang (from the 3.6 branch or trunk) will crash, intermittently, when emitting
bitcode when `-mllvm -polly` is in effect.

Specifics:

- Polly (built against isl + imath) has been linked into clang, which has been
built and linked against libcxx and libcxxabi (with the libcxxabi libunwind),
all from the release_36 branch (or trunk), Release build, without asserts.
Darwin, x86_64, running 10.10, built against the 10.7 SDK; also occurs when
built against the native SDK.. Occurs with both -march=core-avx-i (native on my
machine) and -march=core2.
- This only occurs when *both* -emit-llvm-bc and -mllvm -polly are in effect
(no crash when one or the other is omitted).
- It successfully compiles about 25% of the time, at for the test case below,
with the same file and same flags; it does not always fail on the same
function.
- It does not occur in 3.5.1.
- It seems largely (exclusively?) to crop up when building LLVM itself.

I've been able to boil down a reproducible (for me at least, hopefully for you)
case:

clang-3.6 -cc1 -triple x86_64-apple-macosx10.7.0 -D__STDC_CONSTANT_MACROS
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DNDEBUG -I/tmp/llvm/lib/Support
-I/tmp/llvm/include -stdlib=libc++ -std=c++11 -x c++ -o
/tmp/build/lib/Support/CMakeFiles/LLVMSupport.dir/FoldingSet.cpp.o
/tmp/llvm/lib/Support/FoldingSet.cpp -O3 -mllvm -polly -emit-llvm-bc

Which usually will emit a trace similar to:

---------------------------------------------------------------------------------------
0  clang                    0x000000010c37aca0
PrintStackTraceSignalHandler(void*) + 64
1  clang                    0x000000010c37b26b SignalHandler(int) + 331
2  libsystem_platform.dylib 0x00007fff91b4ff1a _sigtramp + 26
3  libsystem_platform.dylib 0x00007fb17365d600 _sigtramp + 3786462976
4  clang                    0x000000010bedef16
getFoldedCast(llvm::Instruction::CastOps, llvm::Constant*, llvm::Type*, bool) +
38
5  clang                    0x000000010c0ca5b5
llvm::InstCombiner::visitSelectInst(llvm::SelectInst&) + 10629
6  clang                    0x000000010c03aa8b
llvm::InstCombiner::runOnFunction(llvm::Function&) + 8587
7  clang                    0x000000010bf87986
llvm::FPPassManager::runOnFunction(llvm::Function&) + 550
8  clang                    0x000000010bf87c6b
llvm::FPPassManager::runOnModule(llvm::Module&) + 43
9  clang                    0x000000010bf884fb
llvm::legacy::PassManager::run(llvm::Module&) + 907
10 clang                    0x000000010ca49bfc
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) +
10492
11 clang                    0x000000010cbc09f7
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 519
12 clang                    0x000000010cfedb2f clang::ParseAST(clang::Sema&,
bool, bool) + 607
13 clang                    0x000000010c64a009 clang::FrontendAction::Execute()
+ 73
14 clang                    0x000000010c600163
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 947
15 clang                    0x000000010c694198
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 9192
16 clang                    0x000000010b3dec82 main + 27986
17 clang                    0x000000010b35db04 start + 52
18 clang                    0x0000000000000015 start + 4106888517
Stack dump:
0.    Program arguments: clang-3.6 -cc1 -triple x86_64-apple-macosx10.7.0
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DNDEBUG
-I/tmp/llvm/lib/Support -I/tmp/llvm/include -stdlib=libc++ -std=c++11 -x c++ -o
/tmp/build/lib/Support/CMakeFiles/LLVMSupport.dir/FoldingSet.cpp.o
/tmp/llvm/lib/Support/FoldingSet.cpp -O3 -mllvm -polly -emit-llvm-bc
1.    <eof> parser at end of file
2.    Per-module optimization passes
3.    Running pass 'Function Pass Manager' on module
'/tmp/llvm/lib/Support/FoldingSet.cpp'.
4.    Running pass 'Combine redundant instructions' on function
'@_ZNSt3__118uninitialized_copyIPKjPjEET0_T_S5_S4_'
---------------------------------------------------------------------------------------

And to reiterate, all of the following work fine:

clang-3.5 -cc1 -triple x86_64-apple-macosx10.7.0 -D__STDC_CONSTANT_MACROS
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DNDEBUG -I/tmp/llvm/lib/Support
-I/tmp/llvm/include -stdlib=libc++ -std=c++11 -x c++ -o
/tmp/build/lib/Support/CMakeFiles/LLVMSupport.dir/FoldingSet.cpp.o
/tmp/llvm/lib/Support/FoldingSet.cpp -O3 -mllvm -polly -emit-llvm-bc

clang-3.6 -cc1 -triple x86_64-apple-macosx10.7.0 -D__STDC_CONSTANT_MACROS
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DNDEBUG -I/tmp/llvm/lib/Support
-I/tmp/llvm/include -stdlib=libc++ -std=c++11 -x c++ -o
/tmp/build/lib/Support/CMakeFiles/LLVMSupport.dir/FoldingSet.cpp.o
/tmp/llvm/lib/Support/FoldingSet.cpp -O3 -mllvm -polly

clang-3.6 -cc1 -triple x86_64-apple-macosx10.7.0 -D__STDC_CONSTANT_MACROS
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DNDEBUG -I/tmp/llvm/lib/Support
-I/tmp/llvm/include -stdlib=libc++ -std=c++11 -x c++ -o
/tmp/build/lib/Support/CMakeFiles/LLVMSupport.dir/FoldingSet.cpp.o
/tmp/llvm/lib/Support/FoldingSet.cpp -O3 -emit-llvm-bc

And it successfully compiles about every fourth attempt.

I'll attach my generated DataTypes.h and llvm-config.h; please let me know if
you want anything more. If you'd like me bisect at a certain rev, test a patch,
try something out, add some debug flags, etc., I'm more that happy to help.

-- 
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/20150209/40b84130/attachment.html>


More information about the llvm-bugs mailing list