public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-26] Support LABEL_DECL in %qD directive.
@ 2021-04-21 10:53 Martin Liska
  0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2021-04-21 10:53 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:df0581a4aff45e73ba7b73df7b98ba492bdc28a8

commit r12-26-gdf0581a4aff45e73ba7b73df7b98ba492bdc28a8
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Feb 18 12:58:39 2021 +0100

    Support LABEL_DECL in %qD directive.
    
    gcc/cp/ChangeLog:
    
            * error.c (dump_decl): Support anonymous labels.
    
    gcc/ChangeLog:
    
            * tree-cfg.c (gimple_verify_flow_info): Use qD instead
            of print_generic_expr.

Diff:
---
 gcc/cp/error.c |  5 ++++-
 gcc/tree-cfg.c | 29 ++++++++++-------------------
 2 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index ff4ae6f4b23..c88d1749a0f 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1362,7 +1362,10 @@ dump_decl (cxx_pretty_printer *pp, tree t, int flags)
       break;
 
     case LABEL_DECL:
-      pp_cxx_tree_identifier (pp, DECL_NAME (t));
+      if (DECL_NAME (t))
+	pp_cxx_tree_identifier (pp, DECL_NAME (t));
+      else
+	dump_generic_node (pp, t, 0, TDF_SLIM, false);
       break;
 
     case CONST_DECL:
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 4f63aa69ba8..f985867ced3 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -5564,37 +5564,29 @@ gimple_verify_flow_info (void)
 	  label = gimple_label_label (as_a <glabel *> (stmt));
 	  if (prev_stmt && DECL_NONLOCAL (label))
 	    {
-	      error ("nonlocal label ");
-	      print_generic_expr (stderr, label);
-	      fprintf (stderr, " is not first in a sequence of labels in bb %d",
-		       bb->index);
+	      error ("nonlocal label %qD is not first in a sequence "
+		     "of labels in bb %d", label, bb->index);
 	      err = 1;
 	    }
 
 	  if (prev_stmt && EH_LANDING_PAD_NR (label) != 0)
 	    {
-	      error ("EH landing pad label ");
-	      print_generic_expr (stderr, label);
-	      fprintf (stderr, " is not first in a sequence of labels in bb %d",
-		       bb->index);
+	      error ("EH landing pad label %qD is not first in a sequence "
+		     "of labels in bb %d", label, bb->index);
 	      err = 1;
 	    }
 
 	  if (label_to_block (cfun, label) != bb)
 	    {
-	      error ("label ");
-	      print_generic_expr (stderr, label);
-	      fprintf (stderr, " to block does not match in bb %d",
-		       bb->index);
+	      error ("label %qD to block does not match in bb %d",
+		     label, bb->index);
 	      err = 1;
 	    }
 
 	  if (decl_function_context (label) != current_function_decl)
 	    {
-	      error ("label ");
-	      print_generic_expr (stderr, label);
-	      fprintf (stderr, " has incorrect context in bb %d",
-		       bb->index);
+	      error ("label %qD has incorrect context in bb %d",
+		     label, bb->index);
 	      err = 1;
 	    }
 	}
@@ -5616,9 +5608,8 @@ gimple_verify_flow_info (void)
 
 	  if (glabel *label_stmt = dyn_cast <glabel *> (stmt))
 	    {
-	      error ("label ");
-	      print_generic_expr (stderr, gimple_label_label (label_stmt));
-	      fprintf (stderr, " in the middle of basic block %d", bb->index);
+	      error ("label %qD in the middle of basic block %d",
+		     gimple_label_label (label_stmt), bb->index);
 	      err = 1;
 	    }
 	}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-21 10:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21 10:53 [gcc r12-26] Support LABEL_DECL in %qD directive Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).