]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add the testcase for this PR to the testsuite.
authorAndrew MacLeod <amacleod@redhat.com>
Thu, 25 Nov 2021 13:58:19 +0000 (08:58 -0500)
committerAndrew MacLeod <amacleod@redhat.com>
Thu, 25 Nov 2021 14:02:28 +0000 (09:02 -0500)
Various ranger-enabled patches like threading and VRP2 can do this now, so add the testcase for posterity.

gcc/testsuite/
PR tree-optimization/102648
* gcc.dg/pr102648.c: New.

gcc/testsuite/gcc.dg/pr102648.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/pr102648.c b/gcc/testsuite/gcc.dg/pr102648.c
new file mode 100644 (file)
index 0000000..a0f6386
--- /dev/null
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+void foo();
+static char a, c;
+static int d, e;
+static short b(short f, short g) { return f * g; }
+int main() {
+  short h = 4;
+  for (; d;)
+    if (h)
+      if(e) {
+        if (!b(a & 1 | h, 3))
+          c = 0;
+        h = 1;
+      }
+  if (c)
+    foo();
+}
+
+/* { dg-final { scan-tree-dump-not "foo" "optimized" } } */