RFA: Fix bootstrap/44637

Richard Guenther richard.guenther@gmail.com
Sat Jul 10 08:20:00 GMT 2010


On Sat, Jul 10, 2010 at 10:04 AM, Joern Rennecke <amylaar@spamcop.net> wrote:
> I've tried to do bootstrapping on a playstation, but I couldn't even get a
> baseline - although the compilers were built on the first day, it spent six
> more days building java libraries (and swapping, CPU usage around 1%),
> before the shell aborted for some unknown reason, and the machine locked up.
>
> With the dearth of PPC connectivity / CPU cycles on the compile farm,
> I'm afraid I can only offer cross tests.
>
> built all-gcc for i686-pc-linux-gnu X ppc-linux-gnu with configure option
> --enable-werror-always and gcc (GCC) 4.6.0 20100630 (experimental);
>
> built all-gcc for i686-pc-linux-gnu X ppc-linux-gnu with configure options
> --enable-werror-always --enable-build-with-cxx and
> g++ (GCC) 4.6.0 20100630 (experimental).
>
> 2010-06-23  Joern Rennecke  <joern.rennecke@embecosm.com>
>
>        PR bootstrap/44637
>        * config/rs6000/rs6000.c (rs6000_xcoff_strip_dollar): Use const char
> *
>        variable for const char * strchr result.
>
> Index: config/rs6000/rs6000.c
> ===================================================================
> --- config/rs6000/rs6000.c      (revision 161213)
> +++ config/rs6000/rs6000.c      (working copy)
> @@ -21252,12 +21252,13 @@ toc_hash_eq (const void *h1, const void
>  const char *
>  rs6000_xcoff_strip_dollar (const char *name)
>  {
> +  const char *cp;
>   char *strip, *p;
>   int len;
>
> -  p = strchr (name, '$');
> +  cp = strchr (name, '$');
>
> -  if (p == 0 || p == name)
> +  if (cp == 0 || cp == name)
>     return name;
>
>   len = strlen (name);

Huh, I wonder why the same diagnostic is not issued for the code below which
reads

  strip = (char *) alloca (len + 1);
  strcpy (strip, name);
  p = strchr (strip, '$');
  while (p)
    {
      *p = '_';
      p = strchr (p + 1, '$');
    }

why not use our "friendly" CONST_CAST macro here?

Richard.
>



More information about the Gcc-patches mailing list