From 1578e91079162f7ff008520487623968fc0db687 Mon Sep 17 00:00:00 2001
From: Michael Matz <matz@suse.de>
Date: Tue, 20 Oct 2009 16:07:21 +0000
Subject: [PATCH] * loop-invariant.c (create_new_invariant): Use different
 magic number.

From-SVN: r153022
---
 gcc/ChangeLog        |  4 ++++
 gcc/loop-invariant.c | 11 ++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2a3bda14241a..3dfa1bbbc07d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2009-10-20  Michael Matz  <matz@suse.de>
+
+	* loop-invariant.c (create_new_invariant): Use different magic number.
+
 2009-10-20  Richard Earnshaw  <rearnsha@arm.com>
 
 	PR target/39247
diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c
index 8cbfdb30a922..901ce51ac89c 100644
--- a/gcc/loop-invariant.c
+++ b/gcc/loop-invariant.c
@@ -705,8 +705,17 @@ create_new_invariant (struct def *def, rtx insn, bitmap depends_on,
   if (def)
     {
       inv->cost = rtx_cost (set, SET, speed);
+      /* ??? Try to determine cheapness of address computation.  Unfortunately
+         the address cost is only a relative measure, we can't really compare
+	 it with any absolute number, but only with other address costs.
+	 But here we don't have any other addresses, so compare with a magic
+	 number anyway.  It has to be large enough to not regress PR33928
+	 (by avoiding to move reg+8,reg+16,reg+24 invariants), but small
+	 enough to not regress 410.bwaves either (by still moving reg+reg
+	 invariants).
+	 See http://gcc.gnu.org/ml/gcc-patches/2009-10/msg01210.html .  */
       inv->cheap_address = address_cost (SET_SRC (set), word_mode,
-					 speed) < COSTS_N_INSNS (1);
+					 speed) < 3;
     }
   else
     {
-- 
GitLab