[patch, fortran]

Jerry DeLisle jvdelisle@charter.net
Thu Jul 14 17:47:00 GMT 2016


This simple patch kindly provided by Marco solves the problem.

Regression tested on x86_64-Linux, Test case provided also.

OK to commit to trunk?

Jerry

2016-07-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
	    Marco Restelli <mrestelli@gmail.com>

	PR fortran/62125
	* symbol.c (select_type_insert_tmp): Recursively call self to take care
	of nested select type.

diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 0ee7dec..c967f25 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -2930,7 +2930,11 @@ select_type_insert_tmp (gfc_symtree **st)
   gfc_select_type_stack *stack = select_type_stack;
   for (; stack; stack = stack->prev)
     if ((*st)->n.sym == stack->selector && stack->tmp)
-      *st = stack->tmp;
+      {
+        *st = stack->tmp;
+        select_type_insert_tmp (st);
+        return;
+      }
 }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr62125.f90
Type: text/x-fortran
Size: 647 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20160714/87ccff4c/attachment.bin>


More information about the Fortran mailing list