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: [PATCH] Fix var-tracking ICE (PR debug/46387)


On Thu, Nov 11, 2010 at 11:04:49AM +0100, Richard Guenther wrote:
> On Thu, Nov 11, 2010 at 12:16 AM, Jakub Jelinek <jakub@redhat.com> wrote:

> > +/* Equate REG_BASE_VALUE (reg1) to REG_BASE_VALUE (reg2),
> > + ? or reset it back to its original value if reg2 == reg1. ?*/
> > +
> > +void
> > +equate_reg_base_value (const_rtx reg1, const_rtx reg2)
> > +{
> > + ?gcc_assert (REGNO (reg1) < FIRST_PSEUDO_REGISTER
> > + ? ? ? ? ? ? && REGNO (reg2) < FIRST_PSEUDO_REGISTER);
> > + ?if (reg1 == reg2)
> > + ? ?VEC_replace (rtx, reg_base_value, REGNO (reg1),
> > + ? ? ? ? ? ? ? ?static_reg_base_value[REGNO (reg1)]);
> 
> That's not ok - static_reg_base_value is only used as initial
> value for the iteration that will eventually end up invalidating
> it, so you can't simply re-set it to that value.

The function asserts it is equal when changing to different value,
so copying static_reg_base_value is known to be the restore for it.
var-tracking only does this with a reg (argp resp. framep) if it is known to
be eliminated already, so it really can't have different value.

> Why reset it at all?  I think we do init_alias_analysis () everywhere
> we need it.

E.g. var-tracking.c itself doesn't call init_alias_analysis, and it wouldn't
surprise me if final in a target or two didn't query alias analysis.
As argp/framep should be eliminated from the IL after RA, in theory keeping
it that way shouldn't cause any differences, just wanted to play safe.

	Jakub


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