summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-data-refs.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-30 07:49:54 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-30 07:49:54 +0000
commitafa60cb465b831392cb5c8a7e85285e86fab2fc3 (patch)
tree9baa757b816ea5da995a2df264ff63a6edb8bb25 /gcc/tree-vect-data-refs.c
parentb2a1bfff0e0eb76fabb98fea1c9157e8a3d88fa6 (diff)
downloadgcc-afa60cb465b831392cb5c8a7e85285e86fab2fc3.tar.gz
2013-08-30 Richard Biener <rguenther@suse.de>
PR tree-optimization/58228 * tree-vect-data-refs.c (vect_analyze_data_ref_access): Do not allow invariant loads in nested loop vectorization. * gcc.dg/torture/pr58228.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202097 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r--gcc/tree-vect-data-refs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 4c12f493916..7ebdcfe53cf 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -2271,10 +2271,17 @@ vect_analyze_data_ref_access (struct data_reference *dr)
return false;
}
- /* Allow invariant loads in loops. */
+ /* Allow invariant loads in not nested loops. */
if (loop_vinfo && integer_zerop (step))
{
GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) = NULL;
+ if (nested_in_vect_loop_p (loop, stmt))
+ {
+ if (dump_enabled_p ())
+ dump_printf_loc (MSG_NOTE, vect_location,
+ "zero step in inner loop of nest");
+ return false;
+ }
return DR_IS_READ (dr);
}