From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 7BE1A3858D35 for ; Sat, 5 Mar 2022 08:34:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7BE1A3858D35 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-387-KhUMYkdWOYGaLAdHaGCwZA-1; Sat, 05 Mar 2022 03:34:03 -0500 X-MC-Unique: KhUMYkdWOYGaLAdHaGCwZA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 90DCC108088A; Sat, 5 Mar 2022 08:34:02 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 20ECE5ED38; Sat, 5 Mar 2022 08:34:01 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 2258Xx8W2772127 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sat, 5 Mar 2022 09:33:59 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 2258XwGL2772126; Sat, 5 Mar 2022 09:33:58 +0100 Date: Sat, 5 Mar 2022 09:33:58 +0100 From: Jakub Jelinek To: Andreas Krebbel Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] s390: Fix up *cmp_and_trap_unsigned_int constraints [PR104775] Message-ID: Reply-To: Jakub Jelinek MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Mar 2022 08:34:08 -0000 Hi! The following testcase fails to assemble due to clgte %r6,0(%r1,%r10) insn not being accepted by assembler. My rough understanding is that in the RSY-b insn format the spot in other formats used for index registers is used instead for M3 what kind of comparison it is, so this patch follows what other similar instructions use for constraint (i.e. one without index register). Bootstrapped on s390x-linux, regtest there still pending, ok for trunk if it passes it? 2022-03-05 Jakub Jelinek PR target/104775 * config/s390/s390.md (*cmp_and_trap_unsigned_int): Use S constraint instead of T in the last alternative. * gcc.target/s390/pr104775.c: New test. --- gcc/config/s390/s390.md.jj 2022-02-08 20:08:13.873404137 +0100 +++ gcc/config/s390/s390.md 2022-03-04 14:38:23.252988476 +0100 @@ -9578,7 +9578,7 @@ (define_insn "*cmp_and_trap_signed_int" [(trap_if (match_operator 0 "s390_unsigned_integer_comparison" [(match_operand:GPR 1 "register_operand" "d,d,d") - (match_operand:GPR 2 "general_operand" "d,D,T")]) + (match_operand:GPR 2 "general_operand" "d,D,S")]) (const_int 0))] "TARGET_Z10" "@ --- gcc/testsuite/gcc.target/s390/pr104775.c.jj 2022-03-04 14:49:58.190134898 +0100 +++ gcc/testsuite/gcc.target/s390/pr104775.c 2022-03-04 14:49:42.845352647 +0100 @@ -0,0 +1,14 @@ +/* PR target/104775 */ +/* { dg-do assemble { target s390_zEC12_hw } } */ +/* { dg-options "-O2 -march=zEC12" } */ + +long a[64]; +void bar (void); + +void +foo (int x, int y) +{ + if (x != a[y]) + bar (); + __builtin_trap (); +} Jakub