From patchwork Mon Dec 15 11:11:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 421086 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 B8E691400D2 for ; Mon, 15 Dec 2014 22:12:21 +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=JXfwoLE2CmQQ QlTd1s6ExCI6O5qKiKcNkq7G5haImTA7Zky3M/5rQJNtuQtC6PWDi2MX/6BGhBNi PPuDhF/N+XYRoE3HBHjnxiyP3E8i8mGdwkXbA5erWBRF5WA++JJCqvLW4NakB43K gOjkbX7t9/9Yb9c4GxxwOtb7IdTumxY= 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=z12+QL9RPBXzq9ltkh ebwpkwmXE=; b=e77ujHThrwfW2KJVaho5DvCsxVCLIbx5M5yPfvlXq0DpboAOxH YdkebJVhPEpenEUMg68U7wxt/uE5m48W/aIckFbj+qEU22X/61riIjDkVhAdlzL2 bomhafBvJO6cnuttBjrZR364Q6aLFu+XipsR9JB0HSCMw4CVQ7AduATCU= Received: (qmail 10800 invoked by alias); 15 Dec 2014 11:12:09 -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 10732 invoked by uid 89); 15 Dec 2014 11:12:08 -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; Mon, 15 Dec 2014 11:12:07 +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 sBFBC5Nj020105; Mon, 15 Dec 2014 03:12:05 -0800 Received: (from segher@localhost) by gcc1-power7.osuosl.org (8.14.6/8.14.6/Submit) id sBFBC166016488; Mon, 15 Dec 2014 03:12:01 -0800 From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com, Segher Boessenkool Subject: [PATCH] rs6000: Do not allow GPR0 for addic. if it is split Date: Mon, 15 Dec 2014 03:11:58 -0800 Message-Id: X-IsSubscribed: yes If an addic. is split to addi+cmp (because RA didn't give it CR0), it will do the wrong thing if the input reg is GPR0 ("addi X,0,N" is "li X,N"). So don't allow such an input. Spotted visually while investigating PR64268. Tested etc.; okay for mainline? Segher 2014-12-15 Segher Boessenkool gcc/ * gcc/config/rs6000/rs6000.md (*add>mode>3_imm_dot, *add3_imm_dot2): Change the constraint for the second alternative for operand 1 from "r" to "b". --- gcc/config/rs6000/rs6000.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index bb9ab0f..36e6182 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -1569,7 +1569,7 @@ (define_insn_and_split "*add3_dot2" (define_insn_and_split "*add3_imm_dot" [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y") - (compare:CC (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "%r,r") + (compare:CC (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "%r,b") (match_operand:GPR 2 "short_cint_operand" "I,I")) (const_int 0))) (clobber (match_scratch:GPR 0 "=r,r")) @@ -1592,7 +1592,7 @@ (define_insn_and_split "*add3_imm_dot" (define_insn_and_split "*add3_imm_dot2" [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y") - (compare:CC (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "%r,r") + (compare:CC (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "%r,b") (match_operand:GPR 2 "short_cint_operand" "I,I")) (const_int 0))) (set (match_operand:GPR 0 "gpc_reg_operand" "=r,r")