This is the mail archive of the gcc-patches@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: The Integrated Register Allocator


> I'll take a look at other cases which fail with -fira on SH,
> though it seems that all serious cases went away now.

I've found a wrong code problem.  Here is a small testcase:

_Complex float foo_float ();

void bar_float ()
{
  __real foo_float ();
}

With -m4 -ml -fira -O0, the above testcase is compiled to

_bar_float:
        mov.l   r14,@-r15
        sts.l   pr,@-r15
        add     #-8,r15
        mov     r15,r14
        mov.l   .L3,r1
        jsr     @r1
        nop
        fmov.s  fr0,@r14
        mov     #4,r0
        mov     r14,r0
        add     r0,r0
        fmov.s  fr1,@r0
 	...

on sh-unknown-elf target, though without -fira the last 4
lines were

        mov     #4,r0
        mov     r14,r1
        add     r0,r1
        fmov.s  fr1,@r1
 	...

These 4 lines correspond to

(insn 10 9 0 3 foo.c:5 (parallel [
            (set (subreg:SF (reg:SC 165) 4)
                (reg:SF 65 fr1 [+4 ]))
            (use (reg/v:PSI 151 ))
            (clobber (scratch:SI))
        ]) 205 {movsf_ie} (nil))

in .172r.asmcons dump and .178r.ira reports

Reloads for insn # 10
Reload 0: reload_in (SI) = (const_int 4 [0x4])
        R0_REGS, RELOAD_FOR_OPERAND_ADDRESS (opnum = 0)
        reload_in_reg: (const_int 4 [0x4])
        reload_reg_rtx: (reg:SI 0 r0)
Reload 1: reload_in (SI) = (plus:SI (reg/f:SI 14 r14)
                                                    (const_int 4 [0x4]))
        GENERAL_REGS, RELOAD_FOR_OPERAND_ADDRESS (opnum = 0)
        reload_in_reg: (plus:SI (reg/f:SI 14 r14)
                                                    (const_int 4 [0x4]))
        reload_reg_rtx: (reg:SI 0 r0)

when -fira used.  It seems that R0 is wrongly used twice in
this reload.

Regards,
	kaz


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