LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 45274 - Assertion failed: (!isSigned && "Legalize cannot Expand SINT_TO_FP for i64 yet"), function ExpandLegalINT_TO_FP, file lib/CodeGen/Selection DAG/LegalizeDAG.cpp, line 2420.
Summary: Assertion failed: (!isSigned && "Legalize cannot Expand SINT_TO_FP for i64 ye...
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Common Code Generator Code (show other bugs)
Version: 10.0
Hardware: Other FreeBSD
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords: regression
Depends on:
Blocks: release-10.0.1
  Show dependency tree
 
Reported: 2020-03-22 07:15 PDT by Piotr Kubaj
Modified: 2021-04-01 08:08 PDT (History)
5 users (show)

See Also:
Fixed By Commit(s):


Attachments
reproduction files (548.42 KB, application/x-xz)
2020-03-22 07:15 PDT, Piotr Kubaj
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj 2020-03-22 07:15:27 PDT
Created attachment 23271 [details]
reproduction files

FreeBSD head on powerpc64 with LLVM 10 rc4.

Compiling emulators/mednafen port fails, this is a regression from 9.0.1:
Assertion failed: (!isSigned && "Legalize cannot Expand SINT_TO_FP for i64 yet"), function ExpandLegalINT_TO_FP, file /usr/src/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp, line 2420.
Stack dump:
0.      Program arguments: c++ -std=gnu++11 -fsigned-char -DLOCALEDIR="/usr/local/share/locale" -DHAVE_CONFIG_H -I/usr/local/include/SDL2 -I/usr/local/include -D_REENTRANT -D_THREAD_SAFE -I../../include -I../../include -I../../intl -I/usr/local/include -DLIBICONV_PLUG -D_THREAD_SAFE -fno-fast-math -fno-unsafe-math-optimizations -fomit-frame-pointer -fstrict-aliasing -Wall -Wshadow -Wempty-body -Wignored-qualifiers -Wvla -Wvariadic-macros -Wdisabled-optimization -Werror=write-strings -fno-pic -fno-pie -fno-PIC -fno-PIE -fwrapv -fjump-tables
-fexceptions -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing -DLIBICONV_PLUG -MT ers.o -MD -MP -MF .deps/ers.Tpo -c -o ers.o ers.cpp
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'ers.cpp'.
4.      Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on function '@_ZN14EmuRealSyncher10AddEmuTimeElb'
Comment 1 Craig Topper 2020-03-22 21:35:13 PDT
Looks to be related to the -ffp-exception-behavior=strict option
Comment 2 Piotr Kubaj 2020-04-04 03:05:59 PDT
Here's a reduced test case:
double a;
long b;
void c() { b / a; }

I also reduced compilation options to:
/usr/bin/c++ -cc1 -triple powerpc64-unknown-freebsd13.0 -emit-obj -ffp-exception-behavior=strict -x c++ main-8d9e47.cpp
Comment 3 Alfredo Dal'Ava Júnior 2020-05-19 06:18:20 PDT
It looks like bug #45237

Also reproduced on LLVM10 and trunk@3e315697ac7. Ommiting -ffp-exception-behavior=strict workarounds it. It's not reproduced on LLVM9 however -ffp-exception-behavior=strict is not available on that version.
Comment 4 Alfredo Dal'Ava Júnior 2020-05-19 06:55:10 PDT
Despite being a regression between 9 and 10, marking the release-10.0.1 blocker for you to decide. Thanks!
Comment 5 Tom Stellard 2020-06-18 19:53:02 PDT
Is there a fix for this?
Comment 6 Piotr Kubaj 2021-04-01 08:08:30 PDT
Seems to work fine in LLVM 11.0.1.