diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-28 22:55:04 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-28 22:55:04 +0000 |
commit | 07f6ff584617b908a02aa42863f579cfd5d0c4c9 (patch) | |
tree | 657a3287fd0f4515ef8192966bb543603c33c6ab /gcc/optabs.c | |
parent | 4e5f4a8c50276b467ad6c28fbd696d8f61b5c8d0 (diff) | |
download | gcc-07f6ff584617b908a02aa42863f579cfd5d0c4c9.tar.gz |
PR 17531
* expr.c (expand_expr_addr_expr_1): Only assemble_external for decls.
Don't check VOIDmode here. Force PLUS operands to common type.
(expand_expr_addr_expr): Do VOIDmode check earlier. Force use of
Pmode if given a non pointer type.
PR 17531
* optabs.c (expand_binop): Force constants to the correct mode.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88257 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index fc3ef00ba43..cc0627b1240 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -834,11 +834,19 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, force expensive constants into a register. */ if (CONSTANT_P (op0) && optimize && rtx_cost (op0, binoptab->code) > COSTS_N_INSNS (1)) - op0 = force_reg (mode, op0); + { + if (GET_MODE (op0) != VOIDmode) + op0 = convert_modes (mode, VOIDmode, op0, unsignedp); + op0 = force_reg (mode, op0); + } if (CONSTANT_P (op1) && optimize && ! shift_op && rtx_cost (op1, binoptab->code) > COSTS_N_INSNS (1)) - op1 = force_reg (mode, op1); + { + if (GET_MODE (op1) != VOIDmode) + op1 = convert_modes (mode, VOIDmode, op1, unsignedp); + op1 = force_reg (mode, op1); + } /* Record where to delete back to if we backtrack. */ last = get_last_insn (); |