Whole-file compilation in gfortran

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Wed Aug 15 15:53:00 GMT 2007


Michael Matz wrote:
> But even with that problem solved, we still wouldn't get nice inlining 
> because of problem (2).  That's because the fortran frontend generates a 
> new FUNCTION_DECL for each get_extern_function_decl call, which is used 
> for each function definition and each function call.  Hence all calls will 
> have different FUNCTION_DECLs, in turn being all different to all decls 
> for the function definitions.  Calls to the same function name will happen 
> to have different FUNCTION_DECLs, but with the same name.

I once made a patch where I tried solving this for external procedures 
by attaching the FUNCTION_DECL to the corresponding gsymbol, and always 
looking there first, but I didn't get this to work.  I also don't seem 
to have kept a copy of the patch.

Solving this problem should probably be solved together with the module 
loading speed issues FX mentioned upthread, as once the module('s 
namespace) is kept in memory, it shouldn't be too hard to attach the 
FUNCTION_DECLs to the objects in the module's namespaces.

Cheers,
- Tobi



More information about the Fortran mailing list