[llvm-bugs] [Bug 44101] New: PowerPC64: clang crash during compilation of crafty

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Nov 21 04:05:17 PST 2019


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

            Bug ID: 44101
           Summary: PowerPC64: clang crash during compilation of crafty
           Product: clang
           Version: 9.0
          Hardware: Other
                OS: FreeBSD
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C
          Assignee: unassignedclangbugs at nondot.org
          Reporter: pkubaj at anongoth.pl
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Created attachment 22852
  --> https://bugs.llvm.org/attachment.cgi?id=22852&action=edit
patch

Happens during compilation of games/crafty port on FreeBSD/powerpc64-elfv2:
cc -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -Wall
-Wno-array-bounds -pipe -O3 \
-mpopcnt -pthread -DHASHSTATS -DTRACE -DBOOKDIR=\"/usr/local/lib/crafty\" 
-DLOGDIR=\"/tmp\"  -DRCDIR=\"~/\"  -DTBDIR=\"/usr/local/lib/crafty/TB\" 
-DPERSDIR=\"/usr/local/lib/crafty/cpf\" -DSKILL -DCPUS=1 -DSYZYGY -DTEST
-DCPUS=4 -DUNIX -c crafty.c
cc: warning: argument unused during compilation: '-mpopcnt'
[-Wunused-command-line-argument]
In file included from <built-in>:338:
<command line>:12:9: warning: 'CPUS' macro redefined [-Wmacro-redefined]
#define CPUS 4
        ^
<command line>:9:9: note: previous definition is here
#define CPUS 1
        ^
Assertion failed: ((OpInfo.ConstraintType == TargetLowering::C_RegisterClass ||
OpInfo.ConstraintType == TargetLowering::C_Register || OpInfo.ConstraintType ==
TargetLowering::C_Immediate) && "Unknown constraint type!"), function
visitInlineAsm, file
/usr/src/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp, line
8274.
Stack dump:
0.      Program arguments: /usr/bin/cc -cc1 -triple
powerpc64-unknown-freebsd13.0 -emit-obj -disable-free -main-file-name crafty.c
-mrelocation-model pic -pic-level 2 -mthread-model posix -relaxed-aliasing
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu ppc64 -target-feature +secure-plt -mfloat-abi hard
-dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer
-coverage-notes-file /tmp/usr/ports/games/crafty/work/crafty-25.2_1/crafty.gcno
-resource-dir /usr/lib/clang/9.0.0 -D HASHSTATS -D TRACE -D
BOOKDIR="/usr/local/lib/crafty" -D LOGDIR="/tmp" -D RCDIR="~/" -D
TBDIR="/usr/local/lib/crafty/TB" -D PERSDIR="/usr/local/lib/crafty/cpf" -D
SKILL -D CPUS=1 -D SYZYGY -D TEST -D CPUS=4 -D UNIX -O3 -Wall -Wno-array-bounds
-fdebug-compilation-dir /tmp/usr/ports/games/crafty/work/crafty-25.2_1
-ferror-limit 19 -fmessage-length 106 -pthread -stack-protector 2
-fno-signed-char -fobjc-runtime=gnustep -fdiagnostics-show-option
-fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -o crafty.o -x c
crafty.c 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'crafty.c'.
4.      Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on
function '@RootMoveList'
#0 0x00000000136f5e50 PrintStackTrace
/usr/src/contrib/llvm/lib/Support/Unix/Signals.inc:533:13
#1 0x00000000136f64cc /usr/src/contrib/llvm/lib/Support/Unix/Signals.inc:593:3
#2 0x00000000136f3790 RunSignalHandlers
/usr/src/contrib/llvm/lib/Support/Signals.cpp:67:5
#3 0x00000000136f6c44 SignalHandler
/usr/src/contrib/llvm/lib/Support/Unix/Signals.inc:375:3
#4 0x00000008151d176c handle_signal /usr/src/lib/libthr/thread/thr_sig.c:248:3
cc: error: unable to execute command: Abort trap (core dumped)
cc: error: clang frontend command failed due to signal (use -v to see
invocation)
FreeBSD clang version 9.0.0 (tags/RELEASE_900/final 372316) (based on LLVM
9.0.0)
Target: powerpc64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin


Obviously, passing -mpopcnt is a bug in crafty, but the point here is clang's
crash. I've attached the preprocessed souce file and the running script.

-- 
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/20191121/ec30f801/attachment.html>


More information about the llvm-bugs mailing list