aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2021-06-24 13:49:51 -0400
committerAndrew MacLeod <amacleod@redhat.com>2021-06-24 16:01:54 -0400
commitce3316e9c02c81c509173572c71a101f4eb62a24 (patch)
treecc7f29823150c5a1af4809eea73be17c94c5063f /gcc
parenta0accaa99844b0c40661202635859f8c0be76cdd (diff)
downloadgcc-ce3316e9c02c81c509173572c71a101f4eb62a24.zip
gcc-ce3316e9c02c81c509173572c71a101f4eb62a24.tar.gz
gcc-ce3316e9c02c81c509173572c71a101f4eb62a24.tar.bz2
Add a testcase to confirm the equivalence's are being checked by EVRP.
* gcc.dg/tree-ssa/evrp30.c: New.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/evrp30.c16
1 files changed, 16 insertions, 0 deletions
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 0000000..2c5ff41
--- /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"} } */
+