This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: CVS g++ new warning [-Winline -Werror -O1]
maybe_commonixe_var is a nop for non-inline functions. For inline ones
it can mark them as non-inlinable. _But_ that information is squirreled
away and only printed if/when the function is emitted as a non-inline
function. The tree inliner _appears_ to ignore this flag.
AFAICT
1) An unused local static var with a trivial ctor/dtor can be optimized
away (unfortunately non-trivial ctors and dtors can have side effects the
programmer can rely on). __FUNCTION__ etc are now such vars (which we _must_
optimize out).
2) Platforms supporting common linkage can emit a needed static var
defn and still inline the function.
3) Certain platforms don't have common linkage. If an external
function has a static var, it cannot be inlined.
2 & 3 are currently determined at the point of the var's definition,
before we know whether the var is used. Both can cause the function-
cannot-be-inlined flag, even though for (2) it can be, and we don't know
about (1). This is the failure Ben has tripped over.
Good analysis. Yes, there are some situations where the tree inliner
will inline things the RTL inliner cannot. I'll try to look at this,
too, to see what's going on. Thanks,
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com