aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-pr114566.c34
-rw-r--r--gcc/tree-vect-loop.c8
2 files changed, 35 insertions, 7 deletions
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-pr114566.c b/gcc/testsuite/gcc.target/i386/avx512f-pr114566.c
new file mode 100644
index 00000000000..abfab1bfcd5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512f-pr114566.c
@@ -0,0 +1,34 @@
+/* PR tree-optimization/114566 */
+/* { dg-do run } */
+/* { dg-options "-O3 -mavx512f" } */
+/* { dg-additional-options "-fstack-protector-strong" { target fstack_protector } } */
+/* { dg-require-effective-target avx512f } */
+
+#define AVX512F
+#include "avx512f-helper.h"
+
+__attribute__((noipa)) int
+foo (float x, float y)
+{
+ float a[8][56];
+ __builtin_memset (a, 0, sizeof (a));
+
+ for (int j = 0; j < 8; j++)
+ for (int k = 0; k < 56; k++)
+ {
+ float b = k * y;
+ if (b < 0.)
+ b = 0.;
+ if (b > 0.)
+ b = 0.;
+ a[j][k] += b;
+ }
+
+ return __builtin_log (x);
+}
+
+void
+TEST (void)
+{
+ foo (86.25f, 0.625f);
+}
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 76580c1e3dd..01d1361c9f0 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -9296,9 +9296,7 @@ find_in_mapping (tree t, void *context)
corresponding dr_vec_info need to be reconnected to the EPILOGUE's
stmt_vec_infos, their statements need to point to their corresponding copy,
if they are gather loads or scatter stores then their reference needs to be
- updated to point to its corresponding copy and finally we set
- 'base_misaligned' to false as we have already peeled for alignment in the
- prologue of the main loop. */
+ updated to point to its corresponding copy. */
static void
update_epilogue_loop_vinfo (class loop *epilogue, tree advance)
@@ -9439,10 +9437,6 @@ update_epilogue_loop_vinfo (class loop *epilogue, tree advance)
}
DR_STMT (dr) = STMT_VINFO_STMT (stmt_vinfo);
stmt_vinfo->dr_aux.stmt = stmt_vinfo;
- /* The vector size of the epilogue is smaller than that of the main loop
- so the alignment is either the same or lower. This means the dr will
- thus by definition be aligned. */
- STMT_VINFO_DR_INFO (stmt_vinfo)->base_misaligned = false;
}
epilogue_vinfo->shared->datarefs_copy.release ();