diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7954f062235..3f405374aca 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-06-20 Mark Mitchell + + PR c++/10888 + * tree-inline.c (expand_call_inline): Do not warn about failing to + inline functions declared in system headers. + * doc/invoke.texi (-Winline): Expand on documentation. + 2003-06-20 Richard Henderson * config/alpha/alpha.c (alpha_file_start): Disable diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 5256e66d8ff..33b16e86627 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -2811,6 +2811,15 @@ code is to provide behavior which is selectable at compile-time. @item -Winline @opindex Winline Warn if a function can not be inlined and it was declared as inline. +Even with this option, the compiler will not warn about failures to +inline functions declared in system headers. + +The compiler uses a variety of heuristics to determine whether or not +to inline a function. For example, the compiler takes into account +the size of the function being inlined and the the amount of inlining +that has already been done in the current function. Therefore, +seemingly insignificant changes in the source program can cause the +warnings produced by @option{-Winline} to appear or disappear. @item -Wno-invalid-offsetof @r{(C++ only)} @opindex Wno-invalid-offsetof diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 25dc0dce75b..a0b977744f6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-06-20 Mark Mitchell + + PR c++/10888 + * g++.dg/warn/Winline-3.C: New test. + 2003-06-20 Mark Mitchell * lib/target-supports.exp (check_alias_available): Make the test diff --git a/gcc/testsuite/g++.dg/warn/Winline-3.C b/gcc/testsuite/g++.dg/warn/Winline-3.C new file mode 100644 index 00000000000..1c226d1b4a0 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Winline-3.C @@ -0,0 +1,10 @@ +// { dg-options "-Winline -O" } + +#include + +using namespace std; + +int main(void) +{ + vector v(10); +} diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index c0d36106cf1..88bf4d9bc02 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1201,7 +1201,8 @@ expand_call_inline (tp, walk_subtrees, data) || !cgraph_global_info (fn)->inline_once) && !inlinable_function_p (fn, id, 0)) { - if (warn_inline && DECL_INLINE (fn) && !DID_INLINE_FUNC (fn)) + if (warn_inline && DECL_INLINE (fn) && !DID_INLINE_FUNC (fn) + && !DECL_IN_SYSTEM_HEADER (fn)) { warning_with_decl (fn, "inlining failed in call to `%s'"); warning ("called from here");