diff options
author | Richard Henderson <rth@redhat.com> | 2001-05-21 23:46:20 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2001-05-21 23:46:20 -0700 |
commit | b4fbaca7cb5c6ff5fb5e24e554d510257cb488eb (patch) | |
tree | c78f15a05fa13284aee7f9acc312bbd22411818a /gcc/recog.c | |
parent | 47816305fecfece2a4ae647638622371e4933076 (diff) | |
download | gcc-b4fbaca7cb5c6ff5fb5e24e554d510257cb488eb.zip gcc-b4fbaca7cb5c6ff5fb5e24e554d510257cb488eb.tar.gz gcc-b4fbaca7cb5c6ff5fb5e24e554d510257cb488eb.tar.bz2 |
combine.c (simplify_comparison): Update op1 after constant extension.
* combine.c (simplify_comparison): Update op1 after constant
extension.
* recog.c (const_int_operand): Accept only constants valid
for the given mode.
* genrecog.c: Update comments wrt const_int_operand.
From-SVN: r42427
Diffstat (limited to 'gcc/recog.c')
-rw-r--r-- | gcc/recog.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/recog.c b/gcc/recog.c index 833a122..888a2f5 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -1145,9 +1145,16 @@ immediate_operand (op, mode) int const_int_operand (op, mode) register rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; + enum machine_mode mode; { - return GET_CODE (op) == CONST_INT; + if (GET_CODE (op) != CONST_INT) + return 0; + + if (mode != VOIDmode + && trunc_int_for_mode (INTVAL (op), mode) != INTVAL (op)) + return 0; + + return 1; } /* Returns 1 if OP is an operand that is a constant integer or constant |