VRP: abstract out wide int CONVERT_EXPR_P code
Richard Biener
richard.guenther@gmail.com
Tue Aug 28 09:27:00 GMT 2018
On Mon, Aug 27, 2018 at 2:24 PM Aldy Hernandez <aldyh@redhat.com> wrote:
>
> Howdy!
>
> Phew, I think this is the last abstraction. This handles the unary
> CONVERT_EXPR_P code.
>
> It's the usual story-- normalize the symbolics to [-MIN,+MAX] and handle
> everything generically.
>
> Normalizing the symbolics brought about some nice surprises. We now
> handle a few things we were punting on before, which I've documented in
> the patch, but can remove if so desired. I wrote them mainly for myself:
>
> /* NOTES: Previously we were returning VARYING for all symbolics, but
> we can do better by treating them as [-MIN, +MAX]. For
> example, converting [SYM, SYM] from INT to LONG UNSIGNED,
> we can return: ~[0x8000000, 0xffffffff7fffffff].
>
> We were also failing to convert ~[0,0] from char* to unsigned,
> instead choosing to return VR_VARYING. Now we return ~[0,0]. */
>
> Tested on x86-64 by the usual bootstrap and regtest gymnastics,
> including --enable-languages=all, because my past sins are still
> haunting me.
>
> OK?
The new wide_int_range_convert_tree looks odd given it returns
tree's. I'd have expected an API that does the conversion resulting
in a wide_int range and the VRP code adapting to that by converting
the result to trees.
Richard.
More information about the Gcc-patches
mailing list