public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Andrew Macleod <amacleod@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-1798] Add a testcase to confirm the equivalence's are being checked by EVRP.
Date: Thu, 24 Jun 2021 20:02:30 +0000 (GMT)	[thread overview]
Message-ID: <20210624200230.A193A39B3C7A@sourceware.org> (raw)

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"} } */
+


                 reply	other threads:[~2021-06-24 20:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210624200230.A193A39B3C7A@sourceware.org \
    --to=amacleod@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).