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 VRP update_value_range and caller (PR tree-optimization/65875)


On Mon, Apr 27, 2015 at 10:05:21AM +0200, Richard Biener wrote:
> > --- gcc/tree-vrp.c.jj	2015-04-20 14:35:39.000000000 +0200
> > +++ gcc/tree-vrp.c	2015-04-24 18:10:41.321367440 +0200
> > @@ -892,7 +892,12 @@ update_value_range (const_tree var, valu
> >  	 UNDEFINED or from VARYING.  */
> >        if (new_vr->type == VR_UNDEFINED
> >  	  || old_vr->type == VR_VARYING)
> > -	set_value_range_to_varying (old_vr);
> > +	{
> > +	  BITMAP_FREE (new_vr->equiv);
> > +	  set_value_range_to_varying (old_vr);
> > +	  set_value_range_to_varying (new_vr);
> > +	  return true;
> 
> Actually we didn't change anything here (old_vr->type is VARYING already,
> so we shouldn't even have visited the stmt defining the SSA name again...
> eventually your fix below fixes that.

On the testcase, old_vr wasn't actually VARYING, but new_vr was UNDEFINED
(a result of intersecting disjoint ranges).  While for old_vr->type ==
VR_VARYING I agree we shouldn't have been called on this.

And turning a VR_RANGE into VR_UNDEFINED is going in the wrong direction
in the lattice.

	Jakub


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