Commit c033e268 by Alexandre Oliva Committed by Alexandre Oliva

recog.c (general_operand, [...]): Require CONST_INTs to be sign-extended values for their modes.

* recog.c (general_operand, immediate_operand,
nonmemory_operand): Require CONST_INTs to be sign-extended
values for their modes.

From-SVN: r41286
parent 69107307
2001-04-12 Alexandre Oliva <aoliva@redhat.com>
* recog.c (general_operand, immediate_operand,
nonmemory_operand): Require CONST_INTs to be sign-extended
values for their modes.
2001-04-12 Alexandre Oliva <aoliva@redhat.com>
* expmed.c (store_bit_field): Truncate CONST_INTs.
(expand_mult_highpart, expand_divmod): Likewise.
* expr.c (convert_modes, store_field): Likewise.
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment