diff options
author | Duncan Sands <baldrick@free.fr> | 2011-05-31 07:03:53 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2011-05-31 07:03:53 +0000 |
commit | 7a3b04388e1e0fb8c79f5771dad7c55fd62034f7 (patch) | |
tree | 9727f8efa3649200306e8052490ac65297ea767d | |
parent | e99b9c8c31d341e604d00f8aef272ba405028f41 (diff) |
Backport the fix for PR47714 from the 4.6 branch.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_5-branch@174467 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/method.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/torture/pr47714.C | 16 |
4 files changed, 33 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index fddbf6de778..01332373aca 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2011-05-31 Duncan Sands <baldrick@free.fr> + + Backported from 4.6 branch + 2011-03-09 Martin Jambor <mjambor@suse.cz> + + PR tree-optimization/47714 + * method.c (use_thunk): Clear addressable flag of thunk arguments. + 2011-05-20 Jason Merrill <jason@redhat.com> PR c++/48873 diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 5ed98bc93bd..088c9e7c1db 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 7d23efe0769..5008295ba8d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2011-05-31 Duncan Sands <baldrick@free.fr> + + Backported from 4.6 branch + 2011-03-09 Martin Jambor <mjambor@suse.cz> + + PR tree-optimization/47714 + * g++.dg/torture/pr47714.C: New test. + 2011-05-29 Richard Sandiford <rdsandiford@googlemail.com> * 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 00000000000..4ff2eeef0a4 --- /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; +} |