https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121847

            Bug ID: 121847
           Summary: [M68K] [LRA] ICE in gen_rtx_SUBREG, at
                    emit-rtl.cc:1048
           Product: gcc
           Version: 15.2.1
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, ra
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: [email protected]
            Blocks: 113939
  Target Milestone: ---
            Target: m68k-*-*

$ cat s_cexp.i
double __cexp_x;
long double __cexp_remainder;
_Complex __cexp() {
  __asm("" : "=f"(__cexp_remainder) : "0"(__cexp_x));
  return __cexp_x;
}
$ gcc/xgcc -B gcc/ -mlra -O -S s_cexp.i
during RTL pass: reload
s_cexp.i: In function ‘__cexp’:
s_cexp.i:6:1: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.cc:1048
    6 | }
      | ^
0x1dc860d internal_error(char const*, ...)
        ../../gcc/gcc/diagnostic-global-context.cc:786
0x69e9c5 fancy_abort(char const*, int, char const*)
        ../../gcc/gcc/diagnostics/context.cc:1787
0x9b659d gen_rtx_SUBREG(machine_mode, rtx_def*, poly_int<1u, unsigned long>)
        ../../gcc/gcc/emit-rtl.cc:1048
0xcba216 match_reload
        ../../gcc/gcc/lra-constraints.cc:1107
0xcc700e curr_insn_transform
        ../../gcc/gcc/lra-constraints.cc:4881
0xcc8b06 lra_constraints(bool)
        ../../gcc/gcc/lra-constraints.cc:5584
0xcb076a lra(_IO_FILE*, int)
        ../../gcc/gcc/lra.cc:2455
0xc5da37 do_reload
        ../../gcc/gcc/ira.cc:6068
0xc5da37 execute
        ../../gcc/gcc/ira.cc:6256

#2  0x0000000000cba217 in match_reload (out=out@entry=0 '\000', 
    ins=ins@entry=0x7fffffffd240 "\001\377", 
    outs=outs@entry=0x7fffffffd190 "", goal_class=FP_REGS, 
    exclude_start_hard_regs=exclude_start_hard_regs@entry=0x24c7a40
<goal_alt_exclude_start_hard_regs>, before=before@entry=0x7fffffffd158, 
    after=0x7fffffffd160, early_clobber_p=false)
    at ../../gcc/gcc/lra-constraints.cc:1107
1107              new_in_reg = gen_lowpart_SUBREG (inmode, reg);
(gdb) p reg
$1 = (rtx) 0x7ffff6d674c8
(gdb) pr
(reg:XF 38 [34])
(gdb) p curr_insn
$7 = (rtx_insn *) 0x7ffff6c0c400
(gdb) pr
(insn 8 7 6 2 (set (reg:XF 34)
        (asm_operands:XF ("") ("=f") 0 [
                (reg:DF 35 [ __cexp_x ])
            ]
             [
                (asm_input:DF ("0") ../s_cexp.i:4)
            ]
             [] ../s_cexp.i:4)) "../s_cexp.i":4:3 -1
     (nil))


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113939
[Bug 113939] Switch m68k to LRA

Reply via email to