Dear GCC Developers/Users,

I am working on a port of a target backend. I have a problem when
compiling the following program:

---snip---
short b = 5;
short c = 5;
int main(void)
{
        long int a[b][c];
        a[1][1]=5;
        return 0;
}
---snap---

During compilation I get the following error message:

---snip---
simple_alloc.c: In function 'main':
simple_alloc.c:8: error: unable to find a register to spill in class
'FP_REGS'
simple_alloc.c:8: error: this is the insn:
(insn 45 47 46 0 (set (subreg:SI (reg:DI 92 [ D.1212 ]) 4)
        (reg:SI 1 r1 [orig:93 D.1211 ] [93])) 40 {movsi_general} (nil)
    (expr_list:REG_DEAD (reg:SI 1 r1 [orig:93 D.1211 ] [93])
        (expr_list:REG_NO_CONFLICT (reg:SI 1 r1 [orig:93 D.1211 ] [93])
            (nil))))
simple_alloc.c:8: confused by earlier errors, bailing out
---snap---

After a while of diving through gcc source code I can't get a clue
what's going wrong.
The problem is that the reloading stage fails because it can't find any
free registers for spilling, right? But the compiler says that it wants
to spill in class 'FP_REGS' and the above RTL-statement doesn't have
anything to do with floating point arithmetic!?!?!

I found out that in "gcc/reload1.c:find_reg()" the following
if-statement never gets satisfied:

---snip---
if (! TEST_HARD_REG_BIT (not_usable, regno)
          && ! TEST_HARD_REG_BIT (used_by_other_reload, regno)
          && HARD_REGNO_MODE_OK (regno, rl->mode))
---snap---

This causes in the end the error message because no suitable registers
could be found.
Does anybody have an idea what could be wrong in the machine description
or to where start finding the error?

Any suggestions are welcome.

Regards,
Markus Franke

-- 
Nichts ist so praktisch wie eine gute Theorie!

Reply via email to