As of r266080, calls to dump_print* that aren't guarded by
  if (dump_enabled_p ())
lead to an assertion failure.

This patch fixes a few calls that weren't guarded, avoiding a
call to find_loop_location for the no-dumping case.

Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.

Committed to trunk as r266184, under the "obvious" rule.

gcc/ChangeLog:
        PR tree-optimization/88015
        * graphite-isl-ast-to-gimple.c
        (translate_isl_ast_to_gimple::scop_to_isl_ast): Add missing check
        for dump_enabled_p.
        * graphite-sese-to-poly.c (build_poly_scop): Likewise.
---
 gcc/graphite-isl-ast-to-gimple.c | 25 ++++++++++++++-----------
 gcc/graphite-sese-to-poly.c      |  3 ++-
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c
index e2dbf6f..cc93fb9 100644
--- a/gcc/graphite-isl-ast-to-gimple.c
+++ b/gcc/graphite-isl-ast-to-gimple.c
@@ -1411,17 +1411,20 @@ scop_to_isl_ast (scop_p scop)
   isl_ctx_set_max_operations (scop->isl_context, old_max_operations);
   if (isl_ctx_last_error (scop->isl_context) != isl_error_none)
     {
-      dump_user_location_t loc = find_loop_location
-       (scop->scop_info->region.entry->dest->loop_father);
-      if (isl_ctx_last_error (scop->isl_context) == isl_error_quota)
-       dump_printf_loc (MSG_MISSED_OPTIMIZATION, loc,
-                        "loop nest not optimized, AST generation timed out "
-                        "after %d operations [--param max-isl-operations]\n",
-                        max_operations);
-      else
-       dump_printf_loc (MSG_MISSED_OPTIMIZATION, loc,
-                        "loop nest not optimized, ISL AST generation "
-                        "signalled an error\n");
+      if (dump_enabled_p ())
+       {
+         dump_user_location_t loc = find_loop_location
+           (scop->scop_info->region.entry->dest->loop_father);
+         if (isl_ctx_last_error (scop->isl_context) == isl_error_quota)
+           dump_printf_loc (MSG_MISSED_OPTIMIZATION, loc,
+                            "loop nest not optimized, AST generation timed out 
"
+                            "after %d operations [--param 
max-isl-operations]\n",
+                            max_operations);
+         else
+           dump_printf_loc (MSG_MISSED_OPTIMIZATION, loc,
+                            "loop nest not optimized, ISL AST generation "
+                            "signalled an error\n");
+       }
       isl_ast_node_free (ast_isl);
       return NULL;
     }
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 69898d4..1d41cff 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -1218,7 +1218,8 @@ build_poly_scop (scop_p scop)
   enum isl_error err = isl_ctx_last_error (scop->isl_context);
   isl_ctx_reset_error (scop->isl_context);
   isl_options_set_on_error (scop->isl_context, old_err);
-  if (err != isl_error_none)
+  if (err != isl_error_none
+      && dump_enabled_p ())
     dump_printf (MSG_MISSED_OPTIMIZATION,
                 "ISL error while building poly scop\n");
 
-- 
1.8.5.3

Reply via email to