diff gcc/testsuite/g++.dg/opt/pr59647.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/g++.dg/opt/pr59647.C	Fri Oct 27 22:46:09 2017 +0900
@@ -0,0 +1,32 @@
+// PR rtl-optimization/59647
+// { dg-do compile }
+// { dg-options "-O2 -fno-tree-vrp" }
+// { dg-additional-options "-msse2 -mfpmath=sse" { target { { i?86-*-* x86_64-*-* } && ia32 } } }
+
+void f1 (int);
+void f2 ();
+double f3 (int);
+
+struct A
+{
+  int f4 () const
+  {
+    if (a == 0)
+      return 1;
+    return 0;
+  }
+  unsigned f5 ()
+  {
+    if (!f4 ())
+      f2 ();
+    return a;
+  }
+  int a;
+};
+
+void
+f6 (A *x)
+{
+  unsigned b = x->f5 ();
+  f1 (b - 1 - f3 (x->f5 () - 1U));
+}