From 4d367579cc4e8a6e04f5169d130873225b08bf1b Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Sun, 15 May 1994 01:24:39 +0000 Subject: (find_cross_jump): Two CALL_INSNs only compare equal if their CALL_INSN_FUNCTION_USAGEs are the same as well. From-SVN: r7300 --- gcc/jump.c | 48 +++++++++++++----------------------------------- 1 file changed, 13 insertions(+), 35 deletions(-) (limited to 'gcc/jump.c') diff --git a/gcc/jump.c b/gcc/jump.c index 7277bd8..c2a1837 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -2275,44 +2275,22 @@ find_cross_jump (e1, e2, minimum, f1, f2) p1 = PATTERN (i1); p2 = PATTERN (i2); -#ifdef STACK_REGS - if (GET_CODE (i1) == CALL_INSN) - { - /* Compare register usage information for the stack registers. - Two CALL_INSNs are only equal if they receive the same - (amount of) stack registers as parameters. If we don't - 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))); + /* If this is a CALL_INSN, compare register usage information. + If we don't check this on stack register machines, the two + CALL_INSNs might be merged leaving reg-stack.c with mismatching + numbers of stack registers in the same basic block. + If we don't check this on machines with delay slots, a delay slot may + be filled that clobbers a parameter expected by the subroutine. - for (link = CALL_INSN_FUNCTION_USAGE (i2); - link; - 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))); + ??? We take the simple route for now and assume that if they're + equal, they were constructed identically. */ - GO_IF_HARD_REG_EQUAL (i1_regset, i2_regset, usedmatch); - - lose = 1; - - usedmatch: - ; - } + if (GET_CODE (i1) == CALL_INSN + && ! rtx_equal_p (CALL_INSN_FUNCTION_USAGE (i1), + CALL_INSN_FUNCTION_USAGE (i2))) + lose = 1; +#ifdef STACK_REGS /* If cross_jump_death_matters is not 0, the insn's mode indicates whether or not the insn contains any stack-like regs. */ -- cgit v1.1