Created attachment 22798 [details] crash data When building on FreeBSD/powerpc64-elfv2: cc -I/tmp/usr/ports/devel/libslang2/work/slang-2.3.2/src -shared -fPIC -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing -I/tmp/usr/ports/devel/libslang2/work/slang-2.3.2/src /tmp/usr/ports/devel/libslang2/work/slang-2.3.2/modules/select-module.c -o select-module.so -lncurses -fstack-protector-strong -Wl,-rpath,/usr/local/lib:/usr/local/lib -lm Assertion failed: ((Op.getOpcode() == ISD::FP_TO_SINT || Subtarget.hasFPCVT()) && "i64 FP_TO_UINT is supported only with FPCVT"), function LowerFP_TO_INTForReuse, file /usr/src/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp, line 7276. Stack dump: 0. Program arguments: /usr/bin/cc -cc1 -triple powerpc64-unknown-freebsd13.0 -emit-obj -disable-free -main-file-name select-module.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 -resource-dir /usr/lib/clang/9.0.0 -I /tmp/usr/ports/devel/libslang2/work/slang-2.3.2/src -D LIBICONV_PLUG -I /tmp/usr/ports/devel/libslang2/work/slang-2.3.2/src -O2 -fdebug-compilation-dir /tmp/usr/ports/devel/libslang2/work/slang-2.3.2/modules/powerpc64objs -ferror-limit 19 -fmessage-length 106 -stack-protector 2 -fno-signed-char -fobjc-runtime=gnustep -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -o /tmp/select-module-2a3aa3.o -x c /tmp/usr/ports/devel/libslang2/work/slang-2.3.2/modules/select-module.c 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module '/tmp/usr/ports/devel/libslang2/work/slang-2.3.2/modules/select-module.c'. 4. Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on function '@select_intrin' 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 Preprocessed source and the running script are attached.
Reduced to: double a; b() { long c = (unsigned long)a; d(c * 1e6); } Compile with (setting -O0 makes the compilation pass, -O1 and higher fail): /usr/bin/cc -cc1 -triple powerpc64-unknown-freebsd13.0 -emit-obj -O1 -x c select-module-ffa857.c
Fix in: https://reviews.llvm.org/D77564 Please confirm that it fixes the original issue.
Yes, it works, thanks!
@dim Can you backport it to FreeBSD's head?
Hal, is this Ok to backport to the release/10.x branch.
(In reply to Tom Stellard from comment #5) > Hal, is this Ok to backport to the release/10.x branch. Yes, LGTM.
Merged: 3de89abf189