This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
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