* loop.c (combine_givs): Fix computing of benefit once giv is combined.
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 Sep 2001 08:45:21 +0000 (08:45 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 Sep 2001 08:45:21 +0000 (08:45 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45494 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/loop.c

index fddbac3..dbf705c 100644 (file)
@@ -1,3 +1,7 @@
+Sun Sep  9 10:43:17 CEST 2001  Jan Hubicka  <jh@suse.cz>
+
+       * loop.c (combine_givs): Fix computing of benefit once giv is combined.
+
 2001-09-09  Richard Henderson  <rth@redhat.com>
 
        * config/alpha/alpha.c (alpha_next_sequence_number): New.
index 990826a..ef1b7ee 100644 (file)
@@ -6851,6 +6851,13 @@ restart:
 
              g2->new_reg = can_combine[i * giv_count + j];
              g2->same = g1;
+             /* For destination, we now may replace by mem expression instead
+                of register.  This changes the costs considerably, so add the
+                compensation.  */
+             if (g2->giv_type == DEST_ADDR)
+               g2->benefit = (g2->benefit + reg_address_cost
+                              - address_cost (g2->new_reg,
+                              GET_MODE (g2->mem)));
              g1->combined_with++;
              g1->lifetime += g2->lifetime;