From 4c93660449ea23e5eee1f8ce3e97129c7974b7fc Mon Sep 17 00:00:00 2001 From: Aditya Kumar Date: Mon, 23 Nov 2015 19:31:00 +0000 Subject: [PATCH] fix PR68493: bail out when codegen_error is set Co-Authored-By: Sebastian Pop From-SVN: r230772 --- gcc/ChangeLog | 7 +++++ gcc/graphite-isl-ast-to-gimple.c | 2 ++ gcc/testsuite/ChangeLog | 8 +++++- gcc/testsuite/gcc.dg/graphite/pr68493.c | 34 +++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/graphite/pr68493.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 76f2474aba3..27f4d792820 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-11-23 Aditya Kumar + Sebastian Pop + + PR tree-optimization/68493 + * graphite-isl-ast-to-gimple.c (translate_pending_phi_nodes): Add + missing early return when codegen_error is set. + 2015-11-23 Aditya Kumar Sebastian Pop diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c index d421c089640..1d986f85905 100644 --- a/gcc/graphite-isl-ast-to-gimple.c +++ b/gcc/graphite-isl-ast-to-gimple.c @@ -2761,6 +2761,8 @@ translate_isl_ast_to_gimple::translate_pending_phi_nodes () fprintf (dump_file, "[codegen] to new-phi: "); print_gimple_stmt (dump_file, new_phi, 0, 0); } + if (codegen_error) + return; } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 19fa7024246..560b239f511 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,8 +1,14 @@ +2015-11-23 Aditya Kumar + Sebastian Pop + + PR tree-optimization/68493 + * gcc.dg/graphite/pr68493.c: New. + 2015-11-23 Aditya Kumar Sebastian Pop PR tree-optimization/68279 - * testsuite/gfortran.dg/graphite/pr68279.f90: New. + * gfortran.dg/graphite/pr68279.f90: New. 2015-11-23 Marek Polacek diff --git a/gcc/testsuite/gcc.dg/graphite/pr68493.c b/gcc/testsuite/gcc.dg/graphite/pr68493.c new file mode 100644 index 00000000000..95f3699a312 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr68493.c @@ -0,0 +1,34 @@ +/* { dg-options "-O1 -floop-nest-optimize" } */ + +int ce[2]; +int o5; +int p7; + +int foo (void) +{ + int j1; + ce[0] = 0; + for (j1 = 0; j1 < 2; ++j1) + for (o5 = 1; o5 >= 0; --o5) + p7 += ce[o5]; + return 0; +} + +int du; + +int bar (void) +{ + int u7[2]; + int ar; + + for (ar = 0; ar < 2; ++ar) { + int xo; + + for (xo = 0; xo < 2; ++xo) { + du += u7[ar]; + u7[0] = 0; + } + } + + return 0; +}