Hi
Am 02.10.2007 um 20:02 schrieb Rask Ingemann Lambertsen:
On Tue, Oct 02, 2007 at 02:50:50PM +0200, Boris Boesler wrote:
What does the .lreg dump file (-fdump-rtl-lreg) say about
register costs?
Pass 0
Register 101 costs: Rx_REGS:1000 Ax_REGS:0 GENERAL_REGS:1000
ALL_REGS:1000 MEM:4000
Register 96 pref Rx_REGS or none
Register 97 pref Rx_REGS or none
Register 98 pref Rx_REGS or none
Register 99 pref Rx_REGS or none
Register 100 pref Rx_REGS or none
Register 101 pref Ax_REGS, else Rx_REGS
102 registers.
[8<]
Register 101 used 2 times across 2 insns in block 3; set 1 time; pref
Ax_REGS, else Rx_REGS; pointer.
Register 101 is the important one. And it says prefer Ax; but it
worries be that the costs for Ax is 0. Does this mean the value is
placed in an Ax register or does it mean it is impossible to place
the value in a Ax register?
.lreg continues (insn 8 will be important later):
(insn 7 5 8 3 (set (reg/f:SI 101)
(symbol_ref:SI ("c") <var_decl 0x41695360 c>)) 79 {movsi} (nil)
(nil))
(insn 8 7 9 3 (set (mem/c/i:SI (reg/f:SI 101) [0 c+0 S4 A32])
(const_int 4711 [0x1267])) 79 {movsi} (nil)
(expr_list:REG_DEAD (reg/f:SI 101)
(nil)))
add_var.c:20: error: insn does not satisfy its constraints:
...
The error happens, because GO_IF_LEGITIMATE_ADDRESS (strict
version) detects, that a data register is used like an address
register - that's illegal! (BASE_REG_CLASS is defined to Ax_REGS)
GO_IF_LEGITIMATE_ADDRESS() must reject addresses which use hard
registers
of the wrong class. Even when !REG_OK_STRICT.
Ok, I check the registers in any case: now I can' compile anything!
const_assign.c:19: error: unrecognizable insn:
(insn 9 8 10 3 (set (mem/c/i:SI (reg/f:SI 102) [0 c+0 S4 A32])
(const_int 4711 [0x1267])) -1 (nil)
(nil))
const_assign.c:19: internal compiler error: in extract_insn, at
recog.c:2077
The .unshare file:
(insn 7 5 8 3 (set (reg/f:SI 101)
(symbol_ref:SI ("c") <var_decl 0x41695360 c>)) -1 (nil)
(nil))
(insn 8 7 9 3 (set (reg/f:SI 102)
(reg/f:SI 101)) -1 (nil)
(nil))
(insn 9 8 10 3 (set (mem/c/i:SI (reg/f:SI 102) [0 c+0 S4 A32])
(const_int 4711 [0x1267])) -1 (nil)
(nil))
insn 7: load a symbol reference into a register 101
insn 8: copy register 101 to register 102
insn 9: store constant
If I check my "movm" insn (in previous mail) then I notice that
there no <m,i> alternative. But even if I add this alternative the
compiler fails as well :-(
This is all confusing...
Thanks for ANY advice on writing GCC back-ends
Boris