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 canonicalization of addresses


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


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