This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [fortran] New version of matmul inline patch
- From: Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>
- To: Thomas Koenig <tkoenig at netcologne dot de>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 15 Apr 2015 09:59:43 +0200
- Subject: Re: [fortran] New version of matmul inline patch
- Authentication-results: sourceware.org; auth=none
Hello Thomas,
first, thanks for working on an inline version of matmul. (I wonder
whether there is a PR which would be fixed by it; presumably yes.
Secondly, I wonder whether we then still need the version in the
library; if not, can you when the final patch is in update
https://gcc.gnu.org/wiki/LibgfortranAbiCleanup ?)
Thomas Koenig wrote:
> Question: What to do about run-time bounds checking? I am leaning
> towards making an intrinsic subroutine which can not be called
> by the user, and have that translate to runtime_error_at.
That sounds reasonable. Have a look at STRIDE which is an existing
only internally available intrinsic:
class.c:
block->expr2 = gfc_build_intrinsic_call (sub_ns, GFC_ISYM_STRIDE, "stride",
intrinsic.c- /* Obtain the stride for a given dimensions; to be used only internally.
intrinsic.c- "make_from_module" makes it inaccessible for external users. */
intrinsic.c: add_sym_2 (GFC_PREFIX ("stride"), GFC_ISYM_STRIDE, CLASS_INQUIRY, ACTUAL_NO,
intrinsic.c- BT_INTEGER, gfc_index_integer_kind, GFC_STD_GNU,
intrinsic.c- NULL, NULL, gfc_resolve_stride,
intrinsic.c- ar, BT_REAL, dr, REQUIRED, dm, BT_INTEGER, ii, OPTIONAL);
intrinsic.c- make_from_module();
Except that you want to have a subroutine and not a function.
And then you just have to handle it in trans-intrinsic.c: search for the GFC_ISY_* of
a subroutine (followed by a colon), create a small function in which you call
gfc_trans_runtime_error.
Tobias