[Patch, fortran] PR25597 and PR27096 - automatic character, pointer array results.

Paul Thomas paulthomas2@wanadoo.fr
Mon Apr 10 16:44:00 GMT 2006

:ADDPATCH fortran:

This patch fixes another bug (PR27096) that prevents compilation of 
tonto-2.2 and follows on yesterdays patch 

The attached test case reproduces the error, which occurs on 
vec{str}.F90, line 408 of tonto.  In the course of investigating this 
bug, I fixed another, related bug (PR25597).

Unfortunately, the next bug looks rather bad at this time of the day:
UNKNOWN-gfortran-on-LINUX/f95files/atom.F90:2133: fatal error: gfc_todo: 
Not Implemented: complex character array constructors
compilation terminated.  I am beginning to wish that I had started with 

PR27096 causes an ICE when  explicit, automatic character length, 
pointer array results are translated.

test2.f90:1: internal compiler error: in gfc_trans_deferred_array, at


This comes about because the descriptor that is being checked for is 
pointed to by the backend declaration.  The patch branches on the 
declaration not being a descriptor, dereferences and then tests that the 
type is a descriptor.

PR25597 now causes a runtime failure because the character length is not 
processed in the case of implicit function results.  This comes about 
because arrays and automatic character results are treated separately in 
a series of if else's.  The simplest approach to fixing this is to 
reproduce the character treatment, within the array block.

Regtested on FC3/Athlon1700.  OK for trunk and 4.1?


2006-04-10  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/27096
    * trans-array.c (gfc_trans_deferred_array): If the backend_decl
    is not a descriptor, dereference and then test and use the type.

    PR fortran/25597
    * trans-decl.c (gfc_trans_deferred_vars): Check if an array
    result, is also automatic character length.  If so, process
    the character length.

2006-04-10  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/27096
    PR fortran/25597
    * gfortran.dg/auto_pointer_array_result_1.f90: New test.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: auto_pointer_array_result_1.f90
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060410/004fe2a0/attachment.f90>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060410/004fe2a0/attachment.ksh>

More information about the Gcc-patches mailing list