This is the mail archive of the gcc-regression@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: 6 GCC regressions, 2 new, with your patch on 2002-07-20T23:26:42Z.


> Date: Sun, 21 Jul 2002 21:38:43 +0200
> From: Jan Hubicka <jh@suse.cz>

> This is really interesting case.  The beggining of function contains:
> (insn 4 3 6 0 (nil) (set (reg:SI 62)
>         (mem/f:SI (plus:SI (reg/f:SI 16 argp)
>                 (const_int 4 [0x4])) [4 y+0 S4 A32])) 45 {*movsi_1}
> (nil)
>     (expr_list:REG_EQUIV (mem/f:SI (plus:SI (reg/f:SI 16 argp)
>                 (const_int 4 [0x4])) [4 y+0 S4 A32])
>         (nil)))
> 
> And later also:
> 
> (insn 12 6 21 0 0x401a3a80 (set (reg/v/f:SI 64)
>         (mem/f:SI (plus:SI (reg/f:SI 16 argp)
>                 (const_int 4 [0x4])) [4 S4 A8])) 45 {*movsi_1} (nil)
>     (nil))
> 
> cselib notices the equivalence and cprop actually does the replacement
> of reg 64 by reg 62.  But the REG_EQUIV note is not really valid, as the
> value of memory copy y is not valid during the function (overwriten by
> bar call).  Just before register allocation the load of register 62
> appears to be moved just before the assignment. I am not sure who does
> the movement but it is valid given the information about equivalency
> with memory.
> 
> cse.c seems to contain code preventing such a substitution as gcse does,
> so I am attaching simple patch that does the same for cprop and I will
> install it as obvious as I am not quite sure whether I will be able to
> read my email tomorrow.
> 
> Sun Jul 21 21:35:20 CEST 2002  Jan Hubicka  <jh@suse.cz>
> 	* gcse.c (do_local_cprop): Do not extend lifetimes of registers set by
> 	do_local_cprop.

I think that this patch just papers over the real problem, which is
that the REG_EQUIV note is not correct; it should be REG_EQUAL.  The
whole purpose of REG_EQUIV notes is that you can always make the
substitution safely.

-- 
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>


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