This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix annoying typo in tree-nested.c
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 28 May 2008 19:43:24 +0200
- Subject: Fix annoying typo in tree-nested.c
... since it has effectively disabled inlining in GCC 4.x for any subprogram
containing a nested subprogram:
static inline int foo1 (int a)
{
void bar1 (int b)
{}
return a;
}
int foo2 (int a)
{
return foo1 (a);
}
gcc -O -c t.c -Winline
t.c: In function 'foo2':
t.c:2: warning: inlining failed in call to 'foo1': function not inlinable
t.c:10: warning: called from here
Obvious fix attached, tested on i586-suse-linux. RMs, on which branch(es)
should I put this?
2008-05-28 Eric Botcazou <ebotcazou@adacore.com>
* tree-nested.c (check_for_nested_with_variably_modified): Fix typo.
2008-05-28 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/nested-func-6.c: New test.
--
Eric Botcazou
Index: tree-nested.c
===================================================================
--- tree-nested.c (revision 136010)
+++ tree-nested.c (working copy)
@@ -770,7 +770,7 @@ check_for_nested_with_variably_modified
for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested)
{
for (arg = DECL_ARGUMENTS (cgn->decl); arg; arg = TREE_CHAIN (arg))
- if (variably_modified_type_p (TREE_TYPE (arg), 0), orig_fndecl)
+ if (variably_modified_type_p (TREE_TYPE (arg), orig_fndecl))
return true;
if (check_for_nested_with_variably_modified (cgn->decl, orig_fndecl))
/* { dg-do compile } */
/* { dg-options "-O -Winline" } */
static inline int foo1 (int a)
{ /* { dg-bogus "function not inlinable" } */
void bar1 (int b)
{}
return a;
}
int foo2 (int a)
{
return foo1 (a);
}