From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1011) id A193A39B3C7A; Thu, 24 Jun 2021 20:02:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A193A39B3C7A MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Andrew Macleod To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-1798] Add a testcase to confirm the equivalence's are being checked by EVRP. X-Act-Checkin: gcc X-Git-Author: Andrew MacLeod X-Git-Refname: refs/heads/master X-Git-Oldrev: a0accaa99844b0c40661202635859f8c0be76cdd X-Git-Newrev: ce3316e9c02c81c509173572c71a101f4eb62a24 Message-Id: <20210624200230.A193A39B3C7A@sourceware.org> Date: Thu, 24 Jun 2021 20:02:30 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2021 20:02:30 -0000 https://gcc.gnu.org/g:ce3316e9c02c81c509173572c71a101f4eb62a24 commit r12-1798-gce3316e9c02c81c509173572c71a101f4eb62a24 Author: Andrew MacLeod 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"} } */ +