From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from server.nextmovesoftware.com (server.nextmovesoftware.com [162.254.253.69]) by sourceware.org (Postfix) with ESMTPS id 669703858D38 for ; Thu, 13 Aug 2020 08:28:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 669703858D38 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=nextmovesoftware.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=roger@nextmovesoftware.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nextmovesoftware.com; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=pJqaRUYtQRVVd7KYs55ln6uW6nOS4Q0fl1ilFEc/kbk=; b=KNj2UcXcBBhTVWgGx9yRSCaWLJ 1qbzXsUOpLkHj29CmmKzCkd3dygH/FKGw6nEnPu1rPFAhumk6HYyB1Kxn7fAZIlqpQQdIkoHhOfS/ 0pUO//0FkflQOEJu1CzXiO2vfpk1slBQrYWNzCoymkskeQ3+S5h2IWZUtee/f8TC2IUxxSg20VEJj ejjzfGOzm9uh9emSEnCGem62oXb+Xl0gVfQagk0WWhgYRyj63yzkB+G2do+Ug7gO/8sbqFDrn3cfA so4zGDfcTMzgvKfkiwYHs8+9T3VWBlDrlAmcj9akGOnpDJJteGCKy0O5bjwHpmdj4/BRuy3jCWxW+ nBGkWlCQ==; Received: from host86-137-89-56.range86-137.btcentralplus.com ([86.137.89.56]:49957 helo=Dell) by server.nextmovesoftware.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1k68bZ-0002vn-Pf; Thu, 13 Aug 2020 04:28:58 -0400 From: "Roger Sayle" To: "'GCC Patches'" Cc: "'Uros Bizjak'" Subject: [PATCH] Alternate fix to PR target/96558: Robustify ix86_expand_clear. Date: Thu, 13 Aug 2020 09:28:55 +0100 Message-ID: <00a701d6714b$c9703bf0$5c50b3d0$@nextmovesoftware.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdZxSzAAWersxCvdSTiwzKLq56ovvg== Content-Language: en-gb X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.nextmovesoftware.com X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - nextmovesoftware.com X-Get-Message-Sender-Via: server.nextmovesoftware.com: authenticated_id: roger@nextmovesoftware.com X-Authenticated-Sender: server.nextmovesoftware.com: roger@nextmovesoftware.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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-List-Received-Date: Thu, 13 Aug 2020 08:28:59 -0000 This patch is an alternate/supplementary fix to the recent regression PR target/96558. Currently ix86_expand_clear may/should only be called with a general register DEST after reload_completed. With the simple change below, this function now checks these conditions itself, and does the right thing (or at least something reasonable) rather than ICE. This change alone is sufficient to fix the recent regression, and allow the recently added testcase to pass, but following the "why fix something just once" maxim, I propose adding both solutions (to reduce the risk of surprises in the future). Leaving the peephole2 fix in place is reasonable, as scheduling or a later pass eventually move the condition code setter/use next to each other, so moving the vpxor with the peephole2 provides no (additional) benefit. i.e. gcc.dg/pr96558.c contains: vpxor %xmm0, %xmm0, %xmm0 testl %eax, %eax jne .L91 This patch has been tested on x86_64-pc-linux-gnu (without the peephole2 solution) with a make bootstrap and make -k check with no new failures, but allows the recently added testcase to pass. Ok for mainline? 2020-08-19 Roger Sayle gcc/ChangeLog PR target/96558 * config/i386/i386-expand.c (ix86_expand_clear): Explicitly test for reload_completed and GENERAL_REG_P, and emit a simple set of const0_rtx otherwise. Thanks in advance. Sorry for the inconvenience. Roger -- Roger Sayle NextMove Software Cambridge, UK