tree-ssa-loop-ivopts.c (get_address_cost): Prevent splitting addressing modes during...
authorZdenek Dvorak <dvorakz@suse.cz>
Sat, 12 Nov 2005 23:27:13 +0000 (00:27 +0100)
committerZdenek Dvorak <rakdver@gcc.gnu.org>
Sat, 12 Nov 2005 23:27:13 +0000 (23:27 +0000)
* tree-ssa-loop-ivopts.c (get_address_cost): Prevent splitting
addressing modes during calculation of costs.

* testsuite/gcc.dg/tree-ssa/loop-2.c: Fix outcome.
* testsuite/gcc.dg/tree-ssa/loop-3.c: Change type of loop control
variable.

From-SVN: r106842

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/loop-2.c
gcc/testsuite/gcc.dg/tree-ssa/loop-3.c
gcc/tree-ssa-loop-ivopts.c

index 30c52141b4f31b0308b0a85e66b900cf764b809d..530fefd83e44cf9c6586b055804d7545debaae08 100644 (file)
@@ -1,3 +1,8 @@
+2005-11-13  Zdenek Dvorak  <dvorakz@suse.cz>
+
+       * tree-ssa-loop-ivopts.c (get_address_cost): Prevent splitting
+       addressing modes during calculation of costs.
+
 2005-11-12  Eric Botcazou  <ebotcazou@adacore.com>
 
        * function.c (assign_stack_local_1): Restrict sanity check
index 19a2420e974ea3b9380d54db973e35b04eee5a8f..388ea7e2f77f26e4dec4fa8482c48ca972b0241a 100644 (file)
@@ -1,3 +1,9 @@
+2005-11-13  Zdenek Dvorak  <dvorakz@suse.cz>
+
+       * gcc.dg/tree-ssa/loop-2.c: Fix outcome.
+       * gcc.dg/tree-ssa/loop-3.c: Change type of loop control
+       variable.
+
 2005-11-12  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        testsuite/24614
index e086499ca2727139e838616539d22a9bb61720c6..589de3630027651d42d22727328c7c93638e0431 100644 (file)
@@ -34,9 +34,10 @@ void xxx(void)
 /* { dg-final { scan-tree-dump-times " \\+ 17" 1 "vars" } } */
 
 /* The induction variable comparison with 99 should be eliminated
-   and replaced by comparison of the variable for 17 * iter with 1700.  */
+   and replaced by comparison of one of the newly created ivs.  */
 
-/* { dg-final { scan-tree-dump-times "1700" 1 "vars" } } */
 /* { dg-final { scan-tree-dump-times "iter" 0 "vars" } } */
+/* { dg-final { scan-tree-dump-times "99" 0 "vars" } } */
+/* { dg-final { scan-tree-dump-times "100" 0 "vars" } } */
 
 /* { dg-final { cleanup-tree-dump "vars" } } */
index 63e582b6f43fcc1092f1c7c299e3fc9d9e4d6dd8..82d1d2d73c5f54cf0cca566d4768a1b1c7ec39ed 100644 (file)
@@ -11,7 +11,7 @@ int foo(int);
 
 void xxx(void)
 {
-  int iter;
+  long iter;
 
   for (iter = 0; iter < 100; iter++)
     arr_base[iter] = foo (iter);
index 1235379aa43a8c0fd237c713d58e803e0d9e502b..4affcf4172835acf803245927f0bebabf8c6ffa6 100644 (file)
@@ -3384,6 +3384,7 @@ get_address_cost (bool symbol_present, bool var_present,
   acost = costs[symbol_present][var_present][offset_p][ratio_p];
   if (!acost)
     {
+      int old_cse_not_expected;
       acost = 0;
       
       addr = gen_raw_REG (Pmode, LAST_VIRTUAL_REGISTER + 1);
@@ -3412,7 +3413,12 @@ get_address_cost (bool symbol_present, bool var_present,
        addr = gen_rtx_fmt_ee (PLUS, Pmode, addr, base);
   
       start_sequence ();
+      /* To avoid splitting addressing modes, pretend that no cse will
+        follow.  */
+      old_cse_not_expected = cse_not_expected;
+      cse_not_expected = true;
       addr = memory_address (Pmode, addr);
+      cse_not_expected = old_cse_not_expected;
       seq = get_insns ();
       end_sequence ();