From patchwork Thu May 23 00:30:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 245791 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 42D1B2C008A for ; Thu, 23 May 2013 10:30:37 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:date:content-type:mime-version; q= dns; s=default; b=U3HQgPidiLEH5ZarGlIh0narcJJCDt6FmGL0p+KM5v6yoV NajxrYxLvHwn6ncyjaQkc9/FIWQ3fq2KLJXRK5I8WlXRVOT0Z4ebUM7qQ7nBbaQS tP+9203QSEdc6Vv552ghr8gpG2liqXAwYG6bVqXjpgdsOoetkbets4GoNqua4= 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 :message-id:subject:from:to:date:content-type:mime-version; s= default; bh=N54GhixB0m0VkonwE009IG0yc8Y=; b=Ykdiv/eFcPQZTeMhfo6P 2Ws7lVq+1LXgyAdHWbc3U468TSdzkdOVSjOe59MkOP3I2NB2/ybGJo8ix8Xu6fdO pr3fxfNw6UaCOnMlZXtOKJlYrWk+XB4sB/l49j35D7XSNCOYK4sPjQySaGDizYh0 Z/0gw7iZuK7CYgYtLp+m7Bc= Received: (qmail 14622 invoked by alias); 23 May 2013 00:30:31 -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 14597 invoked by uid 89); 23 May 2013 00:30:28 -0000 X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 23 May 2013 00:30:27 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4N0UQ9O002583 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 22 May 2013 20:30:26 -0400 Received: from [10.3.227.92] (vpn-227-92.phx2.redhat.com [10.3.227.92]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r4N0UP2i004760 for ; Wed, 22 May 2013 20:30:25 -0400 Message-ID: <1369269035.26167.39.camel@surprise> Subject: Mark threshold arrays in bb-reorder.c as constant From: David Malcolm To: GCC Patches Date: Wed, 22 May 2013 20:30:35 -0400 Mime-Version: 1.0 X-Virus-Found: No The arrays of thresholds in gcc/bb-reorder.c appear not to have changed since 2004 (in r80564). As part of my hope of quashing global state in gcc, I'd like to mark them as const. Bootstrapped and tested on x86_64-unknown-linux-gnu against r199189, and has the same test results as an unpatched bootstrap of that revision. OK to commit to trunk? 2013-05-21 David Malcolm * bb-reorder.c (branch_threshold): make const (exec_threshold): ditto commit 60623f1616b3144310f432174ebbb3e2cc6dff28 Author: David Malcolm Date: Tue May 21 21:52:45 2013 -0400 Make bb-reorder.c arrays const gcc/ * bb-reorder.c (branch_threshold): make const (exec_threshold): ditto diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index 3167220..0a1f42a 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -123,10 +123,10 @@ struct target_bb_reorder *this_target_bb_reorder = &default_target_bb_reorder; (this_target_bb_reorder->x_uncond_jump_length) /* Branch thresholds in thousandths (per mille) of the REG_BR_PROB_BASE. */ -static int branch_threshold[N_ROUNDS] = {400, 200, 100, 0, 0}; +static const int branch_threshold[N_ROUNDS] = {400, 200, 100, 0, 0}; /* Exec thresholds in thousandths (per mille) of the frequency of bb 0. */ -static int exec_threshold[N_ROUNDS] = {500, 200, 50, 0, 0}; +static const int exec_threshold[N_ROUNDS] = {500, 200, 50, 0, 0}; /* If edge frequency is lower than DUPLICATION_THRESHOLD per mille of entry block the edge destination is not duplicated while connecting traces. */