diff options
author | Richard Earnshaw <rearnsha@arm.com> | 2002-09-21 17:08:16 +0000 |
---|---|---|
committer | Richard Earnshaw <rearnsha@gcc.gnu.org> | 2002-09-21 17:08:16 +0000 |
commit | 5b437e0fe5a7eaf9b75673a0a84dc238b7646576 (patch) | |
tree | 891cf134c164afc9be9b97068a7f86309bac2b16 /gcc | |
parent | 51270f0a1bb6cc345b410eac51961a15f9c3cc58 (diff) | |
download | gcc-5b437e0fe5a7eaf9b75673a0a84dc238b7646576.zip gcc-5b437e0fe5a7eaf9b75673a0a84dc238b7646576.tar.gz gcc-5b437e0fe5a7eaf9b75673a0a84dc238b7646576.tar.bz2 |
cse.c (fold_rtx): Calculate the old cost before we fold each operand.
* cse.c (fold_rtx): Calculate the old cost before we fold each
operand.
From-SVN: r57394
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cse.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 18404ff..6b28a90 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-09-21 Richard Earnshaw <rearnsha@arm.com> + + * cse.c (fold_rtx): Calculate the old cost before we fold each + operand. + 2002-09-21 Richard Henderson <rth@redhat.com> * c-common.c (cpp_define_data_format): Remove __GCC_LITTLE_ENDIAN__, @@ -3732,6 +3732,7 @@ fold_rtx (x, insn) rtx cheap_arg, expensive_arg; rtx replacements[2]; int j; + int old_cost = COST_IN (XEXP (x, i), code); /* Most arguments are cheap, so handle them specially. */ switch (GET_CODE (arg)) @@ -3822,7 +3823,6 @@ fold_rtx (x, insn) for (j = 0; j < 2 && replacements[j]; j++) { - int old_cost = COST_IN (XEXP (x, i), code); int new_cost = COST_IN (replacements[j], code); /* Stop if what existed before was cheaper. Prefer constants |