From patchwork Fri Jan 6 19:27:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 134692 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 025FFB6F69 for ; Sat, 7 Jan 2012 06:28:06 +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=1326482887; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:From:To:Cc:Subject:References:Date: In-Reply-To:Message-ID:User-Agent:MIME-Version:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=rwQqrdcKgCUX/8R3C86L r86aI9w=; b=NOOA0N48FaMU7jeNr7PxwKMXYNVjk2CVIq60hUZZ6vQjQ4B+C+62 i9uhHpvfKsXSeJhcXgdHAh7flPKHUVTn9Vbk+t12WgrbsbRB2GXjIfAyuHGIoMtY 3ztTTDnHEEDWDktHpnYked7pzi2BD0GTnmLYDEG324zq2u+jtcrJXK0= 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:Received:From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=k0ZqBVQt2eOXBnwKkkbgSuZu1CCm7y06n6KvcM3RK9rCFObca68i6r6jyU1xK6 4tAzkGZrYjjAW/22FhxmhZzwDzm9kHuFx5GHnnC8GVcJNhtIjfrUrNLvP4p+pfPV q2hVnggsBi77rCXpL6T4/UCcUZalRkBkYfPwvBDt0R/W8=; Received: (qmail 4748 invoked by alias); 6 Jan 2012 19:28:03 -0000 Received: (qmail 4738 invoked by uid 22791); 6 Jan 2012 19:28:02 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS 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; Fri, 06 Jan 2012 19:27:43 +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 q06JRhQ8008931 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 6 Jan 2012 14:27:43 -0500 Received: from freie (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q06JRd25027544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 6 Jan 2012 14:27:41 -0500 Received: from livre.localdomain (livre-to-gw.oliva.athome.lsd.ic.unicamp.br [172.31.160.19]) by freie (8.14.5/8.14.5) with ESMTP id q06JRcB0030048; Fri, 6 Jan 2012 17:27:38 -0200 Received: from livre.localdomain (aoliva@localhost.localdomain [127.0.0.1]) by livre.localdomain (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q06JRb64009433; Fri, 6 Jan 2012 17:27:37 -0200 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id q06JRaEr009431; Fri, 6 Jan 2012 17:27:36 -0200 From: Alexandre Oliva To: Jakub Jelinek Cc: Richard Henderson , Richard Guenther , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix arm var-tracking ICE (PR debug/51746) References: <20120104174534.GD18937@tyan-ft48-01.lab.bos.redhat.com> Date: Fri, 06 Jan 2012 17:27:35 -0200 In-Reply-To: <20120104174534.GD18937@tyan-ft48-01.lab.bos.redhat.com> (Jakub Jelinek's message of "Wed, 4 Jan 2012 18:45:34 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 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 Jan 4, 2012, Jakub Jelinek wrote: > Before the htab expansion > cselib_lookup on r1 - 1 gave value 18:18 which contains the right value, but > doesn't have the hash value for r1 - 1 (8169), thus is found only by > accident. Unfortunately after the expansion we don't look at the 18:18 > value at all, don't find a value and thus a new value for r1 - 1 is > created (27:8169). Unfortunately the expected MEM value is in 18:18's > addr_list, not in 27:8169, so add_stores doesn't find it (and is create=0 > call, thus it returns NULL). The problem was a bug in the hash number computation for the reverse operation, that used the hash number of the original r1's VALUE when it was in a register, but didn't use it when we computed the hash code of the expression with a VALUE instead of the REG. This patch fixes expression hash computation so that it uses the hash code of a VALUE just as it would for REGs and MEMs, so that we compute the same hashcode and locate the VALUEs for reverse expressions correctly. Regstrapped on x86_64-linux-gnu and i686-linux-gnu, verified to solve the ARM problem, with and without your patch. I'm checking it in as obvious. Index: gcc/cselib.c =================================================================== --- gcc/cselib.c.orig 2012-01-06 14:18:38.954548069 -0200 +++ gcc/cselib.c 2012-01-06 14:18:44.952460886 -0200 @@ -1035,6 +1035,10 @@ cselib_hash_rtx (rtx x, int create, enum switch (code) { + case VALUE: + e = CSELIB_VAL_PTR (x); + return e->hash; + case MEM: case REG: e = cselib_lookup (x, GET_MODE (x), create, memmode);