]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix for PR64068 and PR64559.
authorMartin Liska <marxin@gcc.gnu.org>
Thu, 15 Jan 2015 17:29:23 +0000 (17:29 +0000)
committerMartin Liska <marxin@gcc.gnu.org>
Thu, 15 Jan 2015 17:29:23 +0000 (17:29 +0000)
* g++.dg/ipa/pr64068.C: New test.
* gcc.dg/ipa/PR64559.c: New test.
PR ipa/64068
PR ipa/64559
* ipa.c (symbol_table::remove_unreachable_nodes):
Do not put abstract origins into boundary.

From-SVN: r219672

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

index 2063fd54a6b7e57031db8ee5a60435a9791ac99f..2d5974b3d006e27b8619242bb53548e364e199cd 100644 (file)
@@ -1,3 +1,10 @@
+2015-01-15  Jan Hubicka  <hubicka@ucw.cz>
+
+       PR ipa/64068
+       PR ipa/64559
+       * ipa.c (symbol_table::remove_unreachable_nodes):
+       Do not put abstract origins into boundary.
+
 2015-01-15  Evgeny Stupachenko  <evstupac@gmail.com>
 
        * config/i386/gnu-user.h (CRT_GET_RFIB_DATA): Remove EBX register usage.
index df96515140f0ac500d526158ec589acafbfbd5d8..36264175f57509cddfcb9c5a8ec0c6041da48f12 100644 (file)
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -400,7 +400,6 @@ symbol_table::remove_unreachable_nodes (FILE *file)
                       n = n->next_sibling_clone)
                    if (n->decl == DECL_ABSTRACT_ORIGIN (node->decl))
                      n->used_as_abstract_origin = true;
-                 enqueue_node (origin_node, &first, &reachable);
                }
            }
          /* If any symbol in a comdat group is reachable, force
index 873391451b2dfb72c9adb54bcbb35f2bd2f56c16..a1235f350737b6b3ce9cba5835e55f1bdc99449c 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-15  Martin Liska  <mliska@suse.cz>
+
+       * g++.dg/ipa/pr64068.C: New test.
+       * gcc.dg/ipa/PR64559.c: New test.
+
 2015-01-15  H.J. Lu  <hongjiu.lu@intel.com>
 
        * g++.dg/other/anon5.C: Ignore additional messages on Linux/x86
diff --git a/gcc/testsuite/g++.dg/ipa/pr64068.C b/gcc/testsuite/g++.dg/ipa/pr64068.C
new file mode 100644 (file)
index 0000000..9528883
--- /dev/null
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef int PROV_ENUMALGS_EX, PCCRYPT_OID_INFO;
+class A {
+  int m_fn2();
+  virtual bool m_fn1(PCCRYPT_OID_INFO);
+};
+int fn1();
+void fn2();
+int A::m_fn2() { m_fn1(0); }
+
+bool fn3() {
+  for (;;) {
+    if (fn1()) {
+      if (fn1() != 259)
+        fn2();
+      break;
+    }
+    return 1;
+  }
+  return 0;
+}
+
+class B {
+public:
+  B() { fn3(); }
+};
+class C : A {
+  bool m_fn1(PCCRYPT_OID_INFO) { m_fn3(); }
+  int isSupportedByProvider_algId;
+  PROV_ENUMALGS_EX isSupportedByProvider_outEnumAlgs;
+  PROV_ENUMALGS_EX isSupportedByProvider_enumAlgs;
+  bool m_fn3() {
+    while (1) {
+      if (fn1()) {
+        if (fn1() != 259)
+          fn2();
+        break;
+      }
+      if (isSupportedByProvider_algId)
+        isSupportedByProvider_outEnumAlgs = isSupportedByProvider_enumAlgs;
+      return 1;
+    }
+    return 0;
+  }
+};
+
+void fn4() { B(); }
diff --git a/gcc/testsuite/gcc.dg/ipa/PR64559.c b/gcc/testsuite/gcc.dg/ipa/PR64559.c
new file mode 100644 (file)
index 0000000..463afdc
--- /dev/null
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-Os"  } */
+
+int a, b, c, d;
+
+struct S
+{
+  int f0;
+};
+
+static int
+fn1 (int p)
+{
+  return p == 0 || a;
+}
+
+static int
+fn2 ()
+{
+  d = fn1 (c);
+  return 0;
+}
+
+static int
+fn3 (struct S p)
+{
+  p.f0 || fn2 ();
+  if (fn1 (1))
+    b = 0;
+  return 0;
+}
+
+int
+main ()
+{
+  struct S e = { 1 };
+  fn3 (e);
+  return 0;
+}