From patchwork Wed Jan 23 08:42:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 214844 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]) by ozlabs.org (Postfix) with SMTP id 78E8B2C0084 for ; Wed, 23 Jan 2013 19:42:21 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1359535342; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To:User-Agent:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=+Ocb4xa6MFxX3QRJ3ZlYzfvl7D4=; b=SO/hmdk7ec6RmXf eNLzhGvauau7XcHYFbONCKWhz0mThDcMyU8Z/yZ2x2V0WsIdlbvXd8yUddUhVV28 l40Zct1r1dSVkL1Q6cB1D9K8u+jX7hKmN9Ur9DEKUCNlBzsmj9odISSpaQVZv8a1 xc/HVaaqUYxaFTpob1/OHpEHXisU= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=WkXeza5QUF5Hc5M2J31KtaNiWKawiWFW0Rd/prXE7ZZU/wJzh9CQmOuDfjLNhr EMz1/Qx2iUpmCdjZ1CsHBIoUnlRJlZTUERKgQP3HpClojaRHRuZu17CWYilR+3O8 h/HhUff/1IKzci77t6wuXp+Tq76zeErkXGkRU00lRkKqA=; Received: (qmail 5455 invoked by alias); 23 Jan 2013 08:42:16 -0000 Received: (qmail 5366 invoked by uid 22791); 23 Jan 2013 08:42:15 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Jan 2013 08:42:10 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0N8g5Ud024918 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 23 Jan 2013 03:42:05 -0500 Received: from zalov.redhat.com (vpn1-4-254.ams2.redhat.com [10.36.4.254]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0N8g3Ql016447 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 Jan 2013 03:42:05 -0500 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.redhat.com (8.14.5/8.14.5) with ESMTP id r0N8g2tx020035; Wed, 23 Jan 2013 09:42:02 +0100 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id r0N8g1Zc020034; Wed, 23 Jan 2013 09:42:01 +0100 Date: Wed, 23 Jan 2013 09:42:00 +0100 From: Jakub Jelinek To: Ramana Radhakrishnan Cc: "nickc@redhat.com" , Richard Earnshaw , "gcc-patches@gcc.gnu.org" Subject: Re: [PATCH] Fix up ARM ICE (PR target/49069) Message-ID: <20130123084200.GB7269@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20130121105515.GH7269@tucnak.redhat.com> <50FE6C20.8080508@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <50FE6C20.8080508@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 On Tue, Jan 22, 2013 at 10:38:24AM +0000, Ramana Radhakrishnan wrote: > Instead I'd just use s_register_operand for operand1 and continue to > use cmpdi_operand for operand2 and fix it so. > > And likewise . > > Ok with those changes and if no regressions. Managed to bootstrap/regtest this (via scratch rpm builds) on armv7hl-linux-gnueabi, here is what I've committed: 2013-01-23 Jakub Jelinek PR target/49069 * config/arm/arm.md (cbranchdi4, cstoredi4): Use s_register_operand instead of cmpdi_operand for first comparison operand. Don't assert that comparison operands aren't both constants. * gcc.dg/pr49069.c: New test. Jakub --- gcc/config/arm/arm.md.jj 2013-01-18 17:59:43.765932181 +0100 +++ gcc/config/arm/arm.md 2013-01-22 12:07:13.572331618 +0100 @@ -7030,16 +7030,12 @@ (define_expand "cbranchdi4" [(set (pc) (if_then_else (match_operator 0 "expandable_comparison_operator" - [(match_operand:DI 1 "cmpdi_operand" "") + [(match_operand:DI 1 "s_register_operand" "") (match_operand:DI 2 "cmpdi_operand" "")]) (label_ref (match_operand 3 "" "")) (pc)))] "TARGET_32BIT" "{ - /* We should not have two constants. */ - gcc_assert (GET_MODE (operands[1]) == DImode - || GET_MODE (operands[2]) == DImode); - if (!arm_validize_comparison (&operands[0], &operands[1], &operands[2])) FAIL; emit_jump_insn (gen_cbranch_cc (operands[0], operands[1], operands[2], @@ -7955,14 +7951,10 @@ (define_expand "cstoredi4" [(set (match_operand:SI 0 "s_register_operand" "") (match_operator:SI 1 "expandable_comparison_operator" - [(match_operand:DI 2 "cmpdi_operand" "") + [(match_operand:DI 2 "s_register_operand" "") (match_operand:DI 3 "cmpdi_operand" "")]))] "TARGET_32BIT" "{ - /* We should not have two constants. */ - gcc_assert (GET_MODE (operands[2]) == DImode - || GET_MODE (operands[3]) == DImode); - if (!arm_validize_comparison (&operands[1], &operands[2], &operands[3])) --- gcc/testsuite/gcc.dg/pr49069.c.jj 2012-11-17 15:43:17.572007394 +0100 +++ gcc/testsuite/gcc.dg/pr49069.c 2013-01-17 16:43:41.613146835 +0100 @@ -0,0 +1,15 @@ +/* PR target/49069 */ +/* { dg-do compile } */ +/* { dg-options "-Os -fno-tree-forwprop -Wno-div-by-zero" } */ + +int a; +const unsigned long long b[1] = { 1ULL }; +extern void bar (int); + +void +foo (void) +{ + for (a = 0; a == 1; a = 2) + ; + bar (b[0] == (a == 0 ? a : a / 0)); +}