combine.c (try_combine): Apply substitutions in CALL_INSN_FUNCTION_USAGE too.

* combine.c (try_combine): Apply substitutions in
CALL_INSN_FUNCTION_USAGE too.

From-SVN: r49670
This commit is contained in:
Alexandre Oliva 2002-02-11 06:07:03 +00:00 committed by Alexandre Oliva
parent 5c665b884d
commit cddd8b72ad
2 changed files with 25 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2002-02-11 Alexandre Oliva <aoliva@redhat.com>
* combine.c (try_combine): Apply substitutions in
CALL_INSN_FUNCTION_USAGE too.
2002-02-11 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/rs6000.c (altivec_init_builtins): Handle

View File

@ -1478,6 +1478,7 @@ try_combine (i3, i2, i1, new_direct_jump_p)
{
/* New patterns for I3 and I2, respectively. */
rtx newpat, newi2pat = 0;
int substed_i2 = 0, substed_i1 = 0;
/* Indicates need to preserve SET in I1 or I2 in I3 if it is not dead. */
int added_sets_1, added_sets_2;
/* Total number of SETs to put into I3. */
@ -1939,6 +1940,7 @@ try_combine (i3, i2, i1, new_direct_jump_p)
subst_low_cuid = INSN_CUID (i2);
newpat = subst (PATTERN (i3), i2dest, i2src, 0,
! i1_feeds_i3 && i1dest_in_i1src);
substed_i2 = 1;
/* Record whether i2's body now appears within i3's body. */
i2_is_used = n_occurrences;
@ -1963,6 +1965,7 @@ try_combine (i3, i2, i1, new_direct_jump_p)
n_occurrences = 0;
subst_low_cuid = INSN_CUID (i1);
newpat = subst (newpat, i1dest, i1src, 0, 0);
substed_i1 = 1;
}
/* Fail if an autoincrement side-effect has been duplicated. Be careful
@ -2534,6 +2537,23 @@ try_combine (i3, i2, i1, new_direct_jump_p)
INSN_CODE (i3) = insn_code_number;
PATTERN (i3) = newpat;
if (GET_CODE (i3) == CALL_INSN && CALL_INSN_FUNCTION_USAGE (i3))
{
rtx call_usage = CALL_INSN_FUNCTION_USAGE (i3);
reset_used_flags (call_usage);
call_usage = copy_rtx (call_usage);
if (substed_i2)
replace_rtx (call_usage, i2dest, i2src);
if (substed_i1)
replace_rtx (call_usage, i1dest, i1src);
CALL_INSN_FUNCTION_USAGE (i3) = call_usage;
}
if (undobuf.other_insn)
INSN_CODE (undobuf.other_insn) = other_code_number;