From: rguenth Date: Wed, 10 Nov 2010 16:05:03 +0000 (+0000) Subject: 2010-11-10 Richard Guenther X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ae576fce858db9e971b789ab80c9ed9e707559dc;p=thirdparty%2Fgcc.git 2010-11-10 Richard Guenther PR tree-optimization/44964 * ipa-inline.c (cgraph_flatten): Check that SSA form matches. * gcc.dg/pr44964.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166543 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a13d96b848da..e0f89586ba90 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2010-11-10 Richard Guenther + + PR tree-optimization/44964 + * ipa-inline.c (cgraph_flatten): Check that SSA form matches. + 2010-11-10 Martin Jambor PR tree-optimization/46351 diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 0072d61bfc36..61fc6b9992ec 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1407,6 +1407,14 @@ cgraph_flatten (struct cgraph_node *node) continue; } + if (gimple_in_ssa_p (DECL_STRUCT_FUNCTION (node->decl)) + != gimple_in_ssa_p (DECL_STRUCT_FUNCTION (e->callee->decl))) + { + if (dump_file) + fprintf (dump_file, "Not inlining: SSA form does not match.\n"); + continue; + } + /* Inline the edge and flatten the inline clone. Avoid recursing through the original node if the node was cloned. */ if (dump_file) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 31d31d94067d..92a850909a59 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-11-10 Richard Guenther + + PR tree-optimization/44964 + * gcc.dg/pr44964.c: New testcase. + 2010-11-10 Eric Botcazou * gnat.dg/opt10.adb: Fix typo. diff --git a/gcc/testsuite/gcc.dg/pr44964.c b/gcc/testsuite/gcc.dg/pr44964.c new file mode 100644 index 000000000000..1df1bde0703d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr44964.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-fkeep-inline-functions -O" } */ + +static inline __attribute__ ((const)) +void baz (int i) +{ +} + +static __attribute__ ((always_inline)) +inline __attribute__ ((flatten)) +void bar (void) +{ + baz (0); +} + +void +foo (void) +{ + bar (); +} +