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: Array prefetch patch


On Tue, Dec 11, 2001 at 09:54:59AM +0100, Jan Hubicka wrote:
> > I've been playing with Honza's prefetch optimization patch, too, and
> > have some changes to the one he just sent in:
> > 
[snip]
> > 
> >   Use of the function remove_constant_addition causes a failure in the
> >   test gcc.c-torture/execute/920501-6.c when it is compiled with
> >   "-O3 -fprefetch-loop-arrays".  With the call to it commented out it's
> >   OK.  I can look into it further, since this is undoubtedly supposed
> >   to be doing something useful.
> Interesting, I went trought testsuite with -fprefetch-loop-arrays and it
> did work for me.  What kind of failure you get?

This test case, based on code in 920501-6.c, uses the wrong address for
str when compiled with "-O2 -fprefetch-loop-arrays" if I don't remove
the call to remove_constant_addition:

int
main ()
{
  int d;
  unsigned int num;
  char *str = "1234";

  num =  *str++ - '0';
  d = *str++;
  while (d != '\0')
    {
      num = num * 10 + d - '0';
      d = *str++;
    }

  if (num != 1234)
    abort ();

  exit(0);
}

> > 
> >   There are some "???" strings where I find things confusing.
> 
> I will clarify/fix these and send updated patch after finishing the
> -march/-mcpu tweeks we need for prefetch support on x86.  Thanks!

Great, thank you!

If it doesn't work to have separate -march/-mcpu names for each kind of
x86 processor then documenting the combination of options needed to
support each processor might be a valid alternative.  I just heard that
prefetch on early versions of Athlon corrupts the cache, so perhaps the
user does need some control.

Janis

P.S.  Bootstrap (with -fprefetch-loop-arrays) and testing on ia64-linux
went fine.


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