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: [gfortran] Fix PR 15969


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.


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