mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-08 20:52:05 +08:00
re PR c++/17115 (-Winline does not respect __attribute__((__noinline__)))
PR c++/17115 * tree-inline.c (expand_call_inline): Do not warn for functions marked with attribute noinline. PR c++/17115 * g++.dg/warn/Winline-4.C: New test. From-SVN: r88678
This commit is contained in:
parent
22d66adf5d
commit
09ebcffa19
@ -1,3 +1,9 @@
|
||||
2004-10-07 Giovanni Bajo <giovannibajo@gcc.gnu.org>
|
||||
|
||||
PR c++/17115
|
||||
* tree-inline.c (expand_call_inline): Do not warn for functions
|
||||
marked with attribute noinline.
|
||||
|
||||
2004-10-07 Eric Botcazou <ebotcazou@libertysurf.fr>
|
||||
|
||||
PR target/17862
|
||||
|
@ -1,3 +1,8 @@
|
||||
2004-10-07 Giovanni Bajo <giovannibajo@gcc.gnu.org>
|
||||
|
||||
PR c++/17115
|
||||
* g++.dg/warn/Winline-4.C: New test.
|
||||
|
||||
2004-10-07 Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
|
||||
|
||||
* gcc.c-torture/compile/20041007-1.c: New test.
|
||||
|
17
gcc/testsuite/g++.dg/warn/Winline-4.C
Normal file
17
gcc/testsuite/g++.dg/warn/Winline-4.C
Normal file
@ -0,0 +1,17 @@
|
||||
// { dg-do compile }
|
||||
// { dg-options "-O2 -Winline" }
|
||||
// Origin: <markus at oberhumer dot com>
|
||||
// PR 17115: We should not emit -Winline warning for functions marked with
|
||||
// noinline
|
||||
|
||||
struct Foo {
|
||||
__attribute__((noinline)) int a(int r) { return r & 1; }
|
||||
virtual __attribute__((noinline)) int b(int r) { return r & 1; }
|
||||
static __attribute__((noinline)) int c(int r) { return r & 1; }
|
||||
};
|
||||
|
||||
int bar(int r) {
|
||||
Foo f;
|
||||
int k = 1; k &= f.a(r); k &= f.b(r); k &= f.a(r);
|
||||
return k;
|
||||
}
|
@ -1475,7 +1475,8 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data)
|
||||
}
|
||||
else if (warn_inline && DECL_DECLARED_INLINE_P (fn)
|
||||
&& !DECL_IN_SYSTEM_HEADER (fn)
|
||||
&& strlen (reason))
|
||||
&& strlen (reason)
|
||||
&& !lookup_attribute ("noinline", DECL_ATTRIBUTES (fn)))
|
||||
{
|
||||
warning ("%Jinlining failed in call to '%F': %s", fn, fn, reason);
|
||||
warning ("called from here");
|
||||
|
Loading…
x
Reference in New Issue
Block a user