Bug 17031 - Cray pointers not supported
: Cray pointers not supported
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: fortran
: 4.0.0
: P2 enhancement
: 4.1.0
Assigned To: Not yet assigned to anyone
: http://gcc.gnu.org/ml/gcc-patches/200...
: patch, rejects-valid
:
:
  Show dependency treegraph
 
Reported: 2004-08-14 20:20 UTC by Deji Akingunola
Modified: 2005-10-24 21:20 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-09-29 16:14:01


Attachments
full source code (90.84 KB, text/plain)
2004-08-14 20:21 UTC, Deji Akingunola
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Deji Akingunola 2004-08-14 20:20:26 UTC
Not sure this is bug, 'cos IMHO, this kind of declaration is rather archaic;
however it is compiled properly by pgf90 and intel compiler. Here is an example
of such statement;
>>
*
      real qswv,qswi,pcpr,qswinv,qswini,ta,coszs,qswd
      real alvsbar,alirbar,cdmbar,qsens,qevap
      real su,sv,st,sq
      pointer (pata, ta(ilg))
      pointer (pacoszs,coszs(ilg)), (paqswd,qswd(ilg))
      pointer (paqwv  , qswv(ilg)), (paqwi, qswi(ilg))
      pointer (papcpr ,  pcpr(ilg))
<<
compiling with gfortran gives;
>>
[deji@rhema deji]$ f95 -c -x f95 class271.f
 In file class271.f:1952
 
      pointer (pata, ta(ilg))
     1
Error: Unclassifiable statement at (1)
 In file class271.f:1953
 
      pointer (pacoszs,coszs(ilg)), (paqswd,qswd(ilg))
     1
Error: Unclassifiable statement at (1)
 In file class271.f:1954
 <<
I've attached a copy of the full code. I'm working on a model that have a bunch
of source codes with similar declaration statements in them.
Thanks.
Comment 1 Deji Akingunola 2004-08-14 20:21:24 UTC
Created attachment 6927 [details]
full source code
Comment 2 Steve Kargl 2004-08-14 21:18:23 UTC
This code make use of the Cray pointer, which is a nonstandard construct.
Cray pointers are #9 on the wishlist of extensions, but I doubt Cray pointers
will be implemented in the near future. http://gcc.gnu.org/fortran/extensions.html
Comment 3 Deji Akingunola 2004-08-15 00:25:59 UTC
(In reply to comment #2)
> This code make use of the Cray pointer, which is a nonstandard construct.
> Cray pointers are #9 on the wishlist of extensions, but I doubt Cray pointers
> will be implemented in the near future. http://gcc.gnu.org/fortran/extensions.html
That's sad and disappointing that tis will not be implemented (soon), which
means the model will forever continue to rely on the proprietary compiler.
Thanks very much for the explanation and the link.
Comment 4 Andrew Pinski 2004-08-15 03:05:01 UTC
Confirmed.
Comment 5 Tobias Schlüter 2004-08-19 15:20:08 UTC
Changed summary, to make issue obvious.
Comment 6 Thomas Koenig 2005-05-23 20:10:43 UTC
According to a discussion on the fortran mailing
list, some initial work seems to have been done:

http://gcc.gnu.org/ml/fortran/2005-04/msg00071.html
Comment 7 Francois-Xavier Coudert 2005-09-29 16:14:01 UTC
We now have a proposed patch for that. It should be commited as soon as
paperwork issues are resolved.
Comment 8 CVS Commits 2005-10-24 19:28:25 UTC
Subject: Bug 17031

CVSROOT:    /cvs/gcc
Module name:    gcc
Changes by:    steven@gcc.gnu.org    2005-10-24 19:28:18

Modified files:
    gcc/fortran    : ChangeLog check.c decl.c expr.c gfortran.h 
                     gfortran.texi intrinsic.c intrinsic.h 
                     intrinsic.texi invoke.texi iresolve.c lang.opt 
                     options.c resolve.c symbol.c trans-array.c 
                     trans-decl.c trans-expr.c trans-intrinsic.c 
                     trans.h 
    gcc/testsuite  : ChangeLog 
Added files:
    gcc/testsuite/gfortran.dg: cray_pointers_1.f90 
                               cray_pointers_2.f90 
                               cray_pointers_3.f90 loc_1.f90 
                               loc_2.f90 

Log message:
    Commit for Asher Langton

    PR fortran/17031
    PR fortran/22282

    fortran/
    * check.c (gfc_check_loc) : New function
    * decl.c (variable_decl): New variables cp_as and sym. Added a
    check for variables that have already been declared as Cray
    Pointers, so we can get the necessary attributes without adding
    a new symbol.
    (attr_decl1): Added code to catch pointee symbols and "fix"
    their array specs.
    (cray_pointer_decl): New method.
    (gfc_match_pointer): Added Cray pointer parsing code.
    (gfc_mod_pointee_as): New method.
    * expr.c (gfc_check_assign): added a check to catch vector-type
    assignments to pointees with an unspecified final dimension.
    * gfortran.h: (GFC_ISYM_LOC): New.
    (symbol_attribute): Added cray_pointer and cray_pointee bits.
    (gfc_array_spec): Added cray_pointee and cp_was_assumed bools.
    (gfc_symbol): Added gfc_symbol *cp_pointer.
    (gfc_option): Added flag_cray_pointer.
    (gfc_add_cray_pointee): Declare.
    (gfc_add_cray_pointer ): Declare.
    (gfc_mod_pointee_as): Declare.
    * intrinsic.c (add_functions): Add code for loc() intrinsic.
    * intrinsic.h (gfc_check_loc): Declare.
    (gfc_resolve_loc): Declare.
    * iresolve.c (gfc_resolve_loc): New.
    * lang.opt: Added fcray-pointer flag.
    * options.c (gfc_init_options): Intialized
    gfc_match_option.flag_cray_pointer.
    (gfc_handle_option): Deal with -fcray-pointer.
    * parse.c:(resolve_equivalence): Added code prohibiting Cray
    pointees in equivalence statements.
    * resolve.c (resolve_array_ref): Added code to prevent bounds
    checking for Cray Pointee arrays.
    (resolve_equivalence): Prohibited pointees in equivalence
    statements.
    * symbol.c (check_conflict): Added Cray pointer/pointee
    attribute checking.
    (gfc_add_cray_pointer): New
    (gfc_add_cray_pointee): New
    (gfc_copy_attr): New code for Cray pointers and pointees
    * trans-array.c (gfc_trans_auto_array_allocation): Added code to
    prevent space from being allocated for pointees.
    (gfc_conv_array_parameter): Added code to catch pointees and
    correctly set their base address.
    * trans-decl.c (gfc_finish_var_decl): Added code to prevent
    pointee declarations from making it to the back end.
    (gfc_create_module_variable): Same.
    * trans-expr.c (gfc_conv_variable): added code to detect and
    translate pointees.
    (gfc_conv_cray_pointee): New.
    * trans-intrinsic.c (gfc_conv_intrinsic_loc): New.
    (gfc_conv_intrinsic_function): added entry point for loc
    translation.
    * trans.h (gfc_conv_cray_pointee): Declare.

    * gfortran.texi: Added section on Cray pointers, removed Cray
    pointers from list of proposed extensions
    * intrinsic.texi: Added documentation for loc intrinsic.
    * invoke.texi: Documented -fcray-pointer flag

    testsuite/
    PR fortran/17031
    PR fortran/22282
    * gfortran.dg/cray_pointers_1.f90: New test.
    * gfortran.dg/cray_pointers_2.f90: New test.
    * gfortran.dg/cray_pointers_3.f90: New test.
    * gfortran.dg/loc_1.f90: New test.
    * gfortran.dg/loc_2.f90: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.597&r2=1.598
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/check.c.diff?cvsroot=gcc&r1=1.36&r2=1.37
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/decl.c.diff?cvsroot=gcc&r1=1.47&r2=1.48
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/expr.c.diff?cvsroot=gcc&r1=1.31&r2=1.32
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/gfortran.h.diff?cvsroot=gcc&r1=1.90&r2=1.91
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/gfortran.texi.diff?cvsroot=gcc&r1=1.24&r2=1.25
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/intrinsic.c.diff?cvsroot=gcc&r1=1.55&r2=1.56
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/intrinsic.h.diff?cvsroot=gcc&r1=1.33&r2=1.34
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/intrinsic.texi.diff?cvsroot=gcc&r1=1.17&r2=1.18
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/invoke.texi.diff?cvsroot=gcc&r1=1.22&r2=1.23
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/iresolve.c.diff?cvsroot=gcc&r1=1.43&r2=1.44
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/lang.opt.diff?cvsroot=gcc&r1=1.20&r2=1.21
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/options.c.diff?cvsroot=gcc&r1=1.27&r2=1.28
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/resolve.c.diff?cvsroot=gcc&r1=1.62&r2=1.63
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/symbol.c.diff?cvsroot=gcc&r1=1.38&r2=1.39
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-array.c.diff?cvsroot=gcc&r1=1.63&r2=1.64
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-decl.c.diff?cvsroot=gcc&r1=1.71&r2=1.72
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-expr.c.diff?cvsroot=gcc&r1=1.66&r2=1.67
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-intrinsic.c.diff?cvsroot=gcc&r1=1.55&r2=1.56
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans.h.diff?cvsroot=gcc&r1=1.37&r2=1.38
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6243&r2=1.6244
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/cray_pointers_1.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/cray_pointers_2.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/cray_pointers_3.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/loc_1.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/loc_2.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
Comment 9 Steven Bosscher 2005-10-24 21:20:45 UTC
.