This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GREG Expansion Problem


Philip Brown wrote:
> ;; Register dispositions:
> 32 in 2  33 in 17  34 in 2  35 in 17  37 in 17  38 in 17
> 39 in 2

Greg (global register allocator in global.c) allocated pseudo-reg 32 to hard reg 2.

Spilling for insn 4.
Using reg 2 for reload 0

Reloads for insn # 4
Reload 0: reload_out (SI) = (reg/v/f:SI 30)
	DATA_REGS, RELOAD_FOR_OUTPUT (opnum = 0)
	reload_out_reg: (reg/v/f:SI 30)
	reload_reg_rtx: (reg:SI 2 r2)

reload needed a spill reg, and choose to use r2. When r2 was made a spill reg, all pseudo-regs allocated to r2 had to be spilled to the stack.


It is obviously bad for reload to choose as its first spill reg a register which has already been used by greg. You should investigate why this happened.

The spill reg choice is made in find_reg() in reload1.c. The regs are ordered in order_regs_for_reload which should be looked at also.

The spills actually happen in finish_spills, which tries to rerun global alloc to find another free register before putting the pseudo on the stack. You might want to look at why this isn't working for you either.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]