diff mbox series

tree-optimization/99793 - testcase for the PR

Message ID 9r7p216-6np0-o249-9pp2-p83p87734o11@fhfr.qr
State New
Headers show
Series tree-optimization/99793 - testcase for the PR | expand

Commit Message

Richard Biener Sept. 28, 2021, 10:50 a.m. UTC
This adds a testcase for the PR which was fixed with the fix for
PR100112.

Tested on x86_64-unknown-linux-gnu, pushed.

2021-09-28  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/99793
	* gcc.dg/tree-ssa/pr99793.c: New testcase.
---
 gcc/testsuite/gcc.dg/tree-ssa/pr99793.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr99793.c
diff mbox series

Patch

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 00000000000..912744928e5
--- /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" } } */