]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport the fix for PR47714 from the 4.6 branch.
authorDuncan Sands <baldrick@free.fr>
Tue, 31 May 2011 07:03:53 +0000 (09:03 +0200)
committerDuncan Sands <baldrick@gcc.gnu.org>
Tue, 31 May 2011 07:03:53 +0000 (07:03 +0000)
From-SVN: r174467

gcc/cp/ChangeLog
gcc/cp/method.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr47714.C [new file with mode: 0644]

index fddbf6de778f24d29469493234071c4f5501b6d4..01332373acaec29f2682919e08da3fe72e34c98b 100644 (file)
@@ -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
index 5ed98bc93bd40ece99c212742c42673cd8439464..088c9e7c1dbeb825225d4d4e6405bfcfa47e2ff1 100644 (file)
@@ -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);
index 7d23efe076913d931d2a5e1a770c620949285459..5008295ba8dbe48a767ed82a58300bcd0de38efe 100644 (file)
@@ -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 (file)
index 0000000..4ff2eee
--- /dev/null
@@ -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;
+}