From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2053) id 0EFD5383D02D; Wed, 2 Jun 2021 10:01:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0EFD5383D02D MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-1159] IBM Z: Remove match_scratch workaround X-Act-Checkin: gcc X-Git-Author: Ilya Leoshkevich X-Git-Refname: refs/heads/master X-Git-Oldrev: 9ca24bd34b6ac44c17f949d89ff60d0fd4665133 X-Git-Newrev: 22d834e32b509b22f68000b7f012d8e45d833ea8 Message-Id: <20210602100118.0EFD5383D02D@sourceware.org> Date: Wed, 2 Jun 2021 10:01:18 +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: Wed, 02 Jun 2021 10:01:18 -0000 https://gcc.gnu.org/g:22d834e32b509b22f68000b7f012d8e45d833ea8 commit r12-1159-g22d834e32b509b22f68000b7f012d8e45d833ea8 Author: Ilya Leoshkevich Date: Mon May 31 21:59:50 2021 +0200 IBM Z: Remove match_scratch workaround Since commit dd1ef00c45ba ("Fix bug in the define_subst handling that made match_scratch unusable for multi-alternative patterns.") the workaround for that bug in *ashrdi3_31 is not only no longer necessary, but actually breaks the build. Get rid of it by using only one alternative in (match_scratch). It will be replicated as many times as needed in order to match the pattern with which (define_subst) is used. gcc/ChangeLog: * config/s390/s390.md(*ashrdi3_31): Use a single constraint. * config/s390/subst.md(cconly_subst): Use a single constraint in (match_scratch). gcc/testsuite/ChangeLog: * gcc.target/s390/ashr.c: New test. Diff: --- gcc/config/s390/s390.md | 14 ++++---------- gcc/config/s390/subst.md | 2 +- gcc/testsuite/gcc.target/s390/ashr.c | 11 +++++++++++ 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 7faf775fbf2..0c5b4dc9029 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -9328,19 +9328,13 @@ "" "") -; FIXME: The number of alternatives is doubled here to match the fix -; number of 2 in the subst pattern for the (clobber (match_scratch... -; The right fix should be to support match_scratch in the output -; pattern of a define_subst. (define_insn "*ashrdi3_31" - [(set (match_operand:DI 0 "register_operand" "=d, d") - (ashiftrt:DI (match_operand:DI 1 "register_operand" "0, 0") - (match_operand:QI 2 "shift_count_operand" "jsc,jsc"))) + [(set (match_operand:DI 0 "register_operand" "=d") + (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") + (match_operand:QI 2 "shift_count_operand" "jsc"))) (clobber (reg:CC CC_REGNUM))] "!TARGET_ZARCH" - "@ - srda\t%0,%Y2 - srda\t%0,%Y2" + "srda\t%0,%Y2" [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) diff --git a/gcc/config/s390/subst.md b/gcc/config/s390/subst.md index 384af11c198..3ea6fc40ba8 100644 --- a/gcc/config/s390/subst.md +++ b/gcc/config/s390/subst.md @@ -45,7 +45,7 @@ "s390_match_ccmode(insn, CCSmode)" [(set (reg CC_REGNUM) (compare (match_dup 1) (const_int 0))) - (clobber (match_scratch:DSI 0 "=d,d"))]) + (clobber (match_scratch:DSI 0 "=d"))]) (define_subst_attr "cconly" "cconly_subst" "" "_cconly") diff --git a/gcc/testsuite/gcc.target/s390/ashr.c b/gcc/testsuite/gcc.target/s390/ashr.c new file mode 100644 index 00000000000..8cffdfa9a1d --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/ashr.c @@ -0,0 +1,11 @@ +/* Test the arithmetic shift right pattern. */ + +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int e(void); + +int f (long c, int b) +{ + return (c >> b) && e (); +}