This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] PR34820 , PR34143 and PR32795 - some allocatable component bugs
- From: "Paul Richard Thomas" <paul dot richard dot thomas at gmail dot com>
- To: "Tobias Burnus" <burnus at net-b dot de>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 20 Nov 2008 16:49:28 +0100
- Subject: Re: [Patch, fortran] PR34820 , PR34143 and PR32795 - some allocatable component bugs
- References: <339c37f20811192243n1186e691obc0192a37c293842@mail.gmail.com> <49256F1B.5010404@net-b.de>
Tobias,
On Thu, Nov 20, 2008 at 3:07 PM, Tobias Burnus <burnus@net-b.de> wrote:
> Hi Paul,
>
> Paul Richard Thomas wrote:
>> I propose to commit this patch, which has been corrected for bit-rot
>> and to post a new PR for the memory leaks.
...snip..
> 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).
See my comment.
>
> 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()
>
> Valgrind shows:
>
> ==30978== Invalid read of size 8
> ==30978== at 0x5DCEFE: fold_convert (fold-const.c:2493)
> ==30978== by 0x4A003F: structure_alloc_comps (trans-array.c:5531)
> ==30978== by 0x4ABA84: gfc_generate_function_code (trans-decl.c:2802)
>
> The line is
>
> fold_convert (tree type, tree arg)
> {
> tree orig = TREE_TYPE (arg); // line 2493
>
> which called as follows from structure_alloc_comps
>
> tmp = array_type_nelts (TREE_TYPE (decl));
> tmp = fold_convert (gfc_array_index_type, tmp);
>
>
> 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?
>
>
> NAG f95, g95 and ifort agrees with Dominque and print "1 4" instead of
> "-1 2".
I cannot look at these until the weekend as I am off on trip in afew minutes.
>
>> Bootstrapped and regtested on FC9/x86_i64 - OK for trunk
>>
> I will have a look later.
....take your time, therefore!
Cheers
Paul
--
The knack of flying is learning how to throw yourself at the ground and miss.
--Hitchhikers Guide to the Galaxy