[PATCH] Cray Pointers (slight modifications)
Asher Langton
langton2@llnl.gov
Tue Aug 9 02:27:00 GMT 2005
:ADDPATCH fortran:
Here's an updated Cray Pointer patch. The changes from the last one are:
1) SAVE isn't prohibited with a Cray pointee, though it's ignored.
This is consistent with every other Fortran compiler to which I have
access.
2) Extra copies of array specs are freed in decl.c (variable_decl).
3) The test program has been broken into two: craytest.f90, which
uses -fcray-pointer, and loc.f90, which does not need any compile
time flags.
I haven't changed anything relating to the xplor-nih failures; so
far, it doesn't appear that this patch is causing the problems.
2005-08-08 Asher Langton <langton2@llnl.gov>
PR fortran/17031
PR fortran/22282
* 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_cray_pointer): New method
(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
*gfortran.texi: Added section on Cray pointers, removed Cray
pointers from list of proposed
extensions
* intrinsic.c (add_functions): add code for loc() intrinsic
* intrinsic.h (gfc_check_loc): Declare
(gfc_resolve_loc): Declare
* intrinsic.texi: Added documentation for loc intrinsic
* invoke.texi: Documented -fcray-pointer flag
* iresolve.c (gfc_resolve_loc): New
* lang.opt: Added fcray-pointer flag
* match.h (gfc_match_cray_pointer): Declare
* options.c (gfc_init_options): Intialized
gfc_match_option.flag_cray_pointer
(gfc_handle_option): deal with -fcray-pointer
* parse.c: Added do...while(0) and braces around match()
macro to avoid the if/else
ambiguity
(decode_statement): added code to detect statements starting with
"pointer ("
(resolve_equivalence): Added code prohibiting Cray pointees
in equivalence statements.
* resolve.c (check_dimension): added code to prevent bounds
checking for Cray
Pointee arrays.
* 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
2005-08-08 Asher Langton <langton2@llnl.gov>
PR fortran/17031
PR fortran/22282
gfortran.dg/craytest.f90: New
gfortran.dg/loc.f90: New
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cp_patch_8_08a.diff
Type: application/octet-stream
Size: 43931 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050809/b7f0bbd9/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: craytest.f90
Type: application/octet-stream
Size: 87275 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050809/b7f0bbd9/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loc.f90
Type: application/octet-stream
Size: 3022 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050809/b7f0bbd9/attachment-0002.obj>
More information about the Fortran
mailing list