public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix undefined behaviour in SH port,
@ 2015-09-26 10:35 Jeff Law
  0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2015-09-26 10:35 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 162 bytes --]


And now the SH port in the obvious way.  Verified by building all the sh 
configurations in config-list.mk with a trunk compiler.

Installed on the trunk,

Jeff

[-- Attachment #2: P --]
[-- Type: text/plain, Size: 1221 bytes --]

commit ac55233b083fc30445141c530fcf472786f935e7
Author: Jeff Law <law@tor.usersys.redhat.com>
Date:   Sat Sep 26 03:24:07 2015 -0400

        [PATCH] Fix undefined behaviour in SH port
    	* config/sh/sh.h (CONST_OK_FOR_J16): Fix left shift undefined
    	behaviour

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6887b14..28c6bf7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
 2015-09-26  Jeff Law  <law@redhat.com>
 
+	* config/sh/sh.h (CONST_OK_FOR_J16): Fix left shift undefined
+	behaviour
+
 	* config/mips/mips.c (mips_compute_frame_info): Fix left shift
 	undefined behaviour.
 
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 7aa489d..b18cc1f 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -1176,7 +1176,7 @@ extern enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER];
 
 #define CONST_OK_FOR_J16(VALUE) \
   ((HOST_BITS_PER_WIDE_INT >= 64 && (VALUE) == (HOST_WIDE_INT) 0xffffffff) \
-   || (HOST_BITS_PER_WIDE_INT >= 64 && (VALUE) == (HOST_WIDE_INT) -1 << 32))
+   || (HOST_BITS_PER_WIDE_INT >= 64 && (VALUE) == (HOST_WIDE_INT) (HOST_WIDE_INT_M1U << 32)))
 
 #define CONST_OK_FOR_K08(VALUE) (((HOST_WIDE_INT)(VALUE))>= 0 \
 				 && ((HOST_WIDE_INT)(VALUE)) <= 255)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-09-26  7:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-26 10:35 [PATCH] Fix undefined behaviour in SH port, Jeff Law

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).