Hi Steve,
Steve Kargl:
On Mon, Dec 31, 2012 at 01:17:04PM +0100, Tobias Burnus wrote:
This new intrinsic is only internally available and will be used by the
finalization wrapper to handle noncontiguous arrays.
What is the plan for when J3 decides to add a
STRIDE intrinsic
Well, we then add it. As written, this intrinsic is *only* *internally*
available.
Actually, I do hope that J3 will add a better access to Fortran's array
descriptor. Currently, one can do a lot of manipulations from C (since
ISO/IEC TS 29113:2012) but not from Fortran. The better access from
Fortran also matches the wish of the UK's BSI Fortran Panel:
ftp://ftp.nag.co.uk/sc22wg5/N1901-N1950/N1923.pdf (4th non-indent
paragraph).
At a minimum, please consider adding a leading underscore to the function.
If you had read the patch carefully, you had seen that the intrinsic is
defined as GFC_PREFIX ("stride"), which expands on most systems to
"_F._stride".
However, even if I had named it "stride" it were not available as it is
marked as "make_from_module();". The latter implies that
gfc_find_function (name) won't find it. You have to use a symbol which
has "sym->intmod_sym_id" set - which is not possible from the user code.
The "make_from_module();" technique has been added for procedures like
"c_sizeof" which should be handled via the normal intrinsic handling
(intrinsic.c, check.c, iresolve.c, trans-intrinsic.c), but where the
procedure should only be available after using "USE ISO_C_BINDING".
By the way, the symbol also never appears in the tree / assembler as it
is converted into the respective component access of the array
descriptor, e.g. "variable.dim[i].stride".
Tobias