Hello world,

the two fixes in the patch

- show ASSOCIATE lists if present, to complete the AST dump

- fix an ICE where an EXEC_END_BLOCK survived.  This can only
  happen if the END ASSOCIATE or END BLOCK statement had a
  statement label.

If the preference is to use some other format for the ASSOCIATE
lists, for example by putting each statement on its own list,
I am open to suggestions.

Regression-tested (but we don't really test for this).  No test
case because we don't have the infrastructure for it.

No user impact expected (nobody but us developers uses
-fdump-fortran-original, I think).

OK for trunk?

Regards

        Thomas

2016-02-14  Thomas Koenig  <tkoe...@gcc.gnu.org>

        * dump-parse-tree.c (show_code_node):  Print association
        list of a block if present.  Handle EXEC_END_BLOCK.
Index: dump-parse-tree.c
===================================================================
--- dump-parse-tree.c	(Revision 233410)
+++ dump-parse-tree.c	(Arbeitskopie)
@@ -1773,6 +1773,7 @@ show_code_node (int level, gfc_code *c)
       {
 	const char* blocktype;
 	gfc_namespace *saved_ns;
+	gfc_association_list *alist;
 
 	if (c->ext.block.assoc)
 	  blocktype = "ASSOCIATE";
@@ -1780,6 +1781,12 @@ show_code_node (int level, gfc_code *c)
 	  blocktype = "BLOCK";
 	show_indent ();
 	fprintf (dumpfile, "%s ", blocktype);
+	for (alist = c->ext.block.assoc; alist; alist = alist->next)
+	  {
+	    fprintf (dumpfile, " %s = ", alist->name);
+	    show_expr (alist->target);
+	  }
+
 	++show_level;
 	ns = c->ext.block.ns;
 	saved_ns = gfc_current_ns;
@@ -1793,6 +1800,11 @@ show_code_node (int level, gfc_code *c)
 	break;
       }
 
+    case EXEC_END_BLOCK:
+      /* Only come here when there is a label on an
+	 END ASSOCIATE construct.  */
+      break;
+
     case EXEC_SELECT:
       d = c->block;
       fputs ("SELECT CASE ", dumpfile);

Reply via email to