[llvm-bugs] [Bug 37050] New: llc aborts, clang error 70 on specific PPC64 CTR Loop bitcode at -O1 and beyond

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Apr 8 22:38:56 PDT 2018


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

            Bug ID: 37050
           Summary: llc aborts, clang error 70 on specific PPC64 CTR Loop
                    bitcode at -O1 and beyond
           Product: new-bugs
           Version: trunk
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: obilaniu at gmail.com
                CC: dje.gcc at gmail.com, echristo at gmail.com,
                    hfinkel at anl.gov, kit.barton at gmail.com,
                    llvm-bugs at lists.llvm.org, nemanja.i.ibm at gmail.com

Created attachment 20173
  --> https://bugs.llvm.org/attachment.cgi?id=20173&action=edit
Abort/error-inducing bitcode

While debugging an "Invalid PPC CTR loop!" problem with LLVM JIT codegen for
Numba (https://github.com/numba/numba/issues/2451#issuecomment-379629091), I
managed to isolate an ugly, 186KB LLVM IR module that caused both llc and
clang-7.0.0svn trunk to abort() with that "Invalid PPC CTR loop!" message.

Bugpoint then stripped it down to 1.6KB of bitcode that causes Clang to error
out (exit code 70) instead, but llc still aborts in the same way.

Bitcode is attached. Console printouts below. All this is also viewable at the
Numba Github link above.


The Clang error printout:

$ clang -O3 -v -c crashir-reduced.bc -o crashir-reduced.bc.o
clang version 7.0.0 (https://git.llvm.org/git/clang.git/
f38834898ad991aec557e2a609c6b7c3b288bf10) (https://git.llvm.org/git/llvm.git/
32d2ff0d0ffc54839092ace1e9d101a1fc1461b7)
Target: powerpc64le-unknown-linux-gnu
Thread model: posix
InstalledDir: /.local/bin
Found candidate GCC installation: /usr/lib/gcc/ppc64le-redhat-linux/4.8.2
Found candidate GCC installation: /usr/lib/gcc/ppc64le-redhat-linux/4.8.5
Selected GCC installation: /usr/lib/gcc/ppc64le-redhat-linux/4.8.5
Candidate multilib: .;@m64
Selected multilib: .;@m64
 "/.local/bin/clang-7" -cc1 -triple powerpc64le-unknown-linux-gnu -emit-obj
-disable-free -main-file-name crashir-reduced.bc -mrelocation-model pic
-pic-level 2 -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -fuse-init-array -target-cpu ppc64le -mfloat-abi hard
-target-abi elfv2 -dwarf-column-info -debugger-tuning=gdb
-momit-leaf-frame-pointer -v -coverage-notes-file
/NUMBA_SOURCE_PATH/bugpointwdir/crashir-reduced.bc.gcno -resource-dir
/.local/lib/clang/7.0.0 -O3 -fdebug-compilation-dir
/NUMBA_SOURCE_PATH/bugpointwdir -ferror-limit 19 -fmessage-length 184
-fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -vectorize-loops -vectorize-slp -o crashir-reduced.bc.o -x
ir crashir-reduced.bc
clang -cc1 version 7.0.0 based upon LLVM 7.0.0svn default target
powerpc64le-unknown-linux-gnu
fatal error: error in backend: Cannot select: intrinsic
%llvm.ppc.is.decremented.ctr.nonzero
clang-7: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 7.0.0 (https://git.llvm.org/git/clang.git/
f38834898ad991aec557e2a609c6b7c3b288bf10) (https://git.llvm.org/git/llvm.git/
32d2ff0d0ffc54839092ace1e9d101a1fc1461b7)
Target: powerpc64le-unknown-linux-gnu
Thread model: posix
InstalledDir: /.local/bin
clang-7: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang-7: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.



The llc printout:

$ llc -O3 crashir-reduced.bc -o crashir-reduced.bc.o   
Invalid PPC CTR loop!
UNREACHABLE executed at
/LLVM_SOURCE_PATH/lib/Target/PowerPC/PPCCTRLoops.cpp:777!
LLVMSymbolizer: error reading file: No such file or directory
#0 0x000000001271c7e0 (llc+0x1271c7e0)
#1 0x000000001271c8e4 (llc+0x1271c8e4)
#2 0x000000001271a568 (llc+0x1271a568)
#3 0x000000001271bd88 (llc+0x1271bd88)
#4 0x00003fff9ab50478  0x478 __GI_abort
#5 0x00003fff9ab50478 
#6 0x00003fff9ab50478 (+0x478)
#7 0x00003fff9a610d70 (/lib64/libc.so.6+0x40d70)
#8 0x00000000126666e8 (llc+0x126666e8)
#9 0x0000000010c4bcd4 (llc+0x10c4bcd4)
#10 0x0000000011555c24 (llc+0x11555c24)
#11 0x0000000011c87390 (llc+0x11c87390)
#12 0x0000000011c875f4 (llc+0x11c875f4)
#13 0x0000000011c87b80 (llc+0x11c87b80)
#14 0x0000000011c884ec (llc+0x11c884ec)
#15 0x0000000011c888c8 (llc+0x11c888c8)
#16 0x0000000010b6ceac generic_start_main.isra.0 (llc+0x10b6ceac)
#17 0x0000000010b6b3b8 __libc_start_main (llc+0x10b6b3b8)
llc(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x58)[0x1271c7e0]
llc[0x1271c8e4]
llc(_ZN4llvm3sys17RunSignalHandlersEv+0xb4)[0x1271a568]
llc[0x1271bd88]
[0x3fff9ab50478]
/lib64/libc.so.6(abort+0x280)[0x3fff9a610d70]
llc(_ZN4llvm25llvm_unreachable_internalEPKcS1_j+0x104)[0x126666e8]
llc[0x10c4bcd4]
llc(_ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE+0x22c)[0x11555c24]
llc(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0x170)[0x11c87390]
llc(_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE+0x74)[0x11c875f4]
llc[0x11c87b80]
llc(_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE+0x164)[0x11c884ec]
llc(_ZN4llvm6legacy11PassManager3runERNS_6ModuleE+0x38)[0x11c888c8]
llc[0x10b6ceac]
llc(main+0x580)[0x10b6b3b8]
/lib64/libc.so.6(+0x24700)[0x3fff9a5f4700]
/lib64/libc.so.6(__libc_start_main+0xc4)[0x3fff9a5f48f4]
Stack dump:
0.      Program arguments: llc -O3 crashir-reduced.bc -o crashir-reduced.bc.o 
1.      Running pass 'Function Pass Manager' on module 'crashir-reduced.bc'.
2.      Running pass 'PowerPC CTR Loops Verify' on function
'@"_ZN5numba5tests7timsort12merge_lo$244E149MergeState$28int64$2c$20array$28int32$2c$201d$2c$20C$29$2c$20array$28int32$2c$201d$2c$20C$29$2c$20list$28MergeRun$28int64$20x$202$29$29$2c$20int64$295ArrayIiLi1E1C7mutable7alignedE5ArrayIiLi1E1C7mutable7alignedExxxx"'
Aborted

-- 
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/20180409/dc349082/attachment-0001.html>


More information about the llvm-bugs mailing list