From: Richard Biener Date: Tue, 5 Mar 2019 14:57:12 +0000 (+0000) Subject: re PR tree-optimization/89594 (ICE: Segmentation fault (in gsi_for_stmt(gimple*))) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=deeec83de4379e253af4f41eaaf8f45d4db17302;p=gcc.git re PR tree-optimization/89594 (ICE: Segmentation fault (in gsi_for_stmt(gimple*))) 2019-03-05 Richard Biener PR tree-optimization/89594 * tree-if-conv.c (pass_if_conversion::execute): Handle case where .LOOP_VECTORIZED_FUNCTION was removed. * gcc.dg/pr89594.c: New testcase. From-SVN: r269389 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 788ce54da7f..4fb2792c70d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-03-05 Richard Biener + + PR tree-optimization/89594 + * tree-if-conv.c (pass_if_conversion::execute): Handle + case where .LOOP_VECTORIZED_FUNCTION was removed. + 2019-03-05 Jakub Jelinek PR bootstrap/89560 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a019b6202be..529aa3cfd04 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-03-05 Richard Biener + + PR tree-optimization/89594 + * gcc.dg/pr89594.c: New testcase. + 2019-03-05 Jakub Jelinek PR tree-optimization/89487 diff --git a/gcc/testsuite/gcc.dg/pr89594.c b/gcc/testsuite/gcc.dg/pr89594.c new file mode 100644 index 00000000000..4039f735af8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr89594.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-O -ftree-loop-if-convert -ftree-loop-vectorize -fno-tree-ch" } */ + +int h3; + +void +in (void) +{ + long int zr; + int ee = 0; + + for (zr = 0; zr < 1; zr = h3) + { + ee = !!h3 ? zr : 0; + + h3 = 0; + while (h3 < 0) + h3 = 0; + } + + h3 = 0; + while (h3 < 1) + h3 = !!ee ? (!!h3 + 1) : 0; +} diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index fe3cc0214b4..ec2db007a61 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -3176,6 +3176,8 @@ pass_if_conversion::execute (function *fun) for (unsigned i = 0; i < preds.length (); ++i) { gimple *g = preds[i]; + if (!gimple_bb (g)) + continue; unsigned ifcvt_loop = tree_to_uhwi (gimple_call_arg (g, 0)); if (!get_loop (fun, ifcvt_loop)) {