From: Richard Biener Date: Mon, 27 Mar 2023 12:22:56 +0000 (+0200) Subject: tree-optimization/108357 - add testcase X-Git-Tag: basepoints/gcc-14~329 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ce4a00e29c71f2f51d52f407ecd265fa40688586;p=thirdparty%2Fgcc.git 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. --- 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 000000000000..44c457b7a977 --- /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" } } */