public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: gcc-patches@gcc.gnu.org
Cc: Segher Boessenkool <segher@kernel.crashing.org>
Subject: [PATCH] [6 and trunk] Fix bootstrap with older host compilers
Date: Fri, 15 Apr 2016 18:32:00 -0000	[thread overview]
Message-ID: <b975f7e32aa16e85a47f9b3271b7788a3c774cce.1460744758.git.segher@kernel.crashing.org> (raw)

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

             reply	other threads:[~2016-04-15 18:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15 18:32 Segher Boessenkool [this message]
2016-04-18  8:44 ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b975f7e32aa16e85a47f9b3271b7788a3c774cce.1460744758.git.segher@kernel.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).