Message ID | 87vbdnzvd4.fsf@kepler.schwinge.homeip.net |
---|---|
State | New |
Headers | show |
Hello, Le 13/07/2015 21:54, Thomas Schwinge a écrit : > Original situation; _gfortran_runtime_error is not being properly > declared (invoked via gcc/fortran/frontend-passes.c:runtime_error_ne), > but, for example, _gfortran_error_runtime_at is being properly declared > (invoked from elsewhere): normal (non-frontend-generated) code does through a 'resolution' step which after some checks may resolve procedure names to intrinsic procedure symbols (user procedure with same name as an intrinsic are allowed). So maybe what you miss is such a resolution step. Does it work if you add resolve_block_construct (*c); at the end of inline_matmul_assign? Mikael
Hi! On Wed, 15 Jul 2015 13:44:38 +0200, Mikael Morin <mikael.morin@sfr.fr> wrote: > Le 13/07/2015 21:54, Thomas Schwinge a écrit : > > Original situation; _gfortran_runtime_error is not being properly > > declared (invoked via gcc/fortran/frontend-passes.c:runtime_error_ne), > > but, for example, _gfortran_error_runtime_at is being properly declared > > (invoked from elsewhere): > > normal (non-frontend-generated) code does through a 'resolution' step > which after some checks may resolve procedure names to intrinsic > procedure symbols (user procedure with same name as an intrinsic are > allowed). > So maybe what you miss is such a resolution step. > Does it work if you add > resolve_block_construct (*c); > at the end of inline_matmul_assign? Hmm, that doesn't seem to work, or I've done it wrongly. Any other ideas? Grüße, Thomas
Hi, I'm back from holiday, so I can finally reply. Am 13.07.2015 um 21:54 schrieb Thomas Schwinge: > --- gcc/fortran/iresolve.c > +++ gcc/fortran/iresolve.c > @@ -2207,6 +2207,9 @@ gfc_resolve_fe_runtime_error (gfc_code *c) > a->name = "%VAL"; > > c->resolved_sym = gfc_get_intrinsic_sub_symbol (name); > + //TODO > + extern tree gfor_fndecl_runtime_error; > + c->resolved_sym->backend_decl = gfor_fndecl_runtime_error; > } This patch actually works quite well. I cannot check the varargs part on x86_64, but the non-return part is OK. Obviously, the backend decl for runtime_error needs to be set. The question is where to put this. iresolve.c seems conceptually wrong, but I cannot find a clean place to put this in trans-*, without special casing in strange places. So, what is the general optionion? Do something in this place which is essentially this patch (plus a GTY in the prototype)? Regards Thomas
--- gcc/fortran/iresolve.c +++ gcc/fortran/iresolve.c @@ -2207,6 +2207,9 @@ gfc_resolve_fe_runtime_error (gfc_code *c) a->name = "%VAL"; c->resolved_sym = gfc_get_intrinsic_sub_symbol (name); + //TODO + extern tree gfor_fndecl_runtime_error; + c->resolved_sym->backend_decl = gfor_fndecl_runtime_error; } void