[PATCH 2/2] fortran: Ignore unused args in scalarization [PR97896]

2021-08-07 Thread Mikael Morin via Fortran
The KIND argument of the INDEX intrinsic is a compile time constant that is used at compile time only to resolve to a kind-specific library method. It is otherwise completely ignored at runtime, and there is no code generated for it as the library procedure has no kind argument. This confuses the

[PATCH 1/2] Revert "Remove KIND argument from INDEX so it does not mess up scalarization."

2021-08-07 Thread Mikael Morin via Fortran
This reverts commit d09847357b965a2c2cda063827ce362d4c9c86f2 except for its testcase. gcc/fortran/ * intrinsic.c (add_sym_4ind): Remove. (add_functions): Use add_sym4 instead of add_sym4ind. Don’t special case the index intrinsic. * iresolve.c (gfc_resolve_index_fu

[PATCH 0/2] fortran: Ignore unused arguments for scalarisation [PR97896]

2021-08-07 Thread Mikael Morin via Fortran
Hello, This is a variant of the patch series previously posted for master at [1], without patches 1 to 5. It has a more limited impact, which makes it more suitable for the release branches. The problematic case is intrinsic procedures where an argument is actually not used in the code generat