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 <dmalc...@redhat.com> * bb-reorder.c (branch_threshold): make const (exec_threshold): ditto
commit 60623f1616b3144310f432174ebbb3e2cc6dff28 Author: David Malcolm <dmalc...@redhat.com> 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. */