This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/47266] Optimization: Declare PRIVATE module procedures as "TREE_PUBLIC = 0" ("static function")


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47266

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-01-15 11:03:13 UTC ---
Submitted patch: See http://gcc.gnu.org/ml/fortran/2011-01/msg00094.html

There were additional restrictions with BIND(C) - and as Ian pointed out, there
are also issues when using the function as specification expression in
arguments of PUBLIC functions, cf.
http://gcc.gnu.org/ml/fortran/2011-01/msg00100.html

For submodules, one also needs to be careful - as submodules can access PRIVATE
modules of the host. However, as submodules cannot be USE associated and in
order to use them, a "module function/subroutine" is defined in the module, it
is known at compile time whether a submodule exists or not.

Thus, the optimization can be done - but one needs additional checks whether
the function is used in specification expressions (probably only for function
results) and later whether the module itself has submodules or not.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]