This is the mail archive of the gcc-patches@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]

Re: CVS g++ new warning [-Winline -Werror -O1]


>>>>> Nathan Sidwell <nathan@codesourcery.com> writes:

 > 2) Platforms supporting common linkage can emit a needed static var
 > defn and still inline the function.

We currently suppress inlining for all targets if there's a static
variable, because that's simpler than getting the semantics right.  I've
forgotten the bug that led me to that conclusion...

 > 3) Certain platforms don't have common linkage. If an external
 > function has a static var, it cannot be inlined.

All platforms have common; many don't have comdat.  Such targets cannot
share initialized static locals between out-of-line copies of inline
functions in different translation units.  If the initializer is removed,
we can use common.

Jason

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