re PR middle-end/45098 (Missed induction variable optimization)
authorTom de Vries <tom@codesourcery.com>
Thu, 16 Jun 2011 18:00:54 +0000 (18:00 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Thu, 16 Jun 2011 18:00:54 +0000 (18:00 +0000)
2011-06-16  Tom de Vries  <tom@codesourcery.com>

PR target/45098
* gcc.target/arm/ivopts-3.c: Update test.
* gcc.target/arm/ivopts-5.c: Same.

From-SVN: r175106

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/ivopts-3.c
gcc/testsuite/gcc.target/arm/ivopts-5.c

index c54e761..2c2d9ea 100644 (file)
@@ -1,3 +1,9 @@
+2011-06-16  Tom de Vries  <tom@codesourcery.com>
+
+       PR target/45098
+       * gcc.target/arm/ivopts-3.c: Update test.
+       * gcc.target/arm/ivopts-5.c: Same.
+
 2011-06-16  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>
 
        Revert 
index daea947..a2e7f76 100644 (file)
@@ -8,14 +8,8 @@ tr3 (short array[], unsigned int n)
 {
   int sum = 0;
   unsigned int x;
-  x = 0;
-  while (1)
-    {
-      sum += foo2 (&array[x]);
-      if (!(x < n))
-        break;
-      x++;
-    }
+  for (x = 0; x < n; ++x)
+    sum += foo2 (&array[x]);
   return sum;
 }
 
index c8b9f4f..5624872 100644 (file)
@@ -8,14 +8,8 @@ tr1 (int array[], unsigned int n)
 {
   int sum = 0;
   unsigned int x;
-  x = 0;
-  while (1)
-    {
-      sum += foo (&array[x]);
-      if (!(x < n))
-        break;
-      x++;
-    }
+  for (x = 0; x < n; ++x)
+    sum += foo (&array[x]);
   return sum;
 }