]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
hsa: Fix bootstrap with older host compilers
authorSegher Boessenkool <segher@kernel.crashing.org>
Mon, 18 Apr 2016 08:57:01 +0000 (10:57 +0200)
committerSegher Boessenkool <segher@gcc.gnu.org>
Mon, 18 Apr 2016 08:57:01 +0000 (10:57 +0200)
We didn't have __builtin_swap16 on all targets before GCC 4.8; hsa-brig
tries to use it if the host GCC is 4.6 or up though, breaking bootstrap.
This trivial patch fixes it.

Noticed on gcc22.

* has-brig.c (lendian16): Don't try to use __builtin_bswap16
unless compiling with at least GCC-4.8.

From-SVN: r235096

gcc/ChangeLog
gcc/hsa-brig.c

index 40986fb83eb6a3000e51a0e87a9100519ef2407f..ff99971783e1dbbe72c8a6ccc97abc2efc15a33b 100644 (file)
@@ -1,3 +1,8 @@
+2016-04-18  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       * has-brig.c (lendian16): Don't try to use __builtin_bswap16
+       unless compiling with at least GCC-4.8.
+
 2016-04-17  Jan Hubicka  <jh@suse.cz>
 
        PR bootstrap/70706
index a943e379f554f44079657d61026b285aec280be3..9c74b9aa0713d9ffd7dfb678c6ec2adff9fdd36f 100644 (file)
@@ -51,7 +51,7 @@ along with GCC; see the file COPYING3.  If not see
 static uint16_t
 lendian16 (uint16_t val)
 {
-#if GCC_VERSION >= 4006
+#if GCC_VERSION >= 4008
 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
   return val;
 #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__