On February 10, 2019 12:16:12 AM GMT+01:00, Jakub Jelinek <ja...@redhat.com> 
wrote:
>Hi!
>
>WHen tree_if_conversion is called from within the vectorizer (for
>masked
>epilogues), preds is NULL, so we shouldn't be pushing anything there,
>the caller doesn't care anyway.

Oops. 

>Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

OK. 

Richard. 

>2019-02-09  Jakub Jelinek  <ja...@redhat.com>
>
>       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.
>
>--- gcc/tree-if-conv.c.jj      2019-02-08 20:00:40.774827920 +0100
>+++ gcc/tree-if-conv.c 2019-02-09 17:35:36.995782510 +0100
>@@ -2760,7 +2760,8 @@ version_loop_for_if_conversion (struct l
>   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;
>--- gcc/testsuite/gcc.dg/vect/pr89268.c.jj     2019-02-09
>17:53:15.099481437 +0100
>+++ gcc/testsuite/gcc.dg/vect/pr89268.c        2019-02-09 17:53:50.900896069
>+0100
>@@ -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"
>
>       Jakub

Reply via email to