Le 27/10/2021 à 23:29, Bernhard Reutner-Fischer via Fortran a écrit :
From: Bernhard Reutner-Fischer <al...@gcc.gnu.org>

addresses: FIXME: gfc_current_locus is wrong
by using the locus of the current intrinsic.
Regtests clean, ok for trunk?

Hello,

I’m not convinced that replacing a global variable by an other really fixes things. gfc_current_intrinsic_where is only valid if the simplification functions are called from gfc_intrinsic_func_interface.
The fatal errors hardly need a location anyway; as for the rest, well...

A proper fix would add a location argument to gfc_simplify_f’s union fields (and maybe gfc_check_f’s as well), and the associated simplification functions. As the impact would be somewhat massive, maybe add new distinct union fields with location arguments and a procedure (a switch on the intrinsic id basically) to decide which field to use.
Does it sound good to you?

Mikael

Reply via email to