public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-1798] Add a testcase to confirm the equivalence's are being checked by EVRP.
@ 2021-06-24 20:02 Andrew Macleod
  0 siblings, 0 replies; only message in thread
From: Andrew Macleod @ 2021-06-24 20:02 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:ce3316e9c02c81c509173572c71a101f4eb62a24

commit r12-1798-gce3316e9c02c81c509173572c71a101f4eb62a24
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Thu Jun 24 13:49:51 2021 -0400

    Add a testcase to confirm the equivalence's are being checked by EVRP.
    
            * gcc.dg/tree-ssa/evrp30.c: New.

Diff:
---
 gcc/testsuite/gcc.dg/tree-ssa/evrp30.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/evrp30.c b/gcc/testsuite/gcc.dg/tree-ssa/evrp30.c
new file mode 100644
index 00000000000..2c5ff41ecd9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/evrp30.c
@@ -0,0 +1,16 @@
+/* Confirm the ranger is picking up a relationship with equivalences.  */
+/* { dg-do compile } */
+/* { dg-options "-O2  -fdump-tree-evrp" } */
+
+extern void foo ();
+
+void f (unsigned int a, unsigned int b)
+{
+  if (a == b)
+    for (unsigned i = 0; i < a; i++)
+      if (i == b)   // Confirm  i < a also means i < b.
+	foo (); /* Unreachable */
+}
+
+/* { dg-final { scan-tree-dump-times "foo\\(" 0 "evrp"} } */
+


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-24 20:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-24 20:02 [gcc r12-1798] Add a testcase to confirm the equivalence's are being checked by EVRP Andrew Macleod

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).