aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-03-27 14:22:56 +0200
committerRichard Biener <rguenther@suse.de>2023-03-27 14:24:01 +0200
commitce4a00e29c71f2f51d52f407ecd265fa40688586 (patch)
tree145d2263e74c01bc44ef560874433185808f7b55
parent9da6f93144619b0f798c2b43d7cf4fc8d42c13a0 (diff)
downloadgcc-ce4a00e29c71f2f51d52f407ecd265fa40688586.zip
gcc-ce4a00e29c71f2f51d52f407ecd265fa40688586.tar.gz
gcc-ce4a00e29c71f2f51d52f407ecd265fa40688586.tar.bz2
tree-optimization/108357 - add testcase
The following adds the testcase for the bug which was recently fixed. PR tree-optimization/108357 * gcc.dg/tree-ssa/pr108357.c: New testcase.
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr108357.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr108357.c b/gcc/testsuite/gcc.dg/tree-ssa/pr108357.c
new file mode 100644
index 0000000..44c457b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr108357.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-threadfull1" } */
+
+static char b;
+static unsigned c;
+void foo();
+short(a)(short d, short e) { return d * e; }
+static short f(short d) {
+ b = 0;
+ if ((d && 0 >= c < d) ^ d)
+ ;
+ else
+ foo();
+ return d;
+}
+int main()
+{
+ short g = a(5, b ^ 9854);
+ f(g);
+}
+
+/* { dg-final { scan-tree-dump-not "foo" "threadfull1" } } */