On 11/9/18 9:19 AM, Richard Biener wrote:

This adds value_range_base, a base class of class value_range
with all members but the m_equiv one.

First of all, thanks so much for doing this!


I have looked into the sole GC user, IPA propagation, and replaced
the value_range use there with value_range_base since it also
asserted the equiv member is always NULL.

This in turn means I have written down that GC users only can
use value_range_base (and fixed the accessability issue with
adding a bunch of friends).

+
 /* Range of values that can be associated with an SSA_NAME after VRP
-   has executed.  */
-class GTY((for_user)) value_range
+   has executed.  Note you may only use value_range_base with GC memory.  */
+class GTY((for_user)) value_range_base
+{

GC users cannot use the derived value_range? Either way could you document the "why" this is the case above?

And thanks for adding those accessibility friends, they're a pain to get right. It's a pity we have to go to such lengths to deal with this shit.


I have moved all methods that are required for this single user
sofar (without looking with others are trivially movable because
they do not look at equivs - that's for a followup).  I ended

That would be great.

up basically duplicating the ::union_ wrapper around union_ranges
(boo).  Some more refactoring might save us a few lines here.

There are two places where IPA prop calls extract_range_from_unary_expr.
I've temporarily made it use value_range temporaries there given
I need to think about the few cases of ->deep_copy () we have in
there.  IMHO equiv handling would need to move to the callers or
rather "copies" shouldn't be handled by extract_range_from_unary_expr.
Well, I need to think about it.  (no, I don't want to make that
function virtual)

The other workers might be even easier to massage to work on
value_range_base only.

If value_range_base is the predominant idiom, perhaps it should be called value_range and the derived class be called value_range_with_equiv or some such?


Bootstrap and regtest running on x86_64-unknown-linux-gnu.

If that goes well I want to apply this even in its incomplete form.
Unless there are any complaints?

Fine by me.  Again, thanks.
Aldy

Reply via email to