OSDN Git Service

PR tree-optimization/47290
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-loop-prefetch.c
index 9ad6cd2..59c65d3 100644 (file)
@@ -37,7 +37,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-chrec.h"
 #include "tree-scalar-evolution.h"
 #include "diagnostic-core.h"
-#include "toplev.h"
 #include "params.h"
 #include "langhooks.h"
 #include "tree-inline.h"
@@ -80,7 +79,7 @@ along with GCC; see the file COPYING3.  If not see
        (2) has PREFETCH_MOD 64
        (3) has PREFETCH_MOD 4
        (4) has PREFETCH_MOD 1.  We do not set PREFETCH_BEFORE here, since
-           the cache line accessed by (4) is the same with probability only
+           the cache line accessed by (5) is the same with probability only
           7/32.
        (5) has PREFETCH_MOD 1 as well.
 
@@ -423,9 +422,6 @@ idx_analyze_ref (tree base, tree *index, void *data)
   HOST_WIDE_INT idelta = 0, imult = 1;
   affine_iv iv;
 
-  if (TREE_CODE (base) == MISALIGNED_INDIRECT_REF)
-    return false;
-
   if (!simple_iv (ar_data->loop, loop_containing_stmt (ar_data->stmt),
                  *index, &iv, true))
     return false;
@@ -539,6 +535,10 @@ gather_memory_references_ref (struct loop *loop, struct mem_ref_group **refs,
   if (step == NULL_TREE)
     return false;
 
+  /* Stop if the address of BASE could not be taken.  */
+  if (may_be_nonaddressable_p (base))
+    return false;
+
   /* Limit non-constant step prefetching only to the innermost loops.  */
   if (!cst_and_fits_in_hwi (step) && loop->inner != NULL)
     return false;