Fix to regclass problem

Michael Hayes m.hayes@elec.canterbury.ac.nz
Tue Nov 30 23:59:00 GMT 1999


Jeffrey A Law writes:

 > Getting Richard a testcase would help...

Sure, this one should be simple enough ;-)

Build a c4x cross compiler and try cc1 -O2 with

int bar(int **a)
{
  return **a;
}


I now get

_bar:
	ldiu	*ar2,r1
	lda	r1,ar0    <= insn added by reload.
	ldiu	*ar0,r0
	rets
	.end


Here's the lreg dump:


;; Function bar

41 registers.

Register 39 used 2 times across 2 insns in block 0; set 1 time; pointer.

1 basic blocks, 2 edges.

Basic block 0: first insn 23, last 16.
Predecessors:  ENTRY (fallthru)
Successors:  EXIT (fallthru)
Registers live at start: 10 11 20
Registers live at end: 11 20

;; Register 39 in 1.
(note 2 0 23 "" NOTE_INSN_DELETED)

;; Start of basic block 0, registers live: 10 [ar2] 11 [ar3] 20 [sp]
(note 23 2 4 [bb 0] NOTE_INSN_BASIC_BLOCK)

(note 4 23 5 "" NOTE_INSN_DELETED)

(note 5 4 6 "" NOTE_INSN_FUNCTION_BEG)

(note 6 5 8 "" NOTE_INSN_DELETED)

(note 8 6 9 "" NOTE_INSN_DELETED)

(note 9 8 11 "" NOTE_INSN_DELETED)

(insn 11 9 13 (set (reg:QI 39)
        (mem:QI (reg:QI 10 ar2) 2)) 16 {movqi_noclobber} (nil)
    (expr_list:REG_DEAD (reg:QI 10 ar2)
        (nil)))

(note 13 11 15 "" NOTE_INSN_DELETED)

(insn 15 13 16 (set (reg/i:QI 0 r0)
        (mem:QI (reg:QI 39) 3)) 16 {movqi_noclobber} (insn_list 11 (nil))
    (expr_list:REG_DEAD (reg:QI 39)
        (nil)))

(insn 16 15 0 (use (reg/i:QI 0 r0)) -1 (insn_list 15 (nil))
    (expr_list:REG_DEAD (reg/i:QI 0 r0)
        (nil)))
;; End of basic block 0


Now instead of allocating an address register for pseudo 40, gcc
allocates a data register and thus reload has to swing into action...


Michael.








More information about the Gcc-patches mailing list