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] Fix PR26998, bad logic in VRP for NEGATE_EXPR


> This fixes PR26998 by ensuring that we do not use fold_unary_to_constant
> with a NEGATE_EXPR if we know that will overflow.  The current check for
> this case is bogus, as the only value that will overflow in this case
> is the signed TYPE_MIN_VALUE, there is no reason to handle TYPE_MAX_VALUE
> specially.

Ada can generate types with pretty much any value for TYPE_MIN_VALUE
and TYPE_MAX_VALUE, for example TYPE_MIN_VALUE=-1, TYPE_MAX_VALUE=10.
Isn't -TYPE_MAX_VALUE then problematic (not to mention -2, .., -9)?

Best wishes,

Duncan.


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