From patchwork Wed Oct 10 06:46:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 190568 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 9F6322C007F for ; Wed, 10 Oct 2012 17:47:12 +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=1350456432; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Subject:Message-ID:Reply-To: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=OPoy2obdRp9zG3/Ah9Ix 96qY8aA=; b=yV9dM7FQwrlqaOj1ygOC8G+GojfVS3+SNWYfxmJAlO7kFGBPDMaC k3VlCcV59v9AJr0TM7KsW3C0X1KUS16Iqw/n7w1PD7n5nvt1c2t5RGBA/SxWJ/oJ wYdBobk3ddnQdqnji8D+VWZ4EagI7O2yet7torUtrIk3Rgd93lYFYYg= 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:Subject:Message-ID:Reply-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=rp0mrcZKktR0XSLa+/8aC6cOV2OrU0et7WZEYwP36zhjGKo+0lgjr4x0/jmDgm RBVAX9oklwYRDbTglijL6UAwGif//C2sqXVuALGuKZHXTWj2t8pBvN4u/ushZWN/ COhdMJGVgWNMvdAKNYkff6PBZpvchEYyff7PUDy0hkB14=; Received: (qmail 12256 invoked by alias); 10 Oct 2012 06:46:59 -0000 Received: (qmail 12235 invoked by uid 22791); 10 Oct 2012 06:46:56 -0000 X-SWARE-Spam-Status: No, hits=-7.3 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS, TW_TX 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, 10 Oct 2012 06:46:47 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9A6kjWn011744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 10 Oct 2012 02:46:45 -0400 Received: from zalov.redhat.com (vpn1-7-201.ams2.redhat.com [10.36.7.201]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q9A6khr8000503 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 10 Oct 2012 02:46:45 -0400 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.redhat.com (8.14.5/8.14.5) with ESMTP id q9A6khuV018547 for ; Wed, 10 Oct 2012 08:46:43 +0200 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id q9A6kgND018546 for gcc-patches@gcc.gnu.org; Wed, 10 Oct 2012 08:46:42 +0200 Date: Wed, 10 Oct 2012 08:46:42 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix combine.c (count_rtxs) (PR middle-end/54879) Message-ID: <20121010064642.GM26735@tucnak.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline 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 Hi! Seems I wrote a patch 7.5 years ago for and on the 3.4 branch (supposedly for a testcase that went latent on the trunk at that time, due to SSA merge?), and missed the fact that GET_RTX_CLASS changed on the trunk from characters to enum. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2012-10-10 Jakub Jelinek PR middle-end/54879 * combine.c (count_rtxs): Use RTX_BIN_ARITH resp. RTX_COMM_ARITH instead of '2' resp. 'c' for GET_RTX_CLASS comparisons. Jakub --- gcc/combine.c.jj 2012-09-27 12:45:55.000000000 +0200 +++ gcc/combine.c 2012-10-09 23:35:17.577659296 +0200 @@ -12015,8 +12015,8 @@ count_rtxs (rtx x) const char *fmt; int i, j, ret = 1; - if (GET_RTX_CLASS (code) == '2' - || GET_RTX_CLASS (code) == 'c') + if (GET_RTX_CLASS (code) == RTX_BIN_ARITH + || GET_RTX_CLASS (code) == RTX_COMM_ARITH) { rtx x0 = XEXP (x, 0); rtx x1 = XEXP (x, 1); @@ -12024,15 +12024,15 @@ count_rtxs (rtx x) if (x0 == x1) return 1 + 2 * count_rtxs (x0); - if ((GET_RTX_CLASS (GET_CODE (x1)) == '2' - || GET_RTX_CLASS (GET_CODE (x1)) == 'c') + if ((GET_RTX_CLASS (GET_CODE (x1)) == RTX_BIN_ARITH + || GET_RTX_CLASS (GET_CODE (x1)) == RTX_COMM_ARITH) && (x0 == XEXP (x1, 0) || x0 == XEXP (x1, 1))) return 2 + 2 * count_rtxs (x0) + count_rtxs (x == XEXP (x1, 0) ? XEXP (x1, 1) : XEXP (x1, 0)); - if ((GET_RTX_CLASS (GET_CODE (x0)) == '2' - || GET_RTX_CLASS (GET_CODE (x0)) == 'c') + if ((GET_RTX_CLASS (GET_CODE (x0)) == RTX_BIN_ARITH + || GET_RTX_CLASS (GET_CODE (x0)) == RTX_COMM_ARITH) && (x1 == XEXP (x0, 0) || x1 == XEXP (x0, 1))) return 2 + 2 * count_rtxs (x1) + count_rtxs (x == XEXP (x0, 0)