[Patch, Fortran] Plug memory leaks; fix tree-check ICE for PR

Tobias Burnus burnus@net-b.de
Sun Aug 26 18:24:00 GMT 2012


Tobias Burnus wrote:
>
> PS: I wonder why gfortran.dg/interface_3.f90 passed before, given that 
> "proc_locus" wasn't set before. I also wonder why my patch causes the 
> test case to segfault. Well, at least that bug is now also fixed.

Answer: Because I am too strupid to read the patch after spending way 
too much time on this patch. I had accidentally deleted a line:

> @@ -2452,7 +2451,9 @@ loop:
>     accept_statement (st);
>     prog_unit = gfc_new_block;
>     prog_unit->formal_ns = gfc_current_ns;
> -  proc_locus = gfc_current_locus;
> +  if (prog_unit == prog_unit->formal_ns->proc_name
> +      && prog_unit->ns != prog_unit->formal_ns)
> +    prog_unit->refs++;

On the other hand, I think the result of the current patch

     subroutine thy_sub (a) ! { dg-error "enclosing procedure" }
                       1
Error: INTERFACE procedure 'thy_sub' at (1) has the same name as the 
enclosing procedure

is better than the previous result

     subroutine thy_sub (a) ! { dg-error "enclosing procedure" }
                                                                1
Error: INTERFACE procedure 'thy_sub' at (1) has the same name as the 
enclosing procedure


Thus, puzzle solved and diagnostics improved.

Tobias



More information about the Fortran mailing list