diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-05-06 17:44:06 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-05-06 17:44:06 -0400 |
commit | 6e2d1486acf5c27ff368e28af3b781f3eaf7405b (patch) | |
tree | a23475c6a0d4cb8bcbd13671673c0e84cb912c65 /gcc | |
parent | 8f3e7a26bde8797649fff46419ac6c6b71c95f78 (diff) | |
download | gcc-6e2d1486acf5c27ff368e28af3b781f3eaf7405b.zip gcc-6e2d1486acf5c27ff368e28af3b781f3eaf7405b.tar.gz gcc-6e2d1486acf5c27ff368e28af3b781f3eaf7405b.tar.bz2 |
(try_combine): Restrict combining on CALL_INSNs.
(distribute_{notes,links}): Look at CALL_INSN_FUNCTION_USAGE.
From-SVN: r7236
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/combine.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 9f91331..c9a0b3b 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -1218,6 +1218,17 @@ try_combine (i3, i2, i1) || find_reg_note (i3, REG_LIBCALL, NULL_RTX)) return 0; + /* If I1 or I2 is an argument set insn, and I3 is the actual + CALL_INSN using it as argument, never combine the two. + This to prevent the elimination of insns that setup a + parameter register for a CALL_INSN. */ + if (GET_CODE (i3) == CALL_INSN + && (((temp = single_set (i2)) + && find_reg_fusage (i3, USE, SET_DEST (temp))) + || (i1 && (temp = single_set (i1)) + && find_reg_fusage (i3, USE, SET_DEST (temp))))) + return 0; + combine_attempts++; undobuf.num_undo = previous_num_undos = 0; @@ -10423,7 +10434,11 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1) In both cases, we must search to see if we can find a previous use of A and put the death note there. */ - if (reg_referenced_p (XEXP (note, 0), PATTERN (i3))) + if (from_insn + && GET_CODE (from_insn) == CALL_INSN + && find_reg_fusage (from_insn, USE, XEXP (note, 0))) + place = from_insn; + else if (reg_referenced_p (XEXP (note, 0), PATTERN (i3))) place = i3; else if (i2 != 0 && next_nonnote_insn (i2) == i3 && reg_referenced_p (XEXP (note, 0), PATTERN (i2))) @@ -10697,6 +10712,12 @@ distribute_links (links) place = insn; break; } + else if (GET_CODE (insn) == CALL_INSN + && find_reg_fusage (insn, USE, reg)) + { + place = insn; + break; + } /* If we found a place to put the link, place it there unless there is already a link to the same insn as LINK at that point. */ |