diff mbox

[fortran]

Message ID 00d16e42-f56d-992a-1a92-da85660c9cd7@charter.net
State New
Headers show

Commit Message

Jerry DeLisle July 14, 2016, 5:47 p.m. UTC
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.

Comments

Jerry DeLisle July 15, 2016, 1:26 a.m. UTC | #1
Hit send too soon and forgot to fill out the subject line. Correctly 
given here.
On 07/14/2016 10:47 AM, Jerry DeLisle wrote:
> 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;
> +      }
>  }
>
Mikael Morin July 15, 2016, 8:35 a.m. UTC | #2
Le 15/07/2016 à 03:26, Jerry DeLisle a écrit :
> Hit send too soon and forgot to fill out the subject line. Correctly
> given here.
> On 07/14/2016 10:47 AM, Jerry DeLisle wrote:
>> 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?
>>
Yes. Thanks.
Jerry DeLisle July 15, 2016, 7:42 p.m. UTC | #3
On 07/15/2016 01:35 AM, Mikael Morin wrote:
> Le 15/07/2016 à 03:26, Jerry DeLisle a écrit :
>> Hit send too soon and forgot to fill out the subject line. Correctly
>> given here.
>> On 07/14/2016 10:47 AM, Jerry DeLisle wrote:
>>> 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?
>>>
> Yes. Thanks.

Thanks for review Mikael!

Jerry
diff mbox

Patch

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;
+      }
 }