This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran] Fix PR 15969
- From: Paul Brook <paul at codesourcery dot com>
- To: fortran at gcc dot gnu dot org
- Cc: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>,patch <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 10 Jul 2004 02:29:13 +0100
- Subject: Re: [gfortran] Fix PR 15969
- Organization: CodeSourcery
- References: <40EF3C4B.3050507@physik.uni-muenchen.de>
On Saturday 10 July 2004 01:46, Tobias Schlüter wrote:
> We didn't handle the initialization of pointer elemnts in derived types.
> Fixed thusly, with the help of Paul, Stevn and Andre Pinski :-)
I belatedly notice it still doesn't handle array pointers :(
c.f. gfc_trans_static_array_pointer.
> Built and tested on i686-pc-linux. If anyone has a good idea for a
> testcase I'm open to suggestions, in the tree dumps I can see that the
> member is explicitly zeroed, but i don't see anything of this in the
> assembly, most likely because our memory is initialized to zero anyway.
! Check that null initialization of pointer components works.
program der_init_5
implicit none
type t
type(t), pointer :: a => NULL()
real, pointer :: b => NULL()
character, pointer :: c => NULL()
integer, pointer, dimension(:) :: d => NULL()
end type
type (t) :: p
if (associated(p%a)) call abort()
<repeat for other components>
end program
The optimizers may be clever enough to eliminate the whole testcase, but that
doesn't matter.
Initialization of pointer variables (not components) is also broken, but
that's a different problem.
Paul
> 2004-07-10 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
>
> PR fortran/15969
> * trans-expr (gfc_conv_structure): Handle initialization
> of pointer components.