This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PR26998, bad logic in VRP for NEGATE_EXPR
- From: Duncan Sands <baldrick at free dot fr>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Richard Guenther <rguenther at suse dot de>, dnovillo at redhat dot com
- Date: Fri, 9 Jun 2006 10:29:15 +0200
- Subject: Re: [PATCH] Fix PR26998, bad logic in VRP for NEGATE_EXPR
- References: <Pine.LNX.firstname.lastname@example.org>
> 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
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)?