This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH, gfortran] Re: Cray Pointers
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: langton2 at llnl dot gov (Asher Langton)
- Cc: Thomas dot Koenig at online dot de (Thomas Koenig), paul at codesourcery dot com (Paul Brook), fortran at gcc dot gnu dot org, kumbera1 at llnl dot gov (Mike Kumbera), Tobias dot Schlueter at physik dot uni-muenchen dot de (Tobias Schlueter), gcc-patches at gcc dot gnu dot org
- Date: Fri, 12 Aug 2005 15:42:04 -0400 (EDT)
- Subject: Re: [PATCH, gfortran] Re: Cray Pointers
>
> At 9:15 PM +0200 8/12/05, Thomas Koenig wrote:
> >Asher Langton wrote:
> >
> >> The trouble occurs when a
> >> pointee and an object that it aliases are both used in the same part
> >> of the program.
> >
> >Would it make sense to declare a pointee as a target, i.e.
> >set TREE_ADDRESSABLE on it?
>
> With our implementation (which we've designed with the goal of being
> consistent with the existing implementations), I don't think that
> would help. All of the pointee translations are purely front-end.
> Here's an example, with the GENERIC output. Note that the pointee p
> is not in the GENERIC tree:
>
> % cat ex3.f90
> program ex3
> real t
> real p
> pointer (ipt, p)
> ipt = loc(t)
> p = 1.0
> end program ex3
>
> % cat ex3.f90.t02.original
> MAIN__ ()
> {
> real4 t;
> int8 ipt;
>
> {
> <unnamed type> D.805;
>
> D.805 = (<unnamed type>) (int8) &t;
> ipt = (int8) D.805;
> }
> *(real4 *) ipt = 1.0e+0;
> }
can you use "void*" instead when you have a pointer?
-- Pinski