This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, fortran] PR34820 , PR34143 and PR32795 - some allocatable component bugs


Tobias,

Before committing, I have done some work to try to fix your niggles:

> Regarding PR 34820: While the several of the examples of Daniel Franke
> are fixed, my original test case (comment 0; or the FOR line in comment
> 13) still show a memory leak (valgrind --leak-check=full output, see
> comment 0).

Indeed - this will be part of the memory leak PR.

> For PR 34820: Interestingly, the original test case in the TAR file
> compiles without any problems, but compiling the example from comment 3
> gives a segmentation fault (but no ICE anymore) for line 6, namely
>   subroutine read_grid_header()

It turns out that this is because the INTENT(OUT) variable is
unreferenced.  If you allocate it, for example, the seg fault goes
away.  The reason for this is that the automatic array length is not
assigned to the array bounds unless the dummy is referenced.
trans-decl.c(generate_local_decl) is the place to deal with this, in
the same way as unreferenced variable length CHARACTER parameters.
This is trivial.


> For PR 34143: Again, the original test case works, but the example of
> Dominque (comment 13) shows:
>
>  derived type, ik=           4
> [...]
>  bounds, full implicit section          -1           2    <-- should not it be 4?

Yes, I had forgotten about this and the discussion before comment 13.
I'll have a wee stab at this tomorrow before committing.  If I cannot
fix it, I will raise a PR on it.

Cheers

Paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]