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 PR38359, wrong folding of -1 >> x


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


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