summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-data-refs.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2013-08-30 07:49:54 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2013-08-30 07:49:54 +0000
commit6e8dad054f8de5c33f3837c84b4f4be57e83e7da (patch)
tree9baa757b816ea5da995a2df264ff63a6edb8bb25 /gcc/tree-vect-data-refs.c
parent062ef2c8f95540fd997e57f6d8945d307ededc81 (diff)
downloadgcc-6e8dad054f8de5c33f3837c84b4f4be57e83e7da.tar.gz
re PR tree-optimization/58228 (wrong code (with vectorization?) at -O3 on x86_64-linux-gnu)
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. From-SVN: r202097
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);
}