This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] [6 and trunk] Fix bootstrap with older host compilers
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Segher Boessenkool <segher at kernel dot crashing dot org>
- Date: Fri, 15 Apr 2016 18:31:44 +0000
- Subject: [PATCH] [6 and trunk] Fix bootstrap with older host compilers
- Authentication-results: sourceware.org; auth=none
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.
Is this okay for trunk and gcc-6?
Segher
2016-04-15 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.
---
gcc/hsa-brig.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/hsa-brig.c b/gcc/hsa-brig.c
index a943e37..9c74b9a 100644
--- a/gcc/hsa-brig.c
+++ b/gcc/hsa-brig.c
@@ -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__
--
1.9.3