[llvm-bugs] [Bug 26354] New: regression: Compilation hangs with -O2 -mavx for certain input (valid code)

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 28 04:20:59 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26354

            Bug ID: 26354
           Summary: regression: Compilation hangs with -O2 -mavx for
                    certain input (valid code)
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: All
            Status: NEW
          Keywords: regression
          Severity: release blocker
          Priority: P
         Component: C++14
          Assignee: unassignedclangbugs at nondot.org
          Reporter: pipping at exherbo.org
                CC: hans at chromium.org, llvm-bugs at lists.llvm.org
    Classification: Unclassified

I have a (unfortunately very large still) chunk of C++ code which clang++ never
appears to finish compiling.

The following three criteria need to met in order for this to happen:
 * I need to use clang 3.8.0rc1 (the issue does not occur with 3.7.1)
 * I need to pass -mavx (or something that implies it, like -march=sandybridge)
 * I need to pass -O2 (the issue does not occur with -O1)

I've created a preprocessor dump using clang 3.7.1 and -save-temps that I'm
attaching to this report. As expected, it shows the following behaviour:

# clang++ 3.7.1 didn't have the problem
% ( ulimit -t 10; time clang++3.7.1 -c -std=c++14 -o /dev/null
uggridgeometry.ii -O2 -march=sandybridge )
1.26s user 0.02s system 99% cpu 1.287 total

# clang++ 3.8.0rc1 has the problem
% ( ulimit -t 10; time clang++3.8.0rc1 -c -std=c++14 -o /dev/null
uggridgeometry.ii -O2 -march=sandybridge )
#0 0x0000000001c048e5 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0x1c048e5)
#1 0x0000000001c028a6 llvm::sys::RunSignalHandlers()
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0x1c028a6)
#2 0x0000000001c02ac4 SignalHandler(int)
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0x1c02ac4)
#3 0x00007efdc42e08d0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0xf8d0)
#4 0x000000000147cebc llvm::FindAvailableLoadedValue(llvm::Value*,
llvm::BasicBlock*, llvm::ilist_iterator<llvm::Instruction>&, unsigned int,
llvm::AAResults*, llvm::AAMDNodes*)
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0x147cebc)
#5 0x00000000019a1b5a llvm::InstCombiner::visitLoadInst(llvm::LoadInst&)
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0x19a1b5a)
#6 0x0000000001965213 llvm::InstCombiner::run()
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0x1965213)
#7 0x0000000001966309 combineInstructionsOverFunction(llvm::Function&,
llvm::InstCombineWorklist&, llvm::AAResults*, llvm::AssumptionCache&,
llvm::TargetLibraryInfo&, llvm::DominatorTree&, llvm::LoopInfo*)
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0x1966309)
#8 0x0000000001966c70 (anonymous
namespace)::InstructionCombiningPass::runOnFunction(llvm::Function&)
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0x1966c70)
#9 0x00000000018c7083 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0x18c7083)
#10 0x00000000018c76cb llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0x18c76cb)
#11 0x0000000001d1d0d2 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions
const&, llvm::StringRef, llvm::Module*, clang::BackendAction,
llvm::raw_pwrite_stream*)
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0x1d1d0d2)
#12 0x0000000002271917
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0x2271917)
#13 0x000000000255755d clang::ParseAST(clang::Sema&, bool, bool)
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0x255755d)
#14 0x00000000022719fb clang::CodeGenAction::ExecuteAction()
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0x22719fb)
#15 0x0000000001fd9b26 clang::FrontendAction::Execute()
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0x1fd9b26)
#16 0x0000000001fb3216
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0x1fb3216)
#17 0x00000000020601b3
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0x20601b3)
#18 0x0000000000a985c8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0xa985c8)
#19 0x0000000000a57c82 main
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0xa57c82)
#20 0x00007efdc350ab45 __libc_start_main
/build/glibc-3Vu5mt/glibc-2.19/csu/libc-start.c:321:0
#21 0x0000000000a947c4 _start
(/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8+0xa947c4)
Stack dump:
0.    Program arguments:
/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/clang-3.8 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name
uggridgeometry.ii -mrelocation-model static -mthread-model posix -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu sandybridge -momit-leaf-frame-pointer -dwarf-column-info
-debugger-tuning=gdb -coverage-file /dev/null -resource-dir
/home/mi/pipping/dune/inst/clang-3.8.0rc1/bin/../lib/clang/3.8.0 -O2 -std=c++14
-fdeprecated-macro -fdebug-compilation-dir
/home/mi/pipping/dune/build-Release/dune-grid/lib -ferror-limit 19
-fmessage-length 175 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /dev/null -x c++-cpp-output uggridgeometry.ii 
1.    <eof> parser at end of file
2.    Per-module optimization passes
3.    Running pass 'Function Pass Manager' on module 'uggridgeometry.ii'.
4.    Running pass 'Combine redundant instructions' on function
'@_ZN4Dune5UG_NSILi3EE14TransformationEiPPdRKNS_11FieldVectorIdLi3EEERNS_11FieldMatrixIdLi3ELi3EEE'
clang-3.8: error: unable to execute command: CPU time limit exceeded
clang-3.8: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.8.0 (tags/RELEASE_380/rc1)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/mi/pipping/dune/inst/clang-3.8.0rc1/bin
clang-3.8: 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-3.8: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.
11.12s user 0.06s system 98% cpu 11.348 total

# The problem goes away with -O1
% ( ulimit -t 10; time clang++3.8.0rc1 -c -std=c++14 -o /dev/null
uggridgeometry.ii -O1 -march=sandybridge )
1.30s user 0.04s system 99% cpu 1.340 total

# The problem goes away with an architecture that does not support AVX
% ( ulimit -t 10; time clang++3.8.0rc1 -c -std=c++14 -o /dev/null
uggridgeometry.ii -O2 -march=westmere )
1.29s user 0.04s system 99% cpu 1.340 total

# The problem is triggered by the addition of AVX
% ( ulimit -t 10; time clang++3.8.0rc1 -c -std=c++14 -o /dev/null
uggridgeometry.ii -O2 -march=westmere -mavx )
< killed after 10s, same output a above >

# The problem is triggered by AVX alone
% ( ulimit -t 10; time clang++3.8.0rc1 -c -std=c++14 -o /dev/null
uggridgeometry.ii -O2 -mavx )
< killed after 10s, same output a above >

-- 
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/20160128/0f2538a5/attachment-0001.html>


More information about the llvm-bugs mailing list