User account creation filtered due to spam.

Bug 22282 - [4.1 only] %loc is not implemented in gfortran
Summary: [4.1 only] %loc is not implemented in gfortran
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.1.0
: P2 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
: 23063 23064 29575 (view as bug list)
Depends on:
Blocks: 19292
  Show dependency treegraph
Reported: 2005-07-02 20:24 UTC by Andrew Pinski
Modified: 2007-04-29 10:07 UTC (History)
6 users (show)

See Also:
Known to work: 4.2.0 4.3.0
Known to fail: 4.1.1
Last reconfirmed: 2006-10-30 12:21:04


Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Andrew Pinski 2005-07-07 18:35:10 UTC
Confirmed based on <>.
Comment 2 Andrew Pinski 2005-07-25 16:58:52 UTC
*** Bug 23064 has been marked as a duplicate of this bug. ***
Comment 3 Andrew Pinski 2005-07-25 16:59:52 UTC
*** Bug 23063 has been marked as a duplicate of this bug. ***
Comment 4 CVS Commits 2005-10-24 19:28:28 UTC
Subject: Bug 22282

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	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 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.dg: cray_pointers_1.f90 
	                           cray_pointers_3.f90 loc_1.f90 

Log message:
	Commit for Asher Langton
	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_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_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
	* 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
	* 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
	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.


Comment 5 Steven Bosscher 2005-10-24 21:21:13 UTC
Comment 6 Andrew Pinski 2006-10-23 22:03:53 UTC
Reopening since %loc was not added even though it should be easy to add now.
Comment 7 Andrew Pinski 2006-10-23 22:04:15 UTC
*** Bug 29575 has been marked as a duplicate of this bug. ***
Comment 8 Paul Thomas 2006-11-14 10:19:07 UTC

In spite of this morning's posting to the list, I will not be submitting a patch for %LOC but rather for %REF.  I got stuck in vms space.  Is there any functional difference between %LOC and %REF, do you know?

Comment 9 Francois-Xavier Coudert 2006-11-14 10:37:47 UTC
%VAL, %REF and %DESCR have similar use and functionality, but %LOC is very different. It should in fact be an alias for function LOC, but it simply adding it in intrinsic.c with make_alias is not sufficient: creating a symbol name begining with a % has to be added to the parser and the symbol-name-mangler. My (short) attempt to do so failed, but it's probably not very difficult if you understand the binary tree structure of symbol names.
Comment 10 Daniel Franke 2007-04-29 00:23:41 UTC
From what I see, this seems to be implemented in 4.2/4.3, not in 4.1.1.
Is this still a P2? Will this be ever backported to 4.1.x?
Comment 11 Steven Bosscher 2007-04-29 10:07:04 UTC
This will not be backported to GCC 4.1.

Thanks for catching this, it's very helpful to find bugs that won't be resolved in released compilers.  There are already enough bugs in Bugzilla that do have to be fixed, so any help cleaning up the WONTFIX ones is great.

Closing as FIXED because this is fixed for GCC 4.2 and GCC 4.3.