]> gcc.gnu.org Git - gcc.git/commitdiff
re PR middle-end/44203 (New prefetch test failures)
authorChristian Borntraeger <borntraeger@de.ibm.com>
Tue, 25 May 2010 11:18:07 +0000 (11:18 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Tue, 25 May 2010 11:18:07 +0000 (11:18 +0000)
2010-05-25  Christian Borntraeger  <borntraeger@de.ibm.com>

PR 44203
* tree-ssa-loop-prefetch.c: Fix logic for step calculation to
match the original (and intended) behaviour before r159557.  This
changeset changed a=a+b*c to a=(a+b)*b which was obviously wrong
in two ways.

From-SVN: r159816

gcc/ChangeLog
gcc/tree-ssa-loop-prefetch.c

index 3ac6da341543921e13a0c315bbcede0d74c27602..8833cca25fc1a2484f3eb8e3e81a17fe9b90d62f 100644 (file)
@@ -1,3 +1,11 @@
+2010-05-25  Christian Borntraeger  <borntraeger@de.ibm.com>
+
+       PR 44203
+       * tree-ssa-loop-prefetch.c: Fix logic for step calculation to
+       match the original (and intended) behaviour before r159557.  This
+       changeset changed a=a+b*c to a=(a+b)*b which was obviously wrong
+       in two ways.
+
 2010-05-25  Richard Guenther  <rguenther@suse.de>
 
        * doc/invoke.texi: Document -Ofast.
index 633dd337c74993683090ae2ba1869d6a0b2534b9..d63ede1bbe987e7a878c46e89363eca7f451a402 100644 (file)
@@ -423,25 +423,24 @@ idx_analyze_ref (tree base, tree *index, void *data)
       ibase = build_int_cst (TREE_TYPE (ibase), 0);
     }
 
-  if (*ar_data->step == NULL_TREE)
-    *ar_data->step = step;
-  else
-    *ar_data->step = fold_build2 (PLUS_EXPR, sizetype,
-                                 fold_convert (sizetype, *ar_data->step),
-                                 fold_convert (sizetype, step));
   if (TREE_CODE (base) == ARRAY_REF)
     {
       stepsize = array_ref_element_size (base);
       if (!cst_and_fits_in_hwi (stepsize))
        return false;
       imult = int_cst_value (stepsize);
-
-      *ar_data->step = fold_build2 (MULT_EXPR, sizetype,
-                                   fold_convert (sizetype, *ar_data->step),
-                                   fold_convert (sizetype, step));
+      step = fold_build2 (MULT_EXPR, sizetype,
+                         fold_convert (sizetype, step),
+                         fold_convert (sizetype, stepsize));
       idelta *= imult;
     }
 
+  if (*ar_data->step == NULL_TREE)
+    *ar_data->step = step;
+  else
+    *ar_data->step = fold_build2 (PLUS_EXPR, sizetype,
+                                 fold_convert (sizetype, *ar_data->step),
+                                 fold_convert (sizetype, step));
   *ar_data->delta += idelta;
   *index = ibase;
 
This page took 0.08151 seconds and 5 git commands to generate.