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: [PATCH, i386]: Fix PR target/35553, -fkeep-inline-functions and -O errors our in SSE headers


On Thu, 13 Mar 2008 at 06:39:09 -0400, Jakub Jelinek wrote:

> All static inlines in the headers should be changed btw, otherwise you can't
> use the _mm_* inlines in e.g. extern inline functions.

> Try e.g.:
> #include <xmmintrin.h>

> extern inline __attribute__ ((gnu_inline)) __m64 foo (__m64 x)
> {
>   return _mm_shuffle_pi16 (x, 0x1b);
> }
>
> __m64 x;
>
> int
> main (void)
> {
>   foo (x);
>   return 0;
> }
> with -std=gnu99 -O2 and you'll get a warning, with -pedantic-errors even an
> error:
> '_mm_shuffle_pi16' is static but used in inline function 'foo' which is not
> static
>
> Similarly when foo doesn't have gnu_inline attribute.  I think we had a PR
> about this, though don't remember the PR number ATM.

It's PR 34000.

The one complexity with the "extern inline" solution (as mentioned in the
comments on that PR) is that you really do need extern definitions of the
functions (presumably in libgcc), for -fno-inline or in case someone
references an _mm_* function as a pointer-to-function.

-- 
Jonathan Lennox
lennox at cs dot columbia dot edu


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