From patchwork Thu Jul 30 02:29:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 501903 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 860D814030E for ; Thu, 30 Jul 2015 12:30:11 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=rHPc4k/9; dkim-atps=neutral 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=rP7iHdodgorD XAlTfbFlHlzMg1RP5WY+9ld8jiPKqq5wyuYZ8HVywbUcDtp64a2v0heArj30xK5V z54PArFp+imRxb0IwPk1vPX0hlRYtp+7vnRsD45S0cMDElpLqSr7mG7C5gfXa3gQ AyRbWqD0XhfkfDtOO4sx2Ct0uPKvykg= 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=XiTiFLyvxFd5H9K7K1 MjilCT2Tw=; b=rHPc4k/9G8c49Ml7vIF4XZCA0m1RK0eYzVuAn6V1EzAOd8fbIv B4Qh7XBX97hz5pJ+1KIJ5NqxuSP2aRBoJpfMd1Zd1Slt5qsu7H85ZINe800Trun5 tYAP6GkfbWjD6RsEf9gggFxsksdcF5WHjoio2+u0eO5MjWaOVEA8x9hpA= Received: (qmail 72968 invoked by alias); 30 Jul 2015 02:30:04 -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 72949 invoked by uid 89); 30 Jul 2015 02:30:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, 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; Thu, 30 Jul 2015 02:30:01 +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 t6U2TxFo054601; Wed, 29 Jul 2015 19:29:59 -0700 Received: (from segher@localhost) by gcc1-power7.osuosl.org (8.14.6/8.14.6/Submit) id t6U2TqSi054580; Wed, 29 Jul 2015 19:29:52 -0700 From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com, Segher Boessenkool Subject: [PATCH] rs6000: Fix PR67045 Date: Wed, 29 Jul 2015 19:29:50 -0700 Message-Id: <911c5351f00cd9717b6aecb2c683e3ed34ceaaf9.1438217378.git.segher@kernel.crashing.org> X-IsSubscribed: yes Paper bag time. Committing as obvious fix. Bootstrapped and regression checked on powerpc64-linux and powerpc64le-linux; also bootstrapped the latter with --enable-checking=release and -O3 (the PR67045 case). Will do an --enable-checking=yes,rtl as well. Segher 2015-07-29 Segher Boessenkool PR target/66217 PR target/67045 * config/rs6000/rs6000.md (and3): Put a CONST_INT_P check around those cases that need one. --- gcc/config/rs6000/rs6000.md | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index f7fa399..527ad98 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -2898,26 +2898,29 @@ (define_expand "and3" DONE; } - if (rs6000_is_valid_and_mask (operands[2], mode)) + if (CONST_INT_P (operands[2])) { - emit_insn (gen_and3_mask (operands[0], operands[1], operands[2])); - DONE; - } + if (rs6000_is_valid_and_mask (operands[2], mode)) + { + emit_insn (gen_and3_mask (operands[0], operands[1], operands[2])); + DONE; + } - if (logical_const_operand (operands[2], mode) - && rs6000_gen_cell_microcode) - { - emit_insn (gen_and3_imm (operands[0], operands[1], operands[2])); - DONE; - } + if (logical_const_operand (operands[2], mode) + && rs6000_gen_cell_microcode) + { + emit_insn (gen_and3_imm (operands[0], operands[1], operands[2])); + DONE; + } - if (rs6000_is_valid_2insn_and (operands[2], mode)) - { - rs6000_emit_2insn_and (mode, operands, true, 0); - DONE; - } + if (rs6000_is_valid_2insn_and (operands[2], mode)) + { + rs6000_emit_2insn_and (mode, operands, true, 0); + DONE; + } - operands[2] = force_reg (mode, operands[2]); + operands[2] = force_reg (mode, operands[2]); + } })