Commit 4d367579 by Doug Evans

(find_cross_jump): Two CALL_INSNs only compare equal if

their CALL_INSN_FUNCTION_USAGEs are the same as well.

From-SVN: r7300
parent 5384893b
...@@ -2275,44 +2275,22 @@ find_cross_jump (e1, e2, minimum, f1, f2) ...@@ -2275,44 +2275,22 @@ find_cross_jump (e1, e2, minimum, f1, f2)
p1 = PATTERN (i1); p1 = PATTERN (i1);
p2 = PATTERN (i2); p2 = PATTERN (i2);
#ifdef STACK_REGS /* If this is a CALL_INSN, compare register usage information.
if (GET_CODE (i1) == CALL_INSN) If we don't check this on stack register machines, the two
{ CALL_INSNs might be merged leaving reg-stack.c with mismatching
/* Compare register usage information for the stack registers. numbers of stack registers in the same basic block.
Two CALL_INSNs are only equal if they receive the same If we don't check this on machines with delay slots, a delay slot may
(amount of) stack registers as parameters. If we don't be filled that clobbers a parameter expected by the subroutine.
check this the two CALL_INSNs might be merged leaving
reg-stack.c with mismatching numbers of stack registers
in the same basic block. */
register rtx link, op;
HARD_REG_SET i1_regset, i2_regset;
CLEAR_HARD_REG_SET (i1_regset);
CLEAR_HARD_REG_SET (i2_regset);
for (link = CALL_INSN_FUNCTION_USAGE (i1);
link;
link = XEXP (link, 1))
if (GET_CODE (op = XEXP (link, 0)) == USE
&& STACK_REG_P (SET_DEST (op)))
SET_HARD_REG_BIT (i1_regset, REGNO (SET_DEST (op)));
for (link = CALL_INSN_FUNCTION_USAGE (i2); ??? We take the simple route for now and assume that if they're
link; equal, they were constructed identically. */
link = XEXP (link, 1))
if (GET_CODE (op = XEXP (link, 0)) == USE
&& STACK_REG_P (SET_DEST (op)))
SET_HARD_REG_BIT (i2_regset, REGNO (SET_DEST (op)));
GO_IF_HARD_REG_EQUAL (i1_regset, i2_regset, usedmatch); if (GET_CODE (i1) == CALL_INSN
&& ! rtx_equal_p (CALL_INSN_FUNCTION_USAGE (i1),
lose = 1; CALL_INSN_FUNCTION_USAGE (i2)))
lose = 1;
usedmatch:
;
}
#ifdef STACK_REGS
/* If cross_jump_death_matters is not 0, the insn's mode /* If cross_jump_death_matters is not 0, the insn's mode
indicates whether or not the insn contains any stack-like indicates whether or not the insn contains any stack-like
regs. */ regs. */
......
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