Commit 87e92864 by Andrew Pinski Committed by Andrew Pinski

re PR c++/41536 (always_inline does not work always with constructors)

2009-11-06  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR c++/41536
        * optimize.c (maybe_clone_body): Copy DECL_ATTRIBUTES and
        DECL_DISREGARD_INLINE_LIMITS also.

2009-11-06  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR c++/41536
        * g++.dg/ext/always_inline-5.C: New test.

From-SVN: r153974
parent 2e313572
2009-11-06 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR c++/41536
* optimize.c (maybe_clone_body): Copy DECL_ATTRIBUTES and
DECL_DISREGARD_INLINE_LIMITS also.
2009-11-06 Jakub Jelinek <jakub@redhat.com> 2009-11-06 Jakub Jelinek <jakub@redhat.com>
PR c++/41967 PR c++/41967
......
...@@ -199,6 +199,8 @@ maybe_clone_body (tree fn) ...@@ -199,6 +199,8 @@ maybe_clone_body (tree fn)
DECL_VISIBILITY (clone) = DECL_VISIBILITY (fn); DECL_VISIBILITY (clone) = DECL_VISIBILITY (fn);
DECL_VISIBILITY_SPECIFIED (clone) = DECL_VISIBILITY_SPECIFIED (fn); DECL_VISIBILITY_SPECIFIED (clone) = DECL_VISIBILITY_SPECIFIED (fn);
DECL_DLLIMPORT_P (clone) = DECL_DLLIMPORT_P (fn); DECL_DLLIMPORT_P (clone) = DECL_DLLIMPORT_P (fn);
DECL_ATTRIBUTES (clone) = copy_list (DECL_ATTRIBUTES (fn));
DECL_DISREGARD_INLINE_LIMITS (clone) = DECL_DISREGARD_INLINE_LIMITS (fn);
/* Adjust the parameter names and locations. */ /* Adjust the parameter names and locations. */
parm = DECL_ARGUMENTS (fn); parm = DECL_ARGUMENTS (fn);
......
2009-11-06 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR c++/41536
* g++.dg/ext/always_inline-5.C: New test.
2009-11-06 Jakub Jelinek <jakub@redhat.com> 2009-11-06 Jakub Jelinek <jakub@redhat.com>
PR c++/41967 PR c++/41967
......
// { dg-do compile }
struct f
{
inline f(void);
inline void f1(void);
int a;
};
inline __attribute__((always_inline)) f::f(void)
{
a++;
}
inline __attribute__((always_inline)) void f::f1(void)
{
a++;
}
void g(void)
{
f a, b, c, d;
a.f1();
}
// f::f() should be inlined even at -O0
// { dg-final { scan-assembler-not "_ZN1fC1Ev" } }
// Likewise for f::f1()
// { dg-final { scan-assembler-not "_ZN1f2f1Ev" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment