summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-29 16:28:51 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-29 16:28:51 +0000
commit6f2ca2443c0376df5ed10ce42a8064e26b52dbcc (patch)
treed418d70bfcac5833df52223a815a18ba8aaf03b7
parent457454ad63de7e8c194590d3783b8788f89565ac (diff)
downloadgcc-6f2ca2443c0376df5ed10ce42a8064e26b52dbcc.tar.gz
[PATCH] Fix undefined behaviour in rl78 port
* config/rl78/rl78-expand.md (movqi): Fix undefined left shift behaviour. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228252 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/config/rl78/rl78-expand.md2
2 files changed, 4 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1b9985af4da..79dc89fafa8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
2015-09-29 Jeff Law <law@redhat.com>
+ * config/rl78/rl78-expand.md (movqi): Fix undefined left shift
+ behaviour.
+
* config/msp430/msp430.c (msp430_legitimate_constant): Fix undefined
left shift behaviour.
* config/msp430/constraints.md ('L' constraint): Similarly.
diff --git a/gcc/config/rl78/rl78-expand.md b/gcc/config/rl78/rl78-expand.md
index 0335a4d2a68..67e6620bdf6 100644
--- a/gcc/config/rl78/rl78-expand.md
+++ b/gcc/config/rl78/rl78-expand.md
@@ -48,7 +48,7 @@
&& ! REG_P (operands[0]))
operands[1] = copy_to_mode_reg (QImode, operands[1]);
- if (CONST_INT_P (operands[1]) && ! IN_RANGE (INTVAL (operands[1]), (-1 << 8) + 1, (1 << 8) - 1))
+ if (CONST_INT_P (operands[1]) && ! IN_RANGE (INTVAL (operands[1]), (HOST_WIDE_INT_M1U << 8) + 1, (1 << 8) - 1))
FAIL;
}
)