This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix PR 22493 (Attempt 2)
On Wed, Jul 27, 2005 at 01:17:01AM -0400, James A. Morrison wrote:
> PR tree-optimization/22493
> * tree-vrp.c (extract_range_from_unary_expr): Deal with -fwrapv and
> VR_ANTI_RANGEs properly for NEGATE_EXPRs and ABS_EXPRs.
>
OK with these changes:
> - /* If the range was reversed, swap MIN and MAX. */
> - if (compare_values (min, max) == 1)
> + cmp = compare_values (min, max);
> + /* If a VR_ANTI_RANGEs contains zero, then we then have a VR_ANTI_RANGE
> + of [TYPE_MIN_VALUE, min(MIN, MAX)]. */
>
Vertical spacing before start of comment.
s/then we then.*/then we have ~[-INF, min (MIN, MAX)]./
> + if (vr0.type == VR_ANTI_RANGE)
> + {
> + if (range_includes_zero_p (&vr0))
> + {
> + tree type_min_value = TYPE_MIN_VALUE (TREE_TYPE (expr));
> +
> + /* Take the lower of the two values. */
> + if (cmp != 1)
> + max = min;
> + /* Create an anti-range from [-INF, min (abs(MIN), abs(MAX))]
> + or [TYPE_MIN_VALUE + 1, min (abs(MIN), abs(MAX))] when
>
s/TYPE_MIN_VALUE/-INF/.
Also use ~[...] instead of 'anti-range from...'