diff mbox

Two small i?86 *intrin* warning fixes

Message ID 20140130175210.GD892@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Jan. 30, 2014, 5:52 p.m. UTC
Hi!

While looking at some other PR, I've stripped line notes and got
pr59947.ii.bak:26330:74: error: ISO C++ forbids declaration of ‘_mm512_mask_cvtusepi64_storeu_epi32’ with no type [-fpermissive]
 _mm512_mask_cvtusepi64_storeu_epi32 (void* __P, __mmask8 __M, __m512i __A)
                                                                          ^
pr59947.ii.bak: In function ‘float _cvtsh_ss(short unsigned int)’:
pr59947.ii.bak:30674:65: warning: narrowing conversion of ‘__S’ from ‘short unsigned int’ to ‘short int’ inside { } [-Wnarrowing]
   __v8hi __H = __extension__ (__v8hi){ __S, 0, 0, 0, 0, 0, 0, 0 };
                                                                 ^
warnings that would normally only show up with -Wsystem-headers.
Especially the second one looks like one worth fixing.

Ok for trunk?

2014-01-30  Jakub Jelinek  <jakub@redhat.com>

	* config/i386/f16cintrin.h (_cvtsh_ss): Avoid -Wnarrowing
	warning.
	* config/i386/avx512fintrin.h (_mm512_mask_cvtusepi64_storeu_epi32):
	Add missing return type - void.


	Jakub

Comments

Uros Bizjak Jan. 30, 2014, 6 p.m. UTC | #1
On Thu, Jan 30, 2014 at 6:52 PM, Jakub Jelinek <jakub@redhat.com> wrote:

> While looking at some other PR, I've stripped line notes and got
> pr59947.ii.bak:26330:74: error: ISO C++ forbids declaration of '_mm512_mask_cvtusepi64_storeu_epi32' with no type [-fpermissive]
>  _mm512_mask_cvtusepi64_storeu_epi32 (void* __P, __mmask8 __M, __m512i __A)
>                                                                           ^
> pr59947.ii.bak: In function 'float _cvtsh_ss(short unsigned int)':
> pr59947.ii.bak:30674:65: warning: narrowing conversion of '__S' from 'short unsigned int' to 'short int' inside { } [-Wnarrowing]
>    __v8hi __H = __extension__ (__v8hi){ __S, 0, 0, 0, 0, 0, 0, 0 };
>                                                                  ^
> warnings that would normally only show up with -Wsystem-headers.
> Especially the second one looks like one worth fixing.
>
> Ok for trunk?
>
> 2014-01-30  Jakub Jelinek  <jakub@redhat.com>
>
>         * config/i386/f16cintrin.h (_cvtsh_ss): Avoid -Wnarrowing
>         warning.
>         * config/i386/avx512fintrin.h (_mm512_mask_cvtusepi64_storeu_epi32):
>         Add missing return type - void.

OK.

Should _cvtsh_ss fix be backported to other release branches?

Thanks,
Uros.
diff mbox

Patch

--- gcc/config/i386/f16cintrin.h.jj	2014-01-03 11:41:06.000000000 +0100
+++ gcc/config/i386/f16cintrin.h	2014-01-30 18:47:28.780037184 +0100
@@ -37,7 +37,7 @@ 
 extern __inline float __attribute__((__gnu_inline__, __always_inline__, __artificial__))
 _cvtsh_ss (unsigned short __S)
 {
-  __v8hi __H = __extension__ (__v8hi){ __S, 0, 0, 0, 0, 0, 0, 0 };
+  __v8hi __H = __extension__ (__v8hi){ (short) __S, 0, 0, 0, 0, 0, 0, 0 };
   __v4sf __A = __builtin_ia32_vcvtph2ps (__H);
   return __builtin_ia32_vec_ext_v4sf (__A, 0);
 }
--- gcc/config/i386/avx512fintrin.h.jj	2014-01-28 14:03:49.000000000 +0100
+++ gcc/config/i386/avx512fintrin.h	2014-01-30 18:45:41.867595415 +0100
@@ -4840,7 +4840,7 @@  _mm512_cvtusepi64_epi32 (__m512i __A)
 						    (__mmask8) -1);
 }
 
-extern __inline
+extern __inline void
 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
 _mm512_mask_cvtusepi64_storeu_epi32 (void* __P, __mmask8 __M, __m512i __A)
 {