From: Duncan Sands Date: Tue, 31 May 2011 07:03:53 +0000 (+0200) Subject: Backport the fix for PR47714 from the 4.6 branch. X-Git-Tag: releases/gcc-4.5.4~613 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14d8e77fed4f062c1c44a95ce3f2a0bcbe00bd2b;p=thirdparty%2Fgcc.git Backport the fix for PR47714 from the 4.6 branch. From-SVN: r174467 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index fddbf6de778f..01332373acae 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2011-05-31 Duncan Sands + + Backported from 4.6 branch + 2011-03-09 Martin Jambor + + PR tree-optimization/47714 + * method.c (use_thunk): Clear addressable flag of thunk arguments. + 2011-05-20 Jason Merrill PR c++/48873 diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 5ed98bc93bd4..088c9e7c1dbe 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -374,6 +374,7 @@ use_thunk (tree thunk_fndecl, bool emit_p) DECL_CONTEXT (x) = thunk_fndecl; SET_DECL_RTL (x, NULL_RTX); DECL_HAS_VALUE_EXPR_P (x) = 0; + TREE_ADDRESSABLE (x) = 0; t = x; } a = nreverse (t); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7d23efe07691..5008295ba8db 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2011-05-31 Duncan Sands + + Backported from 4.6 branch + 2011-03-09 Martin Jambor + + PR tree-optimization/47714 + * g++.dg/torture/pr47714.C: New test. + 2011-05-29 Richard Sandiford * gcc.target/mips/reg-var-1.c: New test. diff --git a/gcc/testsuite/g++.dg/torture/pr47714.C b/gcc/testsuite/g++.dg/torture/pr47714.C new file mode 100644 index 000000000000..4ff2eeef0a46 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr47714.C @@ -0,0 +1,16 @@ +struct A { virtual ~A () {} }; +struct B { virtual ~B () {} }; +struct C { virtual const A *foo (int) const = 0; }; +struct E : public B, public A { }; +struct F : public C +{ + virtual const E *foo (int) const; +}; +void bar (int &); + +const E * +F::foo (int x) const +{ + bar (x); + return __null; +}