public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: Why reload make bad code?
@ 2002-12-24  9:12 Naveen Sharma, Noida
  0 siblings, 0 replies; 2+ messages in thread
From: Naveen Sharma, Noida @ 2002-12-24  9:12 UTC (permalink / raw)
  To: Wang Xiaowu; +Cc: gcc

>  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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Why reload make bad code?
@ 2002-12-23  9:43 Wang Xiaowu
  0 siblings, 0 replies; 2+ messages in thread
From: Wang Xiaowu @ 2002-12-23  9:43 UTC (permalink / raw)
  To: gcc


Hello, 
 
I am writing gcc backend for a RISC arch, and I have some troubles.
The question will happend when compile with optimization and function have many local variables.
 
 below is insns before reload/global_alloc call
 ...
 (insn:HI 4 3 15 0 (nil) (set (reg/v/f:SI 39)
         (mem/f:SI (plus:SI (reg/f:SI 2 %ap)
                 (const_int 4 [0x4])) [2 S+0 S4 A32])) 2 {*zkrisc.md:141} (nil)
     (expr_list:REG_EQUIV (mem/f:SI (plus:SI (reg/f:SI 2 %ap)
                 (const_int 4 [0x4])) [2 S+0 S4 A32])
         (nil)))
 ...
 (insn:HI 16 15 17 0 0x4001d370 (set (reg/v:SI 40)
         (mem/s:SI (plus:SI (reg/v/f:SI 39)
                 (const_int 16 [0x10])) [4 <variable>._wds+0 S4 A32])) 2 {*zkrisc.md:141} (insn_list 4 (nil))
     (nil))
 ...
 
 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.
  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)

 --
Your's Sincerely,
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-12-24  7:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-24  9:12 Why reload make bad code? Naveen Sharma, Noida
  -- strict thread matches above, loose matches on Subject: below --
2002-12-23  9:43 Wang Xiaowu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).