From: Tom de Vries Date: Sat, 7 May 2016 06:47:07 +0000 (+0000) Subject: Handle NULL def in build_cross_bb_scalars_def X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5ec4a8cd76196b82dfa1b6e16b6646e6342c969f;p=gcc.git Handle NULL def in build_cross_bb_scalars_def 2016-05-07 Tom de Vries PR tree-optimization/70956 * graphite-scop-detection.c (build_cross_bb_scalars_def): Handle NULL def. * gcc.dg/graphite/pr70956.c: New test. From-SVN: r235994 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ce10e79d4e5..5f4d7fd3f2c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-05-07 Tom de Vries + + PR tree-optimization/70956 + * graphite-scop-detection.c (build_cross_bb_scalars_def): Handle NULL + def. + 2016-05-07 Oleg Endo * config/sh/sh-protos.h (sh_cbranch_distance): Declare new function. diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index 7615842b332..dd50a1e4ec0 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -1722,8 +1722,7 @@ static void build_cross_bb_scalars_def (scop_p scop, tree def, basic_block def_bb, vec *writes) { - gcc_assert (def); - if (!is_gimple_reg (def)) + if (!def || !is_gimple_reg (def)) return; /* Do not gather scalar variables that can be analyzed by SCEV as they can be diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 31a65a410e3..585839c0c75 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-05-07 Tom de Vries + + PR tree-optimization/70956 + * gcc.dg/graphite/pr70956.c: New test. + 2016-05-06 Jakub Jelinek PR middle-end/70941 diff --git a/gcc/testsuite/gcc.dg/graphite/pr70956.c b/gcc/testsuite/gcc.dg/graphite/pr70956.c new file mode 100644 index 00000000000..31fc25f4638 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr70956.c @@ -0,0 +1,4 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fgraphite-identity" } */ + +#include "../tree-ssa/vrp66.c"