re PR tree-optimization/89268 (r268689 caused FAIL: gcc.dg/vect/pr79887.c)
authorJakub Jelinek <jakub@redhat.com>
Sun, 10 Feb 2019 11:06:58 +0000 (12:06 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sun, 10 Feb 2019 11:06:58 +0000 (12:06 +0100)
PR tree-optimization/89268
* tree-if-conv.c (version_loop_for_if_conversion): Push to preds only
if preds is non-NULL.

* gcc.dg/vect/pr89268.c: New test.

From-SVN: r268743

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr89268.c [new file with mode: 0644]
gcc/tree-if-conv.c

index 1ddc32a24f524039d1615eb5a504ad56baf1a7fe..b324f15ee933cdb0b51fdc1aa096884da07204c7 100644 (file)
@@ -1,3 +1,9 @@
+2019-02-10  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/89268
+       * tree-if-conv.c (version_loop_for_if_conversion): Push to preds only
+       if preds is non-NULL.
+
 2019-02-09  Jan Hubicka  <hubicka@ucw.cz>
 
        PR lto/89272
index caf31171686dac74a5865fd6ad3b1b4a2ae14f1f..f7b9f0b69b770c9ad56626af297ca73dc6fe59d7 100644 (file)
@@ -1,3 +1,8 @@
+2019-02-10  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/89268
+       * gcc.dg/vect/pr89268.c: New test.
+
 2019-02-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * gnat.dg/lto19.adb: Remove dg-excess-errors.
diff --git a/gcc/testsuite/gcc.dg/vect/pr89268.c b/gcc/testsuite/gcc.dg/vect/pr89268.c
new file mode 100644 (file)
index 0000000..35875ff
--- /dev/null
@@ -0,0 +1,7 @@
+/* PR tree-optimization/89268 */
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_condition } */
+/* { dg-additional-options "-fno-trapping-math --param vect-epilogues-nomask=1" } */
+/* { dg-additional-options "-mavx512ifma -mtune=intel" { target x86_64-*-* i?86-*-* } } */
+
+#include "pr79887.c"
index cfeaec7ae076cb62a96021221afa94c77df8622b..fe3cc0214b4c823a1df0f851b4e55caef5bad0cd 100644 (file)
@@ -2760,7 +2760,8 @@ version_loop_for_if_conversion (struct loop *loop, vec<gimple *> *preds)
   new_loop->force_vectorize = false;
   gsi = gsi_last_bb (cond_bb);
   gimple_call_set_arg (g, 1, build_int_cst (integer_type_node, new_loop->num));
-  preds->safe_push (g);
+  if (preds)
+    preds->safe_push (g);
   gsi_insert_before (&gsi, g, GSI_SAME_STMT);
   update_ssa (TODO_update_ssa);
   return new_loop;