New user self-registration is disabled due to spam. For an account please email bugs-admin@lists.llvm.org with your e-mail address and full name.

Bug 43976 - Assertion failed: ((Op.getOpcode() == ISD::FP_TO_SINT || Subtarget.hasFPCVT()) && "i64 FP_TO_UINT is supported only with FPCVT"), function LowerFP_TO_INTForReuse, file llvm/lib/Target/PowerPC/PPCISelLowering.cpp, line 7706.
Summary: Assertion failed: ((Op.getOpcode() == ISD::FP_TO_SINT || Subtarget.hasFPCVT()...
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Backend: PowerPC (show other bugs)
Version: 10.0
Hardware: Other FreeBSD
: P enhancement
Assignee: Hal Finkel
URL:
Keywords:
Depends on:
Blocks: release-10.0.1
  Show dependency tree
 
Reported: 2019-11-12 04:11 PST by Piotr Kubaj
Modified: 2020-05-19 08:41 PDT (History)
9 users (show)

See Also:
Fixed By Commit(s): 64b31d9 3de89abf189


Attachments
crash data (326.00 KB, application/x-tar)
2019-11-12 04:11 PST, Piotr Kubaj
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj 2019-11-12 04:11:27 PST
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.
Comment 1 Piotr Kubaj 2020-04-04 08:49:11 PDT
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
Comment 2 Nemanja Ivanovic 2020-04-06 09:01:36 PDT
Fix in: https://reviews.llvm.org/D77564

Please confirm that it fixes the original issue.
Comment 3 Piotr Kubaj 2020-04-06 12:24:16 PDT
Yes, it works, thanks!
Comment 4 Piotr Kubaj 2020-04-06 12:24:49 PDT
@dim
Can you backport it to FreeBSD's head?
Comment 5 Tom Stellard 2020-04-28 15:55:49 PDT
Hal, is this Ok to backport to the release/10.x branch.
Comment 6 Hal Finkel 2020-05-19 05:09:35 PDT
(In reply to Tom Stellard from comment #5)
> Hal, is this Ok to backport to the release/10.x branch.

Yes, LGTM.
Comment 7 Tom Stellard 2020-05-19 08:41:45 PDT
Merged: 3de89abf189