This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


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

Re: possible patch


>>>>> Phil Edwards <pedwards@jaj.com> writes:

 >> I wonder why library compilation needs -Winline at all. When you write
 >> the library functions, you tag some as 'inline' based on your
 >> experience with the C++ language, just as you make other
 >> implementation decisions. It is not a serious problem if you mark some
 >> functions with inline that can't be inlined.

 > Just for the record, the functions in question aren't marked as inline;
 > they are defined in the header.  As Benjamin pointed out, -O2 is where the
 > new inliner starts working on those kinds of functions.  The other kind,
 > which must be marked as inline, get it at -O3.

 > (Unless I'm completely wrong again.)

Well, yes, you and Benjamin.  The new inliner is conditional on
flag_no_inline, which is conditional on -O, not -O2.  All functions defined
within a class are implicitly declared 'inline' unless -fno-default-inline
is specified.  -O3 implies -finline-functions, which means to consider for
inlining functions which were not actually declared inline.

Jason

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