From: Richard Biener Date: Tue, 28 Sep 2021 10:48:50 +0000 (+0200) Subject: tree-optimization/99793 - testcase for the PR X-Git-Tag: upstream/12.2.0~4778 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=34b1e44e166c58df20a15cb35b6cc8d4d299d415;p=platform%2Fupstream%2Fgcc.git tree-optimization/99793 - testcase for the PR This adds a testcase for the PR which was fixed with the fix for PR100112. 2021-09-28 Richard Biener PR tree-optimization/99793 * gcc.dg/tree-ssa/pr99793.c: New testcase. --- diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr99793.c b/gcc/testsuite/gcc.dg/tree-ssa/pr99793.c new file mode 100644 index 0000000..9127449 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr99793.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fstrict-aliasing -fdump-tree-optimized" } */ + +extern void foo(void); +static int a, *b = &a, c, *d = &c; +int main() +{ + int **e = &d; + if (!((unsigned)((*e = d) == 0) - (*b = 1))) + foo(); + return 0; +} + +/* { dg-final { scan-tree-dump-not "foo" "optimized" } } */