Commit 64de6c0a by David Edelsohn Committed by Jeff Law

optabs.c (expand_binop): Fix nwords sign warnings.

        * optabs.c (expand_binop): Fix nwords sign warnings.
        generate pseudo for add_optab.

Co-Authored-By: Jeff Law <law@redhat.com>

From-SVN: r53976
parent 62526ec3
...@@ -78,6 +78,9 @@ Tue May 28 21:16:18 2002 J"orn Rennecke <joern.rennecke@superh.com> ...@@ -78,6 +78,9 @@ Tue May 28 21:16:18 2002 J"orn Rennecke <joern.rennecke@superh.com>
2002-05-22 David Edelsohn <edelsohn@gnu.org> 2002-05-22 David Edelsohn <edelsohn@gnu.org>
Jeff Law <law@redhat.com> Jeff Law <law@redhat.com>
* optabs.c (expand_binop): Fix nwords sign warnings.
generate pseudo for add_optab.
* sched-deps.c (sched_analyze): Do not clear SCHED_GROUP_P. * sched-deps.c (sched_analyze): Do not clear SCHED_GROUP_P.
* haifa-sched.c (move_insn): Clear SCHED_GROUP_P after it is used. * haifa-sched.c (move_insn): Clear SCHED_GROUP_P after it is used.
......
...@@ -1210,9 +1210,9 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) ...@@ -1210,9 +1210,9 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
{ {
int i; int i;
optab otheroptab = binoptab == add_optab ? sub_optab : add_optab; optab otheroptab = binoptab == add_optab ? sub_optab : add_optab;
unsigned int nwords = GET_MODE_BITSIZE (mode) / BITS_PER_WORD; int nwords = GET_MODE_BITSIZE (mode) / BITS_PER_WORD;
rtx carry_in = NULL_RTX, carry_out = NULL_RTX; rtx carry_in = NULL_RTX, carry_out = NULL_RTX;
rtx xop0, xop1; rtx xop0, xop1, xtarget;
/* We can handle either a 1 or -1 value for the carry. If STORE_FLAG /* We can handle either a 1 or -1 value for the carry. If STORE_FLAG
value is one of those, use it. Otherwise, use 1 since it is the value is one of those, use it. Otherwise, use 1 since it is the
...@@ -1227,19 +1227,20 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) ...@@ -1227,19 +1227,20 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
xop0 = force_reg (mode, op0); xop0 = force_reg (mode, op0);
xop1 = force_reg (mode, op1); xop1 = force_reg (mode, op1);
if (target == 0 || GET_CODE (target) != REG xtarget = gen_reg_rtx (mode);
|| target == xop0 || target == xop1)
target = gen_reg_rtx (mode); if (target == 0 || GET_CODE (target) != REG)
target = xtarget;
/* Indicate for flow that the entire target reg is being set. */ /* Indicate for flow that the entire target reg is being set. */
if (GET_CODE (target) == REG) if (GET_CODE (target) == REG)
emit_insn (gen_rtx_CLOBBER (VOIDmode, target)); emit_insn (gen_rtx_CLOBBER (VOIDmode, xtarget));
/* Do the actual arithmetic. */ /* Do the actual arithmetic. */
for (i = 0; i < nwords; i++) for (i = 0; i < nwords; i++)
{ {
int index = (WORDS_BIG_ENDIAN ? nwords - i - 1 : i); int index = (WORDS_BIG_ENDIAN ? nwords - i - 1 : i);
rtx target_piece = operand_subword (target, index, 1, mode); rtx target_piece = operand_subword (xtarget, index, 1, mode);
rtx op0_piece = operand_subword_force (xop0, index, mode); rtx op0_piece = operand_subword_force (xop0, index, mode);
rtx op1_piece = operand_subword_force (xop1, index, mode); rtx op1_piece = operand_subword_force (xop1, index, mode);
rtx x; rtx x;
...@@ -1299,7 +1300,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) ...@@ -1299,7 +1300,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
{ {
if (mov_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing) if (mov_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
{ {
rtx temp = emit_move_insn (target, target); rtx temp = emit_move_insn (target, xtarget);
set_unique_reg_note (temp, set_unique_reg_note (temp,
REG_EQUAL, REG_EQUAL,
......
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