* [PATCH] Fix PR68951
@ 2015-12-17 12:30 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2015-12-17 12:30 UTC (permalink / raw)
To: gcc-patches
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2015-12-17 Richard Biener <rguenther@suse.de>
PR tree-optimization/68951
* tree-vect-data-refs.c (vect_peeling_hash_get_lowest_cost):
Ignore strided non-group accesses.
* gcc.dg/torture/pr68951.c: New testcase.
Index: gcc/tree-vect-data-refs.c
===================================================================
--- gcc/tree-vect-data-refs.c (revision 231745)
+++ gcc/tree-vect-data-refs.c (working copy)
@@ -1215,6 +1215,12 @@ vect_peeling_hash_get_lowest_cost (_vect
&& GROUP_FIRST_ELEMENT (stmt_info) != stmt)
continue;
+ /* Strided accesses perform only component accesses, alignment is
+ irrelevant for them. */
+ if (STMT_VINFO_STRIDED_P (stmt_info)
+ && !STMT_VINFO_GROUPED_ACCESS (stmt_info))
+ continue;
+
save_misalignment = DR_MISALIGNMENT (dr);
vect_update_misalignment_for_peel (dr, elem->dr, elem->npeel);
vect_get_data_access_cost (dr, &inside_cost, &outside_cost,
Index: gcc/testsuite/gcc.dg/torture/pr68951.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr68951.c (revision 0)
+++ gcc/testsuite/gcc.dg/torture/pr68951.c (working copy)
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-w" } */
+
+static int g_534[1][1];
+int fn1()
+{
+ int i;
+ for (i = 0; i < 4; i++)
+ g_534[i + 2][i] ^= 3;
+ for (;;)
+ ;
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-12-17 12:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-17 12:30 [PATCH] Fix PR68951 Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).