summaryrefslogtreecommitdiffstats
path: root/gcc/recog.c
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2001-04-12 05:25:55 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2001-04-12 05:25:55 +0000
commit37b36c90b1b5f06e3f76ce5c1f5e95f1748a5d71 (patch)
tree109638b26bba38caeb1b23b0c8ca91771240a1a5 /gcc/recog.c
parent213b27c99d10147707909332de18c0546a423196 (diff)
downloadppe42-gcc-37b36c90b1b5f06e3f76ce5c1f5e95f1748a5d71.tar.gz
ppe42-gcc-37b36c90b1b5f06e3f76ce5c1f5e95f1748a5d71.zip
* recog.c (general_operand, immediate_operand,
nonmemory_operand): Require CONST_INTs to be sign-extended values for their modes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41286 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/recog.c')
-rw-r--r--gcc/recog.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/recog.c b/gcc/recog.c
index bbecd5b719e..1c9fdf90e6e 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -1114,6 +1114,10 @@ general_operand (op, mode)
&& GET_MODE_CLASS (mode) != MODE_PARTIAL_INT)
return 0;
+ if (GET_CODE (op) == CONST_INT
+ && trunc_int_for_mode (INTVAL (op), mode) != INTVAL (op))
+ return 0;
+
if (CONSTANT_P (op))
return ((GET_MODE (op) == VOIDmode || GET_MODE (op) == mode
|| mode == VOIDmode)
@@ -1290,6 +1294,10 @@ immediate_operand (op, mode)
&& GET_MODE_CLASS (mode) != MODE_PARTIAL_INT)
return 0;
+ if (GET_CODE (op) == CONST_INT
+ && trunc_int_for_mode (INTVAL (op), mode) != INTVAL (op))
+ return 0;
+
/* Accept CONSTANT_P_RTX, since it will be gone by CSE1 and
result in 0/1. It seems a safe assumption that this is
in range for everyone. */
@@ -1361,6 +1369,10 @@ nonmemory_operand (op, mode)
&& GET_MODE_CLASS (mode) != MODE_PARTIAL_INT)
return 0;
+ if (GET_CODE (op) == CONST_INT
+ && trunc_int_for_mode (INTVAL (op), mode) != INTVAL (op))
+ return 0;
+
return ((GET_MODE (op) == VOIDmode || GET_MODE (op) == mode
|| mode == VOIDmode)
#ifdef LEGITIMATE_PIC_OPERAND_P
OpenPOWER on IntegriCloud