This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFC: Ensure TREE_TYPE (TYPE_MIN_VALUE (t)) == t
> Well, VRP never actually does the type comparison that I wrote. The
> real question is whether, given a NEGATE_EXPR applied to 'max', this
> test is flawed:
>
> if (max != TYPE_MIN_VALUE (TREE_TYPE (max)))
I wouldn't want to make that assumption. Instead, I'd use something
like operand_equal_p so that slight differences in types will be ignored.
It's much more robust not to make such assumptions unless you absolutely
have to. And there seem to be at least two cases where it's wrong:
variants and subtypes.