]> git.ipfire.org Git - thirdparty/gcc.git/commit
Rename __{float,double}_u to __x86_{float,double}_u to avoid pulluting the namespace.
authorliuhongt <hongtao.liu@intel.com>
Mon, 8 Jul 2024 02:35:35 +0000 (10:35 +0800)
committerliuhongt <hongtao.liu@intel.com>
Tue, 9 Jul 2024 00:49:29 +0000 (08:49 +0800)
commit23ab7f632f4f5bae67fb53cf7b18fea7ba7242c4
treed870a7b2f24ee824086dde5ed671c9c4e40b5c72
parentecde8d50bea3573194f21277666f83463cbbe9c9
Rename __{float,double}_u to __x86_{float,double}_u to avoid pulluting the namespace.

I have a build failure on NetBSD as the namespace pollution avoidance causes
a direct hit with the system /usr/include/math.h
=======================================================================

In file included from /usr/src/local/gcc/obj/gcc/include/emmintrin.h:31,
                 from /usr/src/local/gcc/obj/x86_64-unknown-netbsd10.99/libstdc++-v3/include/ext/random:45,
                 from /usr/src/local/gcc/libstdc++-v3/include/precompiled/extc++.h:65:
/usr/src/local/gcc/obj/gcc/include/xmmintrin.h:75:15: error: conflicting declaration 'typedef float __float_u'
   75 | typedef float __float_u __attribute__ ((__may_alias__, __aligned__ (1)));
      |               ^~~~~~~~~
In file included from /usr/src/local/gcc/obj/x86_64-unknown-netbsd10.99/libstdc++-v3/include/cmath:47,
                 from /usr/src/local/gcc/obj/x86_64-unknown-netbsd10.99/libstdc++-v3/include/x86_64-unknown-netbsd10.99/bits/stdc++.h:114,
                 from /usr/src/local/gcc/libstdc++-v3/include/precompiled/extc++.h:32:
/usr/src/local/gcc/obj/gcc/include-fixed/math.h:49:7: note: previous declaration as 'union __float_u'
   49 | union __float_u {

gcc/ChangeLog:

PR target/115796
* config/i386/emmintrin.h (__float_u): Rename to ..
(__x86_float_u): .. this.
(_mm_load_sd): Ditto.
(_mm_store_sd): Ditto.
(_mm_loadh_pd): Ditto.
(_mm_loadl_pd): Ditto.
* config/i386/xmmintrin.h (__double_u): Rename to ..
(__x86_double_u): .. this.
(_mm_load_ss): Ditto.
(_mm_store_ss): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr115796.c: New test.
gcc/config/i386/emmintrin.h
gcc/config/i386/xmmintrin.h
gcc/testsuite/gcc.target/i386/pr115796.c [new file with mode: 0644]