This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: c-torture/execute/991221-1.c: un-normalizable ranges
- To: Alexandre Oliva <aoliva at cygnus dot com>
- Subject: Re: c-torture/execute/991221-1.c: un-normalizable ranges
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Thu, 18 May 2000 21:59:55 -0600
- cc: gcc-patches at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <or4s7y7705.fsf@zecarneiro.lsd.ic.unicamp.br>you write:
> fold_range_test() miscomputes the value of the expression:
>
> (msize != 0 && ((msize - 1) > (2147483647L * 2UL + 1) )
>
> when typeof(msize) is a 32-bit unsigned long. It ends up being
> transformed in a LE expression.
>
> The problem is that make_range computes the range as low==1 and
> high==0, which is invalid. Here's a patch that fixes this bug. Ok to
> install, assuming it doesn't introduce any regressions? I'm currently
> testing it on x86, but I'll only be able to verify the results
> tomorrow.
>
>
> --=-=-=
> Content-Type: text/x-patch
> Content-Disposition: inline; filename=fold-degen-interval.patch
>
> Index: gcc/ChangeLog
> from Alexandre Oliva <aoliva@cygnus.com>
>
> * fold-const.c (make_range): Handle degenerated intervals.
> Fixes c-torture/execute/991221-1.c
Assuming it didn't introduce any regressions, this is fine after you fix the
comment mis-formatting:
> ! /* If the range is of the form +/- [ x+1, x ], we won't
> ! be able to normalize it. But then, it represents the
> ! whole range or the empty set, so make it +/- [ -, - ].
> ! */
The close comment belongs on the previous line.
jeff