This is the mail archive of the gcc@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: PTR-PLUS merge into the mainline


Hi,

On Fri, 15 Jun 2007, Andrew_Pinski@PlayStation.Sony.Com wrote:

>   This patch merges in the pointer_plus branch.  Hopefully I did not mess 
> anything up.

I found a small regression caused by this, e.g.:

int g(void);

void f(int *p, int i)
{
        p[i] = g();
        p[i + 2] = g();
        p[i + 1] = g();
        p[i + 100] = g();
}

If I compile it with -fdump-tree-original I get this in the dump:

  *(p + (unsigned int) ((unsigned int) i * 4)) = g ();
  *(p + ((unsigned int) ((unsigned int) i * 4) + 8)) = g ();
  *(p + ((unsigned int) i + 1) * 4) = g ();
  *(p + ((unsigned int) ((unsigned int) i * 4) + 400)) = g ();

Notice that it generates the (i + 1) * 4 instead of (i * 4) + 4 as with 
the other cases. While I tried to debug this I narrowed it down to the 
changes in fold_binary(), but I don't really know how to fix this, so 
I could use some help here.
Thanks.

bye, Roman


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