[PATCH] Fix canonicalization of addresses

Andrew Pinski pinskia@gmail.com
Tue Jan 6 22:57:00 GMT 2009


On Tue, Jan 6, 2009 at 5:36 PM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> Err, we already _do_ fold (1 - i) * -2 to (i - 1) * 2.  So, how does
> your result ever happen?
> Do you have a testcase for me?

unsigned short foo2 (unsigned int on_off, unsigned short *puls)
{
  unsigned int a = (1-on_off) * -2;
  return a;
}

Or the original case:
unsigned short foo2 (unsigned char on_off, unsigned short *puls)
{
  return puls[on_off-1];
}

We never really fold "negative" unsigned cases at all.

Thanks,
Andrew Pinski



More information about the Gcc-patches mailing list