From patchwork Wed May 27 04:22:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2 via Gcc-patches" X-Patchwork-Id: 1298584 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=r1dKXk/o; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49WyNp07YNz9sPF for ; Wed, 27 May 2020 14:22:47 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 926C5386F81C; Wed, 27 May 2020 04:22:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 926C5386F81C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1590553363; bh=Yg8NMmsOLIsIwiJubews+kBIngJlvuYipkGcso8B8vc=; h=Subject:To:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=r1dKXk/oTRqcT03Xie1VeckyprkpfUI0gRF3v4uxtByX1vz2hS8oNWZmBltwlppa5 UoZBDCBxWoIyux970BMYo6ho090YZoB+Y3w5FjEUUhtHewCfzTu3OcjObSvg9jPpM+ bwbvPJG/CE6S/lms5ltEwUfi61BJgdUpxOysfHfU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by sourceware.org (Postfix) with ESMTP id E35883851C2F for ; Wed, 27 May 2020 04:22:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E35883851C2F Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-200-_EJn-5d9M3u54oMi5ZSc5A-1; Wed, 27 May 2020 00:22:37 -0400 X-MC-Unique: _EJn-5d9M3u54oMi5ZSc5A-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0C53B80B712 for ; Wed, 27 May 2020 04:22:37 +0000 (UTC) Received: from ovpn-113-248.phx2.redhat.com (ovpn-113-248.phx2.redhat.com [10.3.113.248]) by smtp.corp.redhat.com (Postfix) with ESMTP id D721560C05 for ; Wed, 27 May 2020 04:22:36 +0000 (UTC) Message-ID: <1cde41880e018e2a31aafa6980ad175081b67206.camel@redhat.com> Subject: [committed] Fix pr20601-1.c on the H8 To: gcc-patches List Date: Tue, 26 May 2020 22:22:36 -0600 Organization: Red Hat User-Agent: Evolution 3.36.2 (3.36.2-1.fc32) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-Patchwork-Original-From: Jeff Law via Gcc-patches From: "Li, Pan2 via Gcc-patches" Reply-To: law@redhat.com Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" This is a codegen fix for the H8 that I debugged while working on the cc0 conversion. In simplest terms we're accepting things like (const_int 0) as the source of a zero_extract and it ultimately interacts badly with register reloading. One might argue this is combine's fault for not simplifying the extraction, but it's really wrong for the pattern to accept something that we simply can't handle correctly, ever. THere isn't a great predicate for this, so we just reject the constants in the condition. Pushed to the trunk, without having to commit a ChangeLog entry! :-) Jeff commit bc48456d085d4ab8be92cf5369624dd86317cecb Author: Jeff Law Date: Tue May 26 22:14:40 2020 -0600 Fix pr20601-1.c on the H8 gcc/ * config/h8300/testcompare.md (tst_extzv_1_n): Do not accept constants for the primary input operand. (tstsi_variable_bit_qi): Similarly. diff --git a/gcc/config/h8300/testcompare.md b/gcc/config/h8300/testcompare.md index 2e4cb5afee7..118db145a8a 100644 --- a/gcc/config/h8300/testcompare.md +++ b/gcc/config/h8300/testcompare.md @@ -9,7 +9,7 @@ (match_operand 1 "const_int_operand" "n,n,n")) (const_int 0))) (clobber (match_scratch:QI 2 "=X,X,&r"))] - "" + "!CONSTANT_P (operands[0])" "@ btst\\t%Z1,%Y0 btst\\t%Z1,%Y0 @@ -82,7 +82,7 @@ (const_int 7))) (const_int 0))) (clobber (match_scratch:QI 2 "=X,X,&r"))] - "" + "!CONSTANT_P (operands[0])" "@ btst\\t%w1,%X0 btst\\t%w1,%X0