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: [RFC] Fix PR rtl-optimization/33732


On Tue, Nov 06, 2007 at 02:19:16PM +0100, Rask Ingemann Lambertsen wrote:
>    Currently, we stop df from keeping its data up-to-date shortly before
> calling reload() (in two places in global.c). Suppose we move that into
> reload1.c/reload() itself after this bit:
> 
>   /* Alter each pseudo-reg rtx to contain its hard reg number.
>      Assign stack slots to the pseudos that lack hard regs or equivalents.
>      Do not touch virtual registers.  */
> 
>   for (i = LAST_VIRTUAL_REGISTER + 1; i < max_regno; i++)
>     alter_reg (i, -1);
> 
>    At this point, df should be able to update the REG_DEAD notes. Then we
> can turn off df rescanning for the rest of reload.

   I gave it a shot, but DF doesn't seem to get it right. From the lreg
dump:

(insn 73 72 70 4 longlong.c:19 (set (reg:SI 154 [+4 ])
        (lshiftrt:SI (reg:SI 141)
            (subreg:SI (reg:DI 116) 4))) 277 {lshrsi3} (expr_list:REG_DEAD (reg:SI 141)
        (expr_list:REG_DEAD (reg:DI 116)
            (nil))))

(insn 70 73 71 4 longlong.c:19 (set (reg:SI 140)
        (minus:SI (const_int 31 [0x1f])
            (subreg:SI (reg:DI 137) 4))) 184 {*pa.md:5698} (expr_list:REG_DEAD (reg:DI 137)
        (nil)))

   Right after the alter_reg() loop, I added a loop over the insns to delete
all REG_DEAD notes (for debugging purposes only):

(insn 73 72 70 4 longlong.c:19 (set (reg:SI 21 %r21 [orig:154+4 ] [154])
        (lshiftrt:SI (reg:SI 28 %r28 [141])
            (subreg:SI (reg:DI 23 %r23 [116]) 4))) 277 {lshrsi3} (nil))

(insn 70 73 71 4 longlong.c:19 (set (reg:SI 88 SAR [140])
        (minus:SI (const_int 31 [0x1f])
            (subreg:SI (reg:DI 21 %r21 [137]) 4))) 184 {*pa.md:5698} (nil))

   df_note_add_problem() + df_analyze() adds an incorrect REG_DEAD note to
insn 70:

(insn 73 72 70 4 longlong.c:19 (set (reg:SI 21 %r21 [orig:154+4 ] [154])
        (lshiftrt:SI (reg:SI 28 %r28 [141])
            (subreg:SI (reg:DI 23 %r23 [116]) 4))) 277 {lshrsi3} (expr_list:REG_DEAD (reg:SI 28 %r28 [141])
        (expr_list:REG_DEAD (reg:DI 23 %r23 [116])
            (nil))))

(insn 70 73 71 4 longlong.c:19 (set (reg:SI 88 SAR [140])
        (minus:SI (const_int 31 [0x1f])
            (subreg:SI (reg:DI 21 %r21 [137]) 4))) 184 {*pa.md:5698} (expr_list:REG_DEAD (reg:DI 21 %r21 [137])
        (nil)))

   I'm digging further into this.

-- 
Rask Ingemann Lambertsen
Danish law requires addresses in e-mail to be logged and stored for a year


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