Why reload make bad code?
Naveen Sharma, Noida
naveens@noida.hcltech.com
Tue Dec 24 09:12:00 GMT 2002
> BUT after reload/global_alloc, It generate bad code.
>
> ...
> (insn:HI 16 15 387 0 0x4001d370 (set (reg:SI 28 %r12)
> (mem/s:SI (plus:SI (mem/f:SI (plus:SI (reg/f:SI 7 %sp)
> (const_int 76 [0x54])) [2 S+0 S4 A32])
> (const_int 16 [0x10])) [4 <variable>._wds+0
> S4 A32])) 2 {*zkrisc.md:141} (insn_list 4 (nil))
> (nil))
> ...
>
> below is some information:
> %ap is arg pointer register, it will be eliminated by %fp or %sp.
> In this function: (%ap + 4) == (%sp + 76)
> FIRST_PSEUDO_REGISTER is 32.
> all outgoing args store in stack
> (plus (REG) (CONST_INT)) is legitimate addres,
> (set (REG) (MEM (plus (REG) (CONST_INT)))) is legitimated also.
Have you defined LEGITIMIZE_RELOAD_ADDRESS macro? I think
reload uses that to check the legitimacy of an address.
Also check the documentation of this macro at
http://gcc.gnu.org/onlinedocs/gccint/Addressing-Modes.html
Best Regards,
Naveen Sharma.
> gcc version is 3.3(2002/12/16)
>
> I tried to find the reason, but I failed. I need your help,
> please tell me what's the matter?
> (Maybe the information is not enough, tell me if it is)
More information about the Gcc
mailing list