diff options
author | Doug Evans <dje@gnu.org> | 1994-05-15 01:24:39 +0000 |
---|---|---|
committer | Doug Evans <dje@gnu.org> | 1994-05-15 01:24:39 +0000 |
commit | 4d367579cc4e8a6e04f5169d130873225b08bf1b (patch) | |
tree | 48b0608bea6efc62c0cb4e22ad109f767e753150 /gcc/jump.c | |
parent | 5384893b185696a9db093baa9996f535ce929548 (diff) | |
download | gcc-4d367579cc4e8a6e04f5169d130873225b08bf1b.zip gcc-4d367579cc4e8a6e04f5169d130873225b08bf1b.tar.gz gcc-4d367579cc4e8a6e04f5169d130873225b08bf1b.tar.bz2 |
(find_cross_jump): Two CALL_INSNs only compare equal if
their CALL_INSN_FUNCTION_USAGEs are the same as well.
From-SVN: r7300
Diffstat (limited to 'gcc/jump.c')
-rw-r--r-- | gcc/jump.c | 48 |
1 files changed, 13 insertions, 35 deletions
@@ -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. */ |