public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6182] tree-optimization/66502 - add testcase
@ 2022-01-03 9:50 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-01-03 9:50 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:cd83fd98a7e769ac7ded28377984f68238812a26
commit r12-6182-gcd83fd98a7e769ac7ded28377984f68238812a26
Author: Richard Biener <rguenther@suse.de>
Date: Mon Jan 3 10:48:57 2022 +0100
tree-optimization/66502 - add testcase
This adds the second testcase which we now also handle eliminating
a redundant PHI node.
2022-01-03 Richard Biener <rguenther@suse.de>
PR tree-optimization/66502
* gcc.dg/tree-ssa/ssa-fre-98.c: New testcase.
Diff:
---
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-98.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-98.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-98.c
new file mode 100644
index 00000000000..3d286099b25
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-98.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fre1-details" } */
+
+int foo (int a, int s, unsigned int k)
+{
+ int i = a, j = a;
+ do
+ {
+ i += s;
+ j += j;
+ j -= a;
+ }
+ while (k--);
+ return j+i;
+}
+
+/* We want the redundant PHI for j to disappear. */
+/* { dg-final { scan-tree-dump "Replaced redundant PHI node defining j" "fre1" } } */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-03 9:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-03 9:50 [gcc r12-6182] tree-optimization/66502 - add testcase Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).