diff options
author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-04-12 03:41:36 +0000 |
---|---|---|
committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-04-12 03:41:36 +0000 |
commit | 213b27c99d10147707909332de18c0546a423196 (patch) | |
tree | 943b9fe0140e410d24c23703edfa24a7154c671e /gcc/optabs.c | |
parent | a1f6ba09f2743fe1c3426e1010d07065ccfb3b3f (diff) | |
download | gcc-213b27c99d10147707909332de18c0546a423196.tar.gz |
* expmed.c (store_bit_field): Truncate CONST_INTs.
(expand_mult_highpart, expand_divmod): Likewise.
* expr.c (convert_modes, store_field): Likewise.
* integrate.c (expand_inline_function): Use promote_mode() to
determine whether to convert_modes() an argument as signed
or unsigned.
* optabs.c (expand_binop): Get CONST_INT operands
sign-extended for their appropriate modes.
* stmt.c (emit_case_nodes): Convert node values to the
appropriate mode.
(expand_end_case): Convert minval and range to the appropriate
mode.
* unroll.c (loop_iterations): Truncate abs_diff to the mode of
the iteration variable.
* varasm.c (immed_double_const): Don't require words to be
narrower than host wide ints to properly sign-extend
CONST_INTs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41285 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index 0be8d6a6bce..4f30779ec43 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -723,17 +723,25 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) } /* In case the insn wants input operands in modes different from - the result, convert the operands. */ + the result, convert the operands. It would seem that we + don't need to convert CONST_INTs, but we do, so that they're + a properly sign-extended for their modes. */ - if (GET_MODE (op0) != VOIDmode - && GET_MODE (op0) != mode0 + if (GET_MODE (op0) != mode0 && mode0 != VOIDmode) - xop0 = convert_to_mode (mode0, xop0, unsignedp); + xop0 = convert_modes (mode0, + GET_MODE (op0) != VOIDmode + ? GET_MODE (op0) + : mode0, + xop0, unsignedp); - if (GET_MODE (xop1) != VOIDmode - && GET_MODE (xop1) != mode1 + if (GET_MODE (xop1) != mode1 && mode1 != VOIDmode) - xop1 = convert_to_mode (mode1, xop1, unsignedp); + xop1 = convert_modes (mode1, + GET_MODE (op1) != VOIDmode + ? GET_MODE (op1) + : mode1, + xop1, unsignedp); /* Now, if insn's predicates don't allow our operands, put them into pseudo regs. */ @@ -4295,7 +4303,9 @@ expand_fix (to, from, unsignedp) NULL_RTX, 0, OPTAB_LIB_WIDEN); expand_fix (to, target, 0); target = expand_binop (GET_MODE (to), xor_optab, to, - GEN_INT ((HOST_WIDE_INT) 1 << (bitsize - 1)), + GEN_INT (trunc_int_for_mode + ((HOST_WIDE_INT) 1 << (bitsize - 1), + GET_MODE (to))), to, 1, OPTAB_LIB_WIDEN); if (target != to) |