From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id 0C9B3385842F; Mon, 13 Sep 2021 13:27:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C9B3385842F Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/marxin/heads/loop-unswitching-switch-v3)] Update tests. X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/users/marxin/heads/loop-unswitching-switch-v3 X-Git-Oldrev: e4c0efae10083d5002303e95bfa818c39ebe3bc4 X-Git-Newrev: a340739c27c12ca41e30f7f4c9d346346f4a1e14 Message-Id: <20210913132714.0C9B3385842F@sourceware.org> Date: Mon, 13 Sep 2021 13:27:14 +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: Mon, 13 Sep 2021 13:27:14 -0000 https://gcc.gnu.org/g:a340739c27c12ca41e30f7f4c9d346346f4a1e14 commit a340739c27c12ca41e30f7f4c9d346346f4a1e14 Author: Martin Liska Date: Mon Sep 13 15:04:32 2021 +0200 Update tests. Diff: --- gcc/testsuite/gcc.dg/loop-unswitch-9.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/gcc/testsuite/gcc.dg/loop-unswitch-9.c b/gcc/testsuite/gcc.dg/loop-unswitch-9.c index 28b6e9669d5..3058d4a5b38 100644 --- a/gcc/testsuite/gcc.dg/loop-unswitch-9.c +++ b/gcc/testsuite/gcc.dg/loop-unswitch-9.c @@ -2,20 +2,25 @@ /* { dg-options "-O2 -funswitch-loops -fdump-tree-unswitch-details" } */ int -foo(double *a, double *b, double *c, double *d, double *r, int size, int order) +foo(double *a, double *b, double *c, double *d, double *r, int size, unsigned order) { for (int i = 0; i < size; i++) { double tmp; - if (order < 5) - tmp = -8 * a[i]; - else - tmp = -4 * b[i]; + switch (order) + { + case 0 ... 4: + tmp = -8 * a[i]; + break; + default: + tmp = -4 * b[i]; + break; + } double x = 3 * tmp + d[i] + tmp; - /* This should not be unswitched as it's mutually excluded with order < 5. */ + /* This should not be unswitched as it's mutually excluded with case 0 ... 4. */ if (order >= 5) x += 2; @@ -26,4 +31,4 @@ foo(double *a, double *b, double *c, double *d, double *r, int size, int order) return 0; } -/* { dg-final { scan-tree-dump-times ";; Unswitching loop with condition: order.* == 1" 1 "unswitch" } } */ +/* { dg-final { scan-tree-dump-times ";; Unswitching loop with condition: order.* <= 4" 1 "unswitch" } } */