local pointers, zero initialized

VandeVondele Joost joost.vandevondele@mat.ethz.ch
Tue Sep 2 17:16:00 GMT 2014


I've noticed that for this code:

 SUBROUTINE S1()
   INTEGER, POINTER, DIMENSION(:) :: v
   INTERFACE 
    SUBROUTINE foo(v)
       INTEGER, POINTER, DIMENSION(:) :: v
    END SUBROUTINE
   END INTERFACE
   CALL foo(v)
 END SUBROUTINE S1

gfortran initializes the pointer (to zero) even if '-fno-init-local-zero' :

s1 ()
{
  struct array1_integer(kind=4) v;

  v.data = 0B;
  foo (&v);
}

I don't think this is mandated (other compilers don't), and I would prefer not to have this. Is this possible with a option flag, or does this need a patch to the code generation.

Thanks,

Joost


More information about the Fortran mailing list