tree-optimization/108868 - new testcase
authorRichard Biener <rguenther@suse.de>
Tue, 21 Feb 2023 09:32:10 +0000 (10:32 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 21 Feb 2023 09:33:16 +0000 (10:33 +0100)
New testcase for the fixed bug.

PR tree-optimization/108868
* gcc.dg/pr108868.c: New testcase.

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

diff --git a/gcc/testsuite/gcc.dg/pr108868.c b/gcc/testsuite/gcc.dg/pr108868.c
new file mode 100644 (file)
index 0000000..b6f1a79
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int x;
+int vfork (void) __attribute__((__leaf__, __returns_twice__));
+int fork (void);
+void bar (int, int, int *);
+
+void
+foo (void)
+{
+  int b = 0;
+  int r = x ? vfork () : fork ();
+  bar (r, x, &b);
+}
+
+/* { dg-final { scan-tree-dump "ABNORMAL_DISPATCHER" "optimized" } } */