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

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

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

From-SVN: r208844

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

index 0e607cc06effbf03f966f3b4841f50cb66a2c65c..63a6c9874b51ba6517b48eb93266c29a434c7ae5 100644 (file)
@@ -1,3 +1,9 @@
+2014-03-26  Martin Jambor  <mjambor@suse.cz>
+
+      PR ipa/60419
+      * ipa.c (symtab_remove_unreachable_nodes): Clear thunk and
+      alias flags of nodes in the border.
+
 2014-03-26  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR rtl-optimization/60452
index a9b8fb419882c04bda8417a0553636bdc05db705..d73d105a0c49840d73d059ded8f9749e6fe75499 100644 (file)
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -359,6 +359,8 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
            {
              if (file)
                fprintf (file, " %s", cgraph_node_name (node));
+             node->alias = false;
+             node->thunk.thunk_p = false;
              cgraph_node_remove_callees (node);
              ipa_remove_all_references (&node->symbol.ref_list);
              changed = true;
index 5a8897abf00422ba6c37bc72cc5701964b50365d..2e94ac6a7a370beb683247ffe692e0b158263290 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-26  Martin Jambor  <mjambor@suse.cz>
+
+      PR ipa/60419
+      * g++.dg/ipa/pr60419.C: New test.
+
 2014-03-26  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc.c-torture/execute/20140326-1.c: New test.
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 ();
+}