On Fri, Aug 19, 2016 at 03:21:03AM -0500, Segher Boessenkool wrote:
> On Fri, Aug 19, 2016 at 08:45:49AM +0200, Jakub Jelinek wrote:
> > On Fri, Aug 19, 2016 at 01:50:52PM +0800, lhmouse wrote:
> > > Given the `_fxsave()` function returning `void`, it is invalid C but 
> > > valid C++:
> > 
> > It is also a GNU C extension.
> 
> And GCC warns with -Wpedantic (but not without).  It does the "correct"
> thing in either case.

That said, unlike the long long extension used pretty much everywhere, in
the intrinsic headers this extension doesn't buy us anything.

So ok for trunk to remove those if testing succeeds?

2016-08-19  Jakub Jelinek  <ja...@redhat.com>

        * config/i386/fxsrintrin.h (_fxsave): Remove return keyword in inlines
        returning void.
        (_fxrstor, _fxsave64, _fxrstor64): Likewise.
        * config/i386/xsaveintrin.h (_xsave, _xrstor, _xsave64, _xrstor64):
        Likewise.
        * config/i386/xsaveoptintrin.h (_xsaveopt, _xsaveopt64): Likewise.
        * config/i386/pkuintrin.h (_wrpkru): Likewise.  Add space after
        function name.
        (_rdpkru_u32): Add space after function name.

--- gcc/config/i386/fxsrintrin.h.jj     2016-01-04 14:55:55.000000000 +0100
+++ gcc/config/i386/fxsrintrin.h        2016-08-19 11:23:16.214265208 +0200
@@ -38,14 +38,14 @@ extern __inline void
 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
 _fxsave (void *__P)
 {
-  return __builtin_ia32_fxsave (__P);
+  __builtin_ia32_fxsave (__P);
 }
 
 extern __inline void
 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
 _fxrstor (void *__P)
 {
-  return __builtin_ia32_fxrstor (__P);
+  __builtin_ia32_fxrstor (__P);
 }
 
 #ifdef __x86_64__
@@ -53,14 +53,14 @@ extern __inline void
 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
 _fxsave64 (void *__P)
 {
-    return __builtin_ia32_fxsave64 (__P);
+  __builtin_ia32_fxsave64 (__P);
 }
 
 extern __inline void
 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
 _fxrstor64 (void *__P)
 {
-    return __builtin_ia32_fxrstor64 (__P);
+  __builtin_ia32_fxrstor64 (__P);
 }
 #endif
 
--- gcc/config/i386/xsaveintrin.h.jj    2016-01-04 14:55:56.000000000 +0100
+++ gcc/config/i386/xsaveintrin.h       2016-08-19 11:23:46.626878520 +0200
@@ -38,14 +38,14 @@ extern __inline void
 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
 _xsave (void *__P, long long __M)
 {
-  return __builtin_ia32_xsave (__P, __M);
+  __builtin_ia32_xsave (__P, __M);
 }
 
 extern __inline void
 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
 _xrstor (void *__P, long long __M)
 {
-  return __builtin_ia32_xrstor (__P, __M);
+  __builtin_ia32_xrstor (__P, __M);
 }
 
 #ifdef __x86_64__
@@ -53,14 +53,14 @@ extern __inline void
 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
 _xsave64 (void *__P, long long __M)
 {
-  return __builtin_ia32_xsave64 (__P, __M);
+  __builtin_ia32_xsave64 (__P, __M);
 }
 
 extern __inline void
 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
 _xrstor64 (void *__P, long long __M)
 {
-  return __builtin_ia32_xrstor64 (__P, __M);
+  __builtin_ia32_xrstor64 (__P, __M);
 }
 #endif
 
--- gcc/config/i386/xsaveoptintrin.h.jj 2016-01-04 14:55:55.000000000 +0100
+++ gcc/config/i386/xsaveoptintrin.h    2016-08-19 11:24:05.664636461 +0200
@@ -38,7 +38,7 @@ extern __inline void
 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
 _xsaveopt (void *__P, long long __M)
 {
-  return __builtin_ia32_xsaveopt (__P, __M);
+  __builtin_ia32_xsaveopt (__P, __M);
 }
 
 #ifdef __x86_64__
@@ -46,7 +46,7 @@ extern __inline void
 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
 _xsaveopt64 (void *__P, long long __M)
 {
-  return __builtin_ia32_xsaveopt64 (__P, __M);
+  __builtin_ia32_xsaveopt64 (__P, __M);
 }
 #endif
 
--- gcc/config/i386/pkuintrin.h.jj      2016-01-04 14:55:56.000000000 +0100
+++ gcc/config/i386/pkuintrin.h 2016-08-19 11:24:24.274399843 +0200
@@ -36,16 +36,16 @@
 
 extern __inline unsigned int
 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_rdpkru_u32(void)
+_rdpkru_u32 (void)
 {
   return __builtin_ia32_rdpkru ();
 }
 
 extern __inline void
 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_wrpkru(unsigned int key)
+_wrpkru (unsigned int key)
 {
-  return __builtin_ia32_wrpkru (key);
+  __builtin_ia32_wrpkru (key);
 }
 
 #ifdef __DISABLE_PKU__


        Jakub

Reply via email to