From patchwork Tue Sep 25 21:28:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dehao Chen X-Patchwork-Id: 186894 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 D996A2C008F for ; Wed, 26 Sep 2012 07:28:31 +1000 (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=1349213312; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=CyzzP3Q R5lzqrwGCvZFFufymoeg=; b=j1NZq1FmsQFueu4D2VmZPvsOZ0WnyskeBtYarMo fSTXCa0xxRX0UfVIP0/6/DdY1mW/pkssLAiezq6DqEymi1qR7dguyxL0+eQAj+I0 E6mRAODe4D5B7SebHMn5HBUakOTBqFCf99IilvLPdkUIKTVKpM8kSanWcf7EMFw7 2FB8= 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:X-Google-DKIM-Signature:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Cc:Content-Type:X-System-Of-Record:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=wisnaF9RKa6oMVJuB8obpM80GrM3hcB2SfImDDRpTr0ojkHv2zbfnkswETdg3R ZZ2Gyc/K+oF5VzapexvMqHT0WgNwGL12Ll5+EuRLTLzcPJ7ZC4Y8F5Hcoqlj09rB RLFLmlNApI3U5OB3jzAu+Tzgl26An+8rapiP/3uYxvV/g=; Received: (qmail 7061 invoked by alias); 25 Sep 2012 21:28:27 -0000 Received: (qmail 7052 invoked by uid 22791); 25 Sep 2012 21:28:26 -0000 X-SWARE-Spam-Status: No, hits=-5.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-da0-f47.google.com (HELO mail-da0-f47.google.com) (209.85.210.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 25 Sep 2012 21:28:13 +0000 Received: by daks35 with SMTP id s35so422136dak.20 for ; Tue, 25 Sep 2012 14:28:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type :x-system-of-record:x-gm-message-state; bh=0dL/HNkIYZ9vLmW4tqXhfC2yxXjdd42oXUy3olFVeWE=; b=m62dd87kra+3VX0+9NCX4/9+XYqTZUY3b8XlXf/tJGtT2ViT2YV0ommBKN7qhByRxE wkkvVogyw8xFyGy1f43oE0T6iiWHZymNdEek0llHAl7chtnOz3mqdlpJMRa2QXgjLG74 s9aMxSkoD3NTgZjKak9kzIItK9KZK6qMEquFVZ0wt+VvqmGWKP3ZbN6LdKtFfJOBVpvl HP2sFZVBmmVKDJpWi++GV00F4XFtrILmybxdMrEiOqK2mCOXH7VUtcTy2WX+7rdDJGYJ UGDQr/PuglwJlNZsG1yZWkJLbH4xFM/SJyGaDR2uDP8DNKbU82z7qBbeX4SPLYabv32r Zh8w== Received: by 10.68.189.164 with SMTP id gj4mr49256899pbc.48.1348608493269; Tue, 25 Sep 2012 14:28:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.189.164 with SMTP id gj4mr49256888pbc.48.1348608493133; Tue, 25 Sep 2012 14:28:13 -0700 (PDT) Received: by 10.68.49.232 with HTTP; Tue, 25 Sep 2012 14:28:13 -0700 (PDT) Date: Tue, 25 Sep 2012 14:28:13 -0700 Message-ID: Subject: [PATCH committed] Fix PR54704 From: Dehao Chen To: GCC Patches Cc: Richard Guenther X-System-Of-Record: true X-Gm-Message-State: ALoCoQm1H67S8pgTPueHC1UEjO06MZ5iFIFPwTqynpJB1OpH5n5VuGw5EuW0pOOV5tpCIL0p7qsq+DvJXXIswXlWRDDSxP0S/Ly8NjYaKf7U0CUHUIvT2tQ1REjoiZjId0WX7gOGYXlx00uFqusWgFyB1Kj8dDlVkEYVHja4KHXcK0/VKUxiIe5zRazgBp/bbFQBl7YfF0WR 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, This patch (fixed by Richard, I just helped testing) fixes a bug in the hash function which leads to too many collisions and a 3x compile time overhead for tramp3d. After applying the patch, the compile time of tramp3d returns to normal (the same as no block-location patch). Bootstrapped and passed all gcc regression tests. As the bug itself is obvious, I'll check in the patch to trunk now. Thanks, Dehao libcpp/ChangeLog: 2012-09-25 Dehao Chen PR middle-end/54704 * line-map.c (location_adhoc_data_hash): Fix the hash function. Index: libcpp/line-map.c =================================================================== --- libcpp/line-map.c (revision 191743) +++ libcpp/line-map.c (working copy) @@ -58,7 +58,7 @@ location_adhoc_data_hash (const void *l) { const struct location_adhoc_data *lb = (const struct location_adhoc_data *) l; - return (hashval_t) lb->locus + (size_t) &lb->data; + return (hashval_t) lb->locus + (size_t) lb->data; } /* Compare function for location_adhoc_data hashtable. */