aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2015-02-11 16:09:48 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2015-02-11 16:09:48 +0100
commit3292dd408163da24f70fb93e962d0b9cdf20f74a (patch)
treee5f86c81bfe3b01ac68e6e8a3ea54b48e9ba6241
parentce888a99a964f06c912b90dd75a55b79f93c86cd (diff)
downloadgcc-3292dd408163da24f70fb93e962d0b9cdf20f74a.zip
gcc-3292dd408163da24f70fb93e962d0b9cdf20f74a.tar.gz
gcc-3292dd408163da24f70fb93e962d0b9cdf20f74a.tar.bz2
re PR middle-end/65003 (-fsection-anchors ICE)
PR middle-end/65003 * varasm.c (place_block_symbol): Assert that DECL_RTL of the ultimate alias is MEM with SYMBOL_REF satisfying SYMBOL_REF_HAS_BLOCK_INFO_P as its operand. Don't pass the MEM to place_block_symbol, but instead pass the SYMBOL_REF operand of it. * g++.dg/opt/pr65003.C: New test. From-SVN: r220625
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/opt/pr65003.C31
-rw-r--r--gcc/varasm.c4
4 files changed, 48 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 482b128..0f05ee4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2015-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/65003
+ * varasm.c (place_block_symbol): Assert that DECL_RTL of the
+ ultimate alias is MEM with SYMBOL_REF satisfying
+ SYMBOL_REF_HAS_BLOCK_INFO_P as its operand. Don't pass the MEM
+ to place_block_symbol, but instead pass the SYMBOL_REF operand of it.
+
2015-02-11 Thomas Schwinge <thomas@codesourcery.com>
* config/nvptx/mkoffload.c: Include "diagnostic.h" instead of
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index bd508ec..0cdaf45 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/65003
+ * g++.dg/opt/pr65003.C: New test.
+
2015-02-11 H.J. Lu <hongjiu.lu@intel.com>
* lib/target-supports.exp (check_effective_target_pie): Renamed
diff --git a/gcc/testsuite/g++.dg/opt/pr65003.C b/gcc/testsuite/g++.dg/opt/pr65003.C
new file mode 100644
index 0000000..5d131af
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr65003.C
@@ -0,0 +1,31 @@
+// PR middle-end/65003
+// { dg-do compile }
+// { dg-options "-O2" }
+// { dg-additional-options "-fpic" { target fpic } }
+
+struct A
+{
+ void operator= (A &);
+ A ();
+};
+struct B
+{
+ A b;
+};
+struct C
+{
+ virtual bool foo (int &, bool) const;
+};
+struct D : virtual C
+{
+ bool foo (int &, bool) const;
+ B e;
+};
+struct F : D
+{
+ F (int &, const int &, const A &);
+ bool foo (int &, bool) const;
+};
+bool D::foo (int &, bool) const {}
+F::F (int &, const int &, const A &) {}
+bool F::foo (int &, bool) const {}
diff --git a/gcc/varasm.c b/gcc/varasm.c
index eb65b1f..3f62fca 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -7180,6 +7180,10 @@ place_block_symbol (rtx symbol)
{
rtx target = DECL_RTL (snode->ultimate_alias_target ()->decl);
+ gcc_assert (MEM_P (target)
+ && GET_CODE (XEXP (target, 0)) == SYMBOL_REF
+ && SYMBOL_REF_HAS_BLOCK_INFO_P (XEXP (target, 0)));
+ target = XEXP (target, 0);
place_block_symbol (target);
SYMBOL_REF_BLOCK_OFFSET (symbol) = SYMBOL_REF_BLOCK_OFFSET (target);
return;