]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386: Uglify some local identifiers in *intrin.h [PR107748]
authorJakub Jelinek <jakub@redhat.com>
Mon, 21 Nov 2022 09:28:27 +0000 (10:28 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 3 May 2023 11:35:16 +0000 (13:35 +0200)
While reporting PR107748 (where is a problem with non-uglified names,
but I've left it out because it needs fixing anyway), I've noticed
various spots where identifiers in *intrin.h headers weren't uglified.
The following patch fixed those that are related to unions (I've grepped
for [a-zA-Z]\.[a-zA-Z] spots).
The reason we need those to be uglified is the same as why the arguments
of the inlines are __ prefixed and most of automatic vars in the inlines
- say a, v or u aren't part of implementation namespace and so users could
 #define u whatever->something
 #include <x86intrin.h>
and it should still work, as long as u is not e.g. one of the names
of the functions/macros the header provides (_mm* etc.).

2022-11-21  Jakub Jelinek  <jakub@redhat.com>

PR target/107748
* config/i386/smmintrin.h (_mm_extract_ps): Uglify names of local
variables and union members.

(cherry picked from commit ec8ec09f9414be871e322fecf4ebf53e3687bd22)

gcc/config/i386/smmintrin.h

index 6437752868296d2d1735582f04aa28be6eb5056d..ddf068c85055c96e3cb7081666c41a427c33f9ee 100644 (file)
@@ -365,17 +365,18 @@ _mm_insert_ps (__m128 __D, __m128 __S, const int __N)
 extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
 _mm_extract_ps (__m128 __X, const int __N)
 {
-  union { int i; float f; } __tmp;
-  __tmp.f = __builtin_ia32_vec_ext_v4sf ((__v4sf)__X, __N);
-  return __tmp.i;
+  union { int __i; float __f; } __tmp;
+  __tmp.__f = __builtin_ia32_vec_ext_v4sf ((__v4sf)__X, __N);
+  return __tmp.__i;
 }
 #else
 #define _mm_extract_ps(X, N)                                           \
   (__extension__                                                       \
    ({                                                                  \
-     union { int i; float f; } __tmp;                                  \
-     __tmp.f = __builtin_ia32_vec_ext_v4sf ((__v4sf)(__m128)(X), (int)(N)); \
-     __tmp.i;                                                          \
+     union { int __i; float __f; } __tmp;                              \
+     __tmp.__f = __builtin_ia32_vec_ext_v4sf ((__v4sf)(__m128)(X),     \
+                                             (int)(N));                \
+     __tmp.__i;                                                                \
    }))
 #endif