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 RFC: Ensure TREE_TYPE (TYPE_MIN_VALUE (t)) == t


On 4/28/07, Richard Kenner <kenner@vlsi1.ultra.nyu.edu> wrote:
> 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.

Yes, for this test I think !tree_int_cst_equal () is the correct thing to check.


Richard.


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