Handle NULL def in build_cross_bb_scalars_def
authorTom de Vries <tom@codesourcery.com>
Sat, 7 May 2016 06:47:07 +0000 (06:47 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Sat, 7 May 2016 06:47:07 +0000 (06:47 +0000)
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.

From-SVN: r235994

gcc/ChangeLog
gcc/graphite-scop-detection.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/graphite/pr70956.c [new file with mode: 0644]

index ce10e79d4e51f2c8ac892335d1dea643c950774b..5f4d7fd3f2cfde31982ae6a7ad9791d6cf669740 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2016-05-07  Oleg Endo  <olegendo@gcc.gnu.org>
 
        * config/sh/sh-protos.h (sh_cbranch_distance): Declare new function.
index 7615842b332d34a734ac26383ed11a44047bd4c0..dd50a1e4ec004d65b0bd6ff2b16afad8c247e082 100644 (file)
@@ -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
index 31a65a410e3c1e852be618536f48bd88a39a501b..585839c0c759791830167333a4eab629b57d56b1 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-07  Tom de Vries  <tom@codesourcery.com>
+
+       PR tree-optimization/70956
+       * gcc.dg/graphite/pr70956.c: New test.
+
 2016-05-06  Jakub Jelinek  <jakub@redhat.com>
 
        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 (file)
index 0000000..31fc25f
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fgraphite-identity" } */
+
+#include "../tree-ssa/vrp66.c"