[PATCH] Fix PR38359, wrong folding of -1 >> x

Kaveh R. GHAZI ghazi@caip.rutgers.edu
Tue Dec 2 16:27:00 GMT 2008


On Tue, 2 Dec 2008, Richard Guenther wrote:

> Committed with the additional adjustment to shiftopt-1.c.
> Richard.
>
>     if (0 >> x != 0)
>       link_error ();
> -
> -   if (-1 >> x != -1)
> -     link_error ();
> -
> -   if (~0 >> x != ~0)
> -     link_error ();
>   }
>
>   int

IMHO, rather than remove these you should wrap 'x' with abs() so that the
folding still triggers and you still test this particular codepath.

		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu



More information about the Gcc-patches mailing list