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

            Bug ID: 84564
           Summary: error: unable to find a register to spill with
                    -mforce-indirect-call
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: ak at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-unknown-linux-gnu
            Target: i586-linux-gnu

Starting from r254560, we ICE on:

$ cat ./subsumption.i
int a, b;
int h (void);
static int c (int d, int f, int g)
{
  while (a)
    h () && c (d, f, g);
}
int x;
int i (void) { int e = c (x, b, e); }

$ gcc ./subsumption.i -O2  -mforce-indirect-call -c -m32
./subsumption.i: In function ā€˜i’:
./subsumption.i:9:1: error: unable to find a register to spill
 int i (void) { int e = c (x, b, e); }
 ^~~
./subsumption.i:9:1: error: this is the insn:
(call_insn/j 9 18 10 2 (set (reg:SI 0 ax)
        (call (mem:QI (reg/f:SI 92 [91]) [0 c S1 A8])
            (const_int 0 [0]))) "./subsumption.i":9 693 {*sibcall_value}
     (expr_list:REG_DEAD (reg/f:SI 92 [91])
        (expr_list:REG_DEAD (reg:SI 2 cx)
            (expr_list:REG_DEAD (reg:SI 1 dx)
                (expr_list:REG_CALL_DECL (symbol_ref:SI ("c") [flags 0x3]
<function_decl 0x7ffff6922f00 c>)
                    (expr_list:REG_EH_REGION (const_int 0 [0])
                        (nil))))))
    (expr_list:SI (use (reg:SI 0 ax))
        (expr_list:SI (use (reg:SI 1 dx))
            (expr_list:SI (use (reg:SI 2 cx))
                (nil)))))
during RTL pass: reload
./subsumption.i:9:1: internal compiler error: in assign_by_spills, at
lra-assigns.c:1470
0x5b93a6 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ../../gcc/rtl-error.c:108
0xa48099 assign_by_spills
        ../../gcc/lra-assigns.c:1470
0xa48aa6 lra_assign()
        ../../gcc/lra-assigns.c:1664
0xa44134 lra(_IO_FILE*)
        ../../gcc/lra.c:2475
0x9f8561 do_reload
        ../../gcc/ira.c:5465
0x9f8561 execute
        ../../gcc/ira.c:5649

Reply via email to