From patchwork Fri Feb 16 13:53:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 874432 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-473411-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="iHxyeeRB"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zjZPQ2t0Yz9t3v for ; Sat, 17 Feb 2018 00:54:01 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=Zz18RRZGdFY2 6qS/ORIXzanb+ORGs9J3Qi6J2XDS2COgAkQI1u5qO/avRQnIdOTMWXwfsjNiGLIr 3zMxebGTwYwT9YsHYBCHnUi6hdIWrSTcTr3hYpBBof4AGiZwhih0lsVBtvuW/KXY z1xmrLzqf9NjWKc0lx+TUU11sL3IZXk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; s=default; bh=HO1hMq0JHzSOSaf/5F 8ZVQSMDGg=; b=iHxyeeRBRjIJAaYlIbSPCq1NMptspj9YWFAYimqdgYLGbwUwzX su8OOMvdoMGUoY+QcWLs8O2pEkAQwXQd8cXXhQhGj/B/E6w2u/DDT4etaLAPAJHs LI+WeAYIRCi/ciaz+MvS49xuMoe2heS6U8IrQ9ET0XDIz4uQSFQvKIIfs= Received: (qmail 124193 invoked by alias); 16 Feb 2018 13:53:55 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 123564 invoked by uid 89); 16 Feb 2018 13:53:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: gcc1-power7.osuosl.org Received: from gcc1-power7.osuosl.org (HELO gcc1-power7.osuosl.org) (140.211.15.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Feb 2018 13:53:51 +0000 Received: by gcc1-power7.osuosl.org (Postfix, from userid 10019) id 6B40B1240307; Fri, 16 Feb 2018 13:53:50 +0000 (UTC) From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: jakub@redhat.com, Segher Boessenkool Subject: [PATCH] combine: Fix problem with RTL checking Date: Fri, 16 Feb 2018 13:53:47 +0000 Message-Id: <3a6b06fcc73987f8a544b13a382aad21df2d097e.1518737408.git.segher@kernel.crashing.org> X-IsSubscribed: yes As Jakub found, after my recent combine patch at least on x86 problems show up with RTL checking enabled. This is because the I2 generated by a successful instruction combination can write not only a register but it can also write a paradoxical subreg of one. This fixes it. Tested on powerpc64-linux {-m64,-m32} and on x86_64-linux {-m64,-m32}, with --enable-checking=yes,rtl. Committing it now. Segher 2018-02-16 Segher Boessenkool * combine.c (try_combine): When adjusting LOG_LINKS for the destination that moved to I2, also allow destinations that are a paradoxical subreg (instead of a normal reg). --- gcc/combine.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/combine.c b/gcc/combine.c index c386f3a..cd4aaa4 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -4379,7 +4379,12 @@ if (GET_CODE (x) == PARALLEL) x = XVECEXP (newi2pat, 0, 0); - unsigned int regno = REGNO (SET_DEST (x)); + /* It can only be a SET of a REG or of a paradoxical SUBREG of a REG. */ + x = SET_DEST (x); + if (paradoxical_subreg_p (x)) + x = SUBREG_REG (x); + + unsigned int regno = REGNO (x); bool done = false; for (rtx_insn *insn = NEXT_INSN (i3);