https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103623
Bug ID: 103623 Summary: error: unable to generate reloads (ICE in curr_insn_transform, at lra-constraints.c:4132), or error: insn does not satisfy its constraints (ICE in extract_constrain_insn_cached, at recog.c:2682) Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com Target Milestone: --- Target: powerpc-*-linux-gnu 1. gcc 12.0.0 20211205 snapshot (g:c9419faef0bfaf31e6a6f744baa064892e0d105c) ICEs when compiling the following testcase, extracted from gcc/testsuite/gcc.target/powerpc/pack02.c, w/ -mcpu=401 (which is inadequate for this, of course): #define PACK __builtin_pack_longdouble #define UNPACK __builtin_unpack_longdouble #define LDOUBLE long double int main (void) { double high = __builtin_pow (2.0, 60); double low = 2.0; LDOUBLE a = ((LDOUBLE)high) + ((LDOUBLE)low); double x0 = UNPACK (a, 0); if (high != x0) __builtin_abort (); return 0; } % powerpc-e300c3-linux-gnu-gcc-12.0.0 -mcpu=401 ofgmx8m0.c ofgmx8m0.c: In function 'main': ofgmx8m0.c:17:1: error: unable to generate reloads for: 17 | } | ^ (insn 23 22 24 2 (set (mem/c:DF (plus:SI (reg/f:SI 110 sfp) (const_int 40 [0x28])) [2 x0+0 S8 A64]) (unspec:DF [ (reg:TF 125) (const_int 0 [0]) ] UNSPEC_UNPACK_128BIT)) "ofgmx8m0.c":11:15 1061 {unpacktf_nodm} (expr_list:REG_DEAD (reg:TF 125) (nil))) during RTL pass: reload ofgmx8m0.c:17:1: internal compiler error: in curr_insn_transform, at lra-constraints.c:4132 0x6ac6f5 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211205/work/gcc-12-20211205/gcc/rtl-error.c:108 0x6824b9 curr_insn_transform /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211205/work/gcc-12-20211205/gcc/lra-constraints.c:4132 0xce2e8b lra_constraints(bool) /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211205/work/gcc-12-20211205/gcc/lra-constraints.c:5161 0xccc71d lra(_IO_FILE*) /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211205/work/gcc-12-20211205/gcc/lra.c:2336 0xc834e4 do_reload /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211205/work/gcc-12-20211205/gcc/ira.c:5932 0xc834e4 execute /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211205/work/gcc-12-20211205/gcc/ira.c:6118 2. Adding -O1 yields the following instead: % powerpc-e300c3-linux-gnu-gcc-12.0.0 -mcpu=401 -O1 ofgmx8m0.c ofgmx8m0.c: In function 'main': ofgmx8m0.c:17:1: error: insn does not satisfy its constraints: 17 | } | ^ (insn 6 5 7 2 (set (reg/v:DF 117 [ x0 ]) (unspec:DF [ (reg:TF 119) (const_int 0 [0]) ] UNSPEC_UNPACK_128BIT)) "ofgmx8m0.c":11:15 1061 {unpacktf_nodm} (expr_list:REG_DEAD (reg:TF 119) (expr_list:REG_EQUAL (unspec:DF [ (const_double:TF 1.152921504606846978e+18 [0x0.800000000000001p+61]) (const_int 0 [0]) ] UNSPEC_UNPACK_128BIT) (nil)))) during RTL pass: combine ofgmx8m0.c:17:1: internal compiler error: in extract_constrain_insn_cached, at recog.c:2682 0x6ac6f5 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211205/work/gcc-12-20211205/gcc/rtl-error.c:108 0x6ac721 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*) /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211205/work/gcc-12-20211205/gcc/rtl-error.c:118 0x6aadd4 extract_constrain_insn_cached(rtx_insn*) /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211205/work/gcc-12-20211205/gcc/recog.c:2682 0x164f4bf get_attr_prefixed(rtx_insn*) /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211205/work/gcc-12-20211205/gcc/config/rs6000/rs6000.md:329 0x12292f1 rs6000_insn_cost /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211205/work/gcc-12-20211205/gcc/config/rs6000/rs6000.c:22450 0x12292f1 rs6000_insn_cost /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211205/work/gcc-12-20211205/gcc/config/rs6000/rs6000.c:22429 0x18116ee combine_instructions /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211205/work/gcc-12-20211205/gcc/combine.c:1200 0x18116ee rest_of_handle_combine /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211205/work/gcc-12-20211205/gcc/combine.c:14904 0x18116ee execute /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211205/work/gcc-12-20211205/gcc/combine.c:14949 Some target support Apparently some target support check Apparently there's a missing check somewhere for target TFmode support.