From patchwork Wed Sep 19 17:35:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 971826 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-485977-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="faPqLK6P"; 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 42Fn7b6tpwz9sLt for ; Thu, 20 Sep 2018 03:35:20 +1000 (AEST) 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=Q8TP3fU+5WKy OsRVJzUAXstSTXLW91/2GJa6B8zi8AkAbpEdGSRXcdz4wFmb5uKzTT4QYOXqvA4K B7L6XGt9k5RzhHCu6nXIUsteF509MPg4Xgvdi6DDKLXIVQsjR5U/e6SLmsUJelV+ IRNgi0KZWLWw78vUWtR0hOQGyRlnfM0= 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=K+8QglZKN4McB58w8S DgiJWxPgA=; b=faPqLK6PiJ2Cr0BIPEYVASavt/TD6/0TasBuavzLQG7PNpdXxz hBEBf+97qFVKAXaqFpx5+fj5GHCBhQYmFoJFafwaN0+PmNCC5AxXOMAI+d5nJCsY 85FUMvBLpXI1gRkSKVuB3Aq4GZxuRlWMPHkyNQZyOMmPeoePab6pyuaIU= Received: (qmail 62280 invoked by alias); 19 Sep 2018 17:35:13 -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 62269 invoked by uid 89); 19 Sep 2018 17:35:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=rtx_insn 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; Wed, 19 Sep 2018 17:35:11 +0000 Received: by gcc1-power7.osuosl.org (Postfix, from userid 10019) id 349C012404C1; Wed, 19 Sep 2018 17:35:09 +0000 (UTC) From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool Subject: [PATCH] combine: Use correct mode in new comparison (PR86902) Date: Wed, 19 Sep 2018 17:35:07 +0000 Message-Id: X-IsSubscribed: yes This code in try_combine uses the wrong mode. This fails (with RTL checking) in trunk, but not in any released branches. Committing to trunk. Segher 2018-09-19 Segher Boessenkool * combine.c (try_combine): When changing the CC mode used, don't change an unrelated mode in other_insn to that new CC mode. --- gcc/combine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/combine.c b/gcc/combine.c index d3f7143..256b5a4 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -3338,7 +3338,7 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0, { /* Replace cc_use_loc with entire new RTX. */ SUBST (*cc_use_loc, - gen_rtx_fmt_ee (compare_code, compare_mode, + gen_rtx_fmt_ee (compare_code, GET_MODE (*cc_use_loc), newpat_dest, const0_rtx)); undobuf.other_insn = cc_use_insn; } @@ -3347,7 +3347,7 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0, /* Just replace the CC reg with a new mode. */ SUBST (XEXP (*cc_use_loc, 0), newpat_dest); undobuf.other_insn = cc_use_insn; - } + } } /* Now we modify the current newpat: