]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/60419 (ICE Segmentation fault)
authorMartin Jambor <mjambor@suse.cz>
Fri, 21 Mar 2014 12:48:02 +0000 (13:48 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Fri, 21 Mar 2014 12:48:02 +0000 (13:48 +0100)
2014-03-21  Martin Jambor  <mjambor@suse.cz>

PR ipa/60419
* ipa.c (symtab_remove_unreachable_nodes): Clear thunk flag of nodes
in the border.

testsuite/
* g++.dg/ipa/pr60419.C: New test.

From-SVN: r208747

gcc/ChangeLog
gcc/ipa.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ipa/pr60419.C [new file with mode: 0644]

index be0c8c484474c761502eb40838825a6f533b0801..c56a5b7df52588e5b95c78c57d16a4150b417560 100644 (file)
@@ -1,3 +1,9 @@
+2014-03-21  Martin Jambor  <mjambor@suse.cz>
+
+       PR ipa/60419
+       * ipa.c (symtab_remove_unreachable_nodes): Clear thunk flag of nodes
+       in the border.
+
 2014-03-21  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/60577
index 572dba182685052babec7210e37af3d00fa21464..164de0dc9dfe273c45ce411bafad86f0bdb15f7d 100644 (file)
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -488,6 +488,7 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
              node->definition = false;
              node->cpp_implicit_alias = false;
              node->alias = false;
+             node->thunk.thunk_p = false;
              node->weakref = false;
              if (!node->in_other_partition)
                node->local.local = false;
index aac3dc95c67b03931d933f0e56040339b98408d5..581efab5981227632823d2960ca10b8f3791f4c6 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-21  Martin Jambor  <mjambor@suse.cz>
+
+       PR ipa/60419
+       * g++.dg/ipa/pr60419.C: New test.
+
 2014-03-21  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/60577
diff --git a/gcc/testsuite/g++.dg/ipa/pr60419.C b/gcc/testsuite/g++.dg/ipa/pr60419.C
new file mode 100644 (file)
index 0000000..84461f3
--- /dev/null
@@ -0,0 +1,80 @@
+// PR middle-end/60419
+// { dg-do compile }
+// { dg-options "-O2" }
+
+struct C
+{
+};
+
+struct I : C
+{
+  I ();
+};
+
+struct J
+{
+  void foo ();
+  J ();
+  virtual void foo (int &, int);
+};
+
+template <class>
+struct D
+{
+  virtual void foo (I &) const;
+  void bar ()
+  {
+    I p;
+    foo (p);
+  }
+};
+
+struct K : J, public D<int>
+{
+};
+
+struct F
+{
+  K *operator->();
+};
+
+struct N : public K
+{
+  void foo (int &, int);
+  I n;
+  void foo (I &) const {}
+};
+
+struct L : J
+{
+  F l;
+};
+
+struct M : F
+{
+  L *operator->();
+};
+
+struct G
+{
+  G ();
+};
+
+M h;
+
+G::G ()
+try
+{
+  N f;
+  f.bar ();
+  throw;
+}
+catch (int)
+{
+}
+
+void
+baz ()
+{
+  h->l->bar ();
+}