[Patch, fortran] PR 37131, inline matmul
Mikael Morin
mikael.morin@sfr.fr
Wed Jul 22 12:21:00 GMT 2015
Le 21/07/2015 21:49, Thomas Koenig a écrit :
> Am 21.07.2015 um 19:26 schrieb Mikael Morin:
>> I would like to avoid the hack in iresolve. So let's reuse the
>> frontend-passes.c part of my patch (set resolved_isym)
>
> I would much prefer if that was put into gfc_resolve_fe_runtime_error,
> next to the assignment to c->resolved_sym.
>
Makes sense.
>> and then handle
>> it in gfc_conv_intrinsic_subroutine, the way my patch does it (I'm not
>> sure it actually fixes anything) or some other way (set
>> resolved_sym->backend_decl as in iresolve, ...).
>
> It does actually fix the issue. One way of constructing a test case
> is to run
>
> $ gfortran -fdump-tree-optimized -fno-realloc-lhs -fcheck=all -O -S
> inline_matmul_2.f90
>
> and count the number of calls to "_gfortran_runtime_error " in the
> *.optimized dump (without the _at). It should be zero.
>
> So, OK from my side with the change above and corresponding test case.
>
This is what it looks like.
However, it introduces regressions on matmul_bounds_{2,4,5}.
It seems the "incorrect extent" runtime errors are completely optimized
away (even at -O0).
Any ideas?
Mikael
-------------- next part --------------
2015-07-22 Mikael Morin <mikael@gcc.gnu.org>
* iresolve.c (gfc_resolve_fe_runtime_error): Set c->resolved_isym.
* tran-intrinsic.c (gfc_conv_intrinsic_function_args,
conv_intrinsic_procedure_args): Factor the non-function-specific code
from the former into the latter.
(gfc_intrinsic_argument_list_length, intrinsic_argument_list_length):
Ditto.
(gfc_conv_intrinsic_lib_function, conv_intrinsic_lib_procedure):
Ditto.
(gfc_conv_intrinsic_lib_function, find_intrinsic_map):
Factor out from the former into the latter.
(conv_intrinsic_runtime_error): New function.
(gfc_conv_intrinsic_subroutine): Call it
in the GFC_ISYM_FE_RUNTIME_ERROR case.
2015-07-22 Mikael Morin <mikael@gcc.gnu.org>
* gfortran.dg/inline_matmul_12.f90: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Schwinge_2.diff
Type: text/x-patch
Size: 5860 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20150722/8c8b3e8e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inline_matmul_12.f90
Type: text/x-fortran
Size: 753 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20150722/8c8b3e8e/attachment-0001.bin>
More information about the Fortran
mailing list