On Sun, Sep 25, 2016 at 02:48:19PM +0100, Sergei Trofimovich wrote:
> From: Sergei Trofimovich <[email protected]>
>
> Today I traced AVX2 optimisation bug in gcc and
> distilled it down to '__builtin_ia32_gatheraltdiv4si256'
> generated by gcc.
>
> When I attempted to use this builtin directly
> in a simple program gcc refused to recognise
> it as known:
>
> #include <immintrin.h>
>
> void a (void) {
> __builtin_ia32_gatheraltdiv4si256 (1);
> }
>
> $ LANG=C gcc -c -march=core-avx2 a.c
> a.c: In function 'a':
> a.c:4:5: warning: implicit declaration of function
> '__builtin_ia32_gatheraltdiv4si256' [-Wimplicit-function-declaration]
>
> The cause is trailing whitespace in builtin definition:
>
> def_builtin (OPTION_MASK_ISA_AVX2, "__builtin_ia32_gatheraltdiv4si256 ",
>
> Fixed by dropping trailing whitespace.
No, that isn't a fix, adding such characters has been an older way to
express internal only builtins that aren't ever meant to be available to
users (these days we'd use internal-fn.* stuff, except we don't have support
for backends adding their own internal functions).
Jakub