On 9/16/20 12:25 PM, Aldy Hernandez wrote:
>> // Swap min/max if they are out of order. Return TRUE if further
> these seems OK, but can't there be anti-ranges with symbolics too? ie
> ~[a_12, a_12]
> The code for that just does:
>
> else if (src.kind () == VR_ANTI_RANGE)
> set (src.min (), src.max (), VR_ANTI_RANGE);
>
> That should just go to varying I guess?
Ah, you're right. I've tweaked the patch and have added a
corresponding test.
>
> The conversion to legacy anti-range code also seems a little suspect in
> some cases...
>
> Finally, we theoretically shouldn't be accessing 'min()' and 'max()'
> fields in a multirange, which also looks like might happen in the final
> else clause.
>
> I wonder if it might be less complex to simply have 2 routines, like
> copy_to_legacy() and copy_from_legacy() instead of trying to handle
> then together? I do find it seems to require more thinking than it
> should to follow the cases :-)
Sigh, yes. That code is too clever for its own good. I'll work on it
as a follow-up.
OK pending tests?
OK. but do follow it up.
Andrew