>> As I said I was going to give it a shot over the week-end, here's an
>> update on this: it won't make it into 4.3, because it's a big change
>> and my current patch is triggering a very long string of
> Huh, still I would be interested in seeing the patch.

It's based on Michal Matz's patch at
http://gcc.gnu.org/ml/gcc/2007-08/msg00236.html
I'll send it tomorrow, I don't have my laptop with me today.

> Can we trick fotran to set DECL_UNINLINABLE in the non CONTAIN'ed
> functions?

Yes, I think we can do that. Grep the front-end sources for
FUNCTION_DECL as argument to build_decl:
  * the decl built in gfc_get_intrinsic_lib_fndecl (trans-intrinsic.c)
can be made DECL_UNINLINABLE unconditionally
  * in trans-decl.c, the decls built in gfc_get_extern_function_decl
and gfc_build_library_function_decl can also be made DECL_UNINLINABLE
unconditionally
  * finally, in build_function_decl (trans-decl.c), you can do something like

Index: trans-decl.c
===================================================================
--- trans-decl.c        (revision 127902)
+++ trans-decl.c        (working copy)
@@ -1217,6 +1217,8 @@ build_function_decl (gfc_symbol * sym)

   type = gfc_get_function_type (sym);
   fndecl = build_decl (FUNCTION_DECL, gfc_sym_identifier (sym), type);
+  if (!sym->attr.contained)
+    DECL_UNINLINABLE (fndecl) = 1;

   /* Perform name mangling if this is a top level or module procedure.  */
   if (current_function_decl == NULL_TREE)


I have neither built nor regtested this, and I won't be able to do it
in the next few days. If you feel like trying, please go ahead.

FX

Reply via email to