diff mbox

[fortran] Two associate fixes in dump-parse-tree.c

Message ID 56C0D530.9060406@netcologne.de
State New
Headers show

Commit Message

Thomas Koenig Feb. 14, 2016, 7:27 p.m. UTC
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  <tkoenig@gcc.gnu.org>

         * dump-parse-tree.c (show_code_node):  Print association
         list of a block if present.  Handle EXEC_END_BLOCK.

Comments

Thomas Koenig Feb. 28, 2016, 11:42 a.m. UTC | #1
I wrote:

Patch at

https://gcc.gnu.org/ml/gcc-patches/2016-02/msg00941.html

> OK for trunk?
>
> Regards
>
>      Thomas
>
> 2016-02-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
>
>          * dump-parse-tree.c (show_code_node):  Print association
>          list of a block if present.  Handle EXEC_END_BLOCK.
Jerry DeLisle Feb. 28, 2016, 6:40 p.m. UTC | #2
On 02/28/2016 03:42 AM, Thomas Koenig wrote:
> I wrote:
> 
> Patch at
> 
> https://gcc.gnu.org/ml/gcc-patches/2016-02/msg00941.html
> 
>> OK for trunk?
>>
>> Regards
>>
>>      Thomas
>>
>> 2016-02-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
>>
>>          * dump-parse-tree.c (show_code_node):  Print association
>>          list of a block if present.  Handle EXEC_END_BLOCK.
> 
> 

Yes, OK

Jerry
diff mbox

Patch

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);