summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-15 01:02:55 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-15 01:02:55 +0000
commita9dea2f02d39f73956ec168525770bc828bf299e (patch)
tree34de22ef15bc7b692a6de966bdcff544172790d7 /gcc
parentd9da068534782af5aba771eed232884c59c4f477 (diff)
downloadgcc-a9dea2f02d39f73956ec168525770bc828bf299e.tar.gz
* combine.c (combine_validate_cost): Consider cost of
undobuf.other_insn rather than always allowing the recombination if it is set. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92173 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/combine.c19
2 files changed, 23 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bb38fc88008..a6a46452f3d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2004-12-14 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * combine.c (combine_validate_cost): Consider cost of
+ undobuf.other_insn rather than always allowing the recombination
+ if it is set.
+
2004-12-14 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* pa-host.c (MAP_FAILED): Define if not defined.
diff --git a/gcc/combine.c b/gcc/combine.c
index 181a33e7590..800e65ea100 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -560,10 +560,25 @@ combine_validate_cost (rtx i1, rtx i2, rtx i3, rtx newpat, rtx newi2pat)
new_i2_cost = 0;
}
+ if (undobuf.other_insn)
+ {
+ int old_other_cost, new_other_cost;
+
+ old_other_cost = (INSN_UID (undobuf.other_insn) <= last_insn_cost
+ ? uid_insn_cost[INSN_UID (undobuf.other_insn)] : 0);
+ new_other_cost = insn_rtx_cost (PATTERN (undobuf.other_insn));
+ if (old_other_cost > 0 && new_other_cost > 0)
+ {
+ old_cost += old_other_cost;
+ new_cost += new_other_cost;
+ }
+ else
+ old_cost = 0;
+ }
+
/* Disallow this recombination if both new_cost and old_cost are
greater than zero, and new_cost is greater than old cost. */
- if (!undobuf.other_insn
- && old_cost > 0
+ if (old_cost > 0
&& new_cost > old_cost)
{
if (dump_file)