From patchwork Wed Dec 10 20:12:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 419843 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 6DEDB1400B7 for ; Thu, 11 Dec 2014 07:12:32 +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=aWW2Gp9Y47sW mHcw+2mAOjH44RxrzRKH3GGKfhPiGzEZb63qe0qO0R0w5Wh2vegYNcHkNpnXxWlj NubqkVNd1+CQ7QSKLWK+ewtu+kOCPObkMaDTGBVRZ0R6adTT+LlVuRwPk0QEQQJb nY6MA1Ewz/opX1L6K/XimQHBq3Rh9Jw= 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=vBUr3H6SDs7/AjEzbn bh8insjjs=; b=j6SuMRijRlFk9f5/y8/mBX8ey6Vy3myTsAGm94dpdN6BXABJUL 0sr7Gesk1HokeAjT7VKIgeOQc6HjZ/qrbZWs6zX5GJqaCdeVMDjGxxvC03fiBoZD f6NqdWJoSG6/fOjWw+NZHOA15x0GDjnlOh8b+SS13bnb7VhFWmDKmDYwA= Received: (qmail 24378 invoked by alias); 10 Dec 2014 20:12:24 -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 24364 invoked by uid 89); 10 Dec 2014 20:12:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 10 Dec 2014 20:12:22 +0000 Received: from gcc1-power7.osuosl.org (localhost [127.0.0.1]) by gcc1-power7.osuosl.org (8.14.6/8.14.6) with ESMTP id sBAKCJPu035036; Wed, 10 Dec 2014 12:12:19 -0800 Received: (from segher@localhost) by gcc1-power7.osuosl.org (8.14.6/8.14.6/Submit) id sBAKCHIL034203; Wed, 10 Dec 2014 12:12:17 -0800 From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool Subject: [PATCH] combine: Do not allow asm as I2 in a special case Date: Wed, 10 Dec 2014 12:12:07 -0800 Message-Id: <57fc8b78d95beca67e0f4146ea117aee4bf316dd.1418240878.git.segher@kernel.crashing.org> X-IsSubscribed: yes My rs6000 patch putting a clobber of the carry in every asm regressed guality/pr41353-1.c. This is because the asm (in f3 in that testcase, for example) now is a PARALLEL, and the special case for I2 a parallel and I3 a register move now triggers. Before, when the asm was not a parallel, can_combine_p disallowed combining I2. The effect of the change is that some debug info becomes invalid and is deleted later, causing the testsuite regression. Let's not allow combining an asm in this special case either. Bootstrapped and tested on powerpc64-linux; okay for mainline? Segher 2014-12-10 Segher Boessenkool gcc/ * combine.c (try_combine): Do not allow combining a PARALLEL I2 with a register move I3 if that I2 is an asm. diff --git a/gcc/combine.c b/gcc/combine.c index f5ade9e..8995c1d3 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -2748,6 +2748,13 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0, SET_DEST (XVECEXP (p2, 0, i)))) break; + /* Make sure this PARALLEL is not an asm. We do not allow combining + that usually (see can_combine_p), so do not here either. */ + for (i = 0; i < XVECLEN (p2, 0); i++) + if (GET_CODE (XVECEXP (p2, 0, i)) == SET + && GET_CODE (SET_SRC (XVECEXP (p2, 0, i))) == ASM_OPERANDS) + break; + if (i == XVECLEN (p2, 0)) for (i = 0; i < XVECLEN (p2, 0); i++) if (GET_CODE (XVECEXP (p2, 0, i)) == SET -- 1.8.1.4 --- gcc/combine.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gcc/combine.c b/gcc/combine.c index f5ade9e..8995c1d3 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -2748,6 +2748,13 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0, SET_DEST (XVECEXP (p2, 0, i)))) break; + /* Make sure this PARALLEL is not an asm. We do not allow combining + that usually (see can_combine_p), so do not here either. */ + for (i = 0; i < XVECLEN (p2, 0); i++) + if (GET_CODE (XVECEXP (p2, 0, i)) == SET + && GET_CODE (SET_SRC (XVECEXP (p2, 0, i))) == ASM_OPERANDS) + break; + if (i == XVECLEN (p2, 0)) for (i = 0; i < XVECLEN (p2, 0); i++) if (GET_CODE (XVECEXP (p2, 0, i)) == SET