Handle NULL def in build_cross_bb_scalars_def
2016-05-07 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/70956
* graphite-scop-detection.c (build_cross_bb_scalars_def): Handle NULL
def.
* gcc.dg/graphite/pr70956.c: New test.
---
gcc/graphite-scop-detection.c | 3 +--
gcc/testsuite/gcc.dg/graphite/pr70956.c | 4 ++++
2 files changed, 5 insertions(+), 2 deletions(-)
@@ -1722,8 +1722,7 @@ static void
build_cross_bb_scalars_def (scop_p scop, tree def, basic_block def_bb,
vec<tree> *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
new file mode 100644
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fgraphite-identity" } */
+
+#include "../tree-ssa/vrp66.c"