aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/cris
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2015-09-26 01:33:05 -0600
committerJeff Law <law@gcc.gnu.org>2015-09-26 01:33:05 -0600
commitc4362b608bdaaa5b7b326bd60116040b38b0dbdd (patch)
treed452c35b0b28390c7992034dd3937b244ecc9f30 /gcc/config/cris
parent01a8b92d5469be16cd5f75c7169cbe4fa6c6a48d (diff)
downloadgcc-c4362b608bdaaa5b7b326bd60116040b38b0dbdd.zip
gcc-c4362b608bdaaa5b7b326bd60116040b38b0dbdd.tar.gz
gcc-c4362b608bdaaa5b7b326bd60116040b38b0dbdd.tar.bz2
[PATCH] Fix undefined behaviour in cris port
[PATCH] Fix undefined behaviour in cris port * config/cris/cris.md (asrandb): Fix left shift undefined behaviour. (asrandw): Likewise. From-SVN: r228163
Diffstat (limited to 'gcc/config/cris')
-rw-r--r--gcc/config/cris/cris.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md
index 3c2409b..b90d6b1 100644
--- a/gcc/config/cris/cris.md
+++ b/gcc/config/cris/cris.md
@@ -4634,7 +4634,8 @@
&& INTVAL (operands[1]) > 23
/* Check that the and-operation enables us to use logical-shift. */
&& (INTVAL (operands[2])
- & ((HOST_WIDE_INT) -1 << (32 - INTVAL (operands[1])))) == 0"
+ & ((HOST_WIDE_INT) (HOST_WIDE_INT_M1U
+ << (32 - INTVAL (operands[1]))))) == 0"
[(set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 1)))
(set (match_dup 3) (and:QI (match_dup 3) (match_dup 4)))]
;; FIXME: CC0 is valid except for the M bit.
@@ -4655,7 +4656,8 @@
&& INTVAL (operands[1]) > 15
/* Check that the and-operation enables us to use logical-shift. */
&& (INTVAL (operands[2])
- & ((HOST_WIDE_INT) -1 << (32 - INTVAL (operands[1])))) == 0"
+ & ((HOST_WIDE_INT) (HOST_WIDE_INT_M1U
+ << (32 - INTVAL (operands[1]))))) == 0"
[(set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 1)))
(set (match_dup 3) (and:HI (match_dup 3) (match_dup 4)))]
;; FIXME: CC0 is valid except for the M bit.