https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117229

--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #12)
> >but why for '-march=gfx908' only, but not '-march=gfx1100' (or nvptx, for 
> >example)
> 
> Is newlib compiled for each of these multilib? If so it could be
> ./newlib/libc/string/strstr.c (strstr) in newlib is miscompiled with the
> -march=gfx908 option. so you need to debug that.
> 
> One option is disable the "Use the Quick-Search algorithm for needle lengths
> less than 255" optimization part of strstr.c first and see if that is
> miscompiled. since this case the needle is short (less than 30 characters).

Another option is enable the " Small and efficient strstr implementation. " and
see if that is miscompiled.

The "Quick-Search algorithm" I don't see how it could be vectorized unless you
have scatter stores (and I thought GCC didn't autovectorized that yet) and that
is just the init loop:
```
      for (i = 0; i < ne_len; i++)
        shift[ne[i] % sizeof (shift)] = ne_len - i;
```

Reply via email to