PR fortran/26682
* trans-decl.c (build_function_decl): Set "externally_visible"
attribute on the MAIN program decl.
From-SVN: r128993
+2007-10-03 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/26682
+ * trans-decl.c (build_function_decl): Set "externally_visible"
+ attribute on the MAIN program decl.
+
2007-10-03 Tobias Schlüter <tobi@gcc.gnu.org>
PR fortran/33198
TREE_SIDE_EFFECTS (fndecl) = 0;
}
+ /* For -fwhole-program to work well, MAIN__ needs to have the
+ "externally_visible" attribute. */
+ if (attr.is_main_program)
+ DECL_ATTRIBUTES (fndecl)
+ = tree_cons (get_identifier("externally_visible"), NULL_TREE, NULL_TREE);
+
/* Layout the function declaration and put it in the binding level
of the current function. */
pushdecl (fndecl);