From: Richard Earnshaw Date: Sat, 1 Mar 2003 12:51:01 +0000 (+0000) Subject: predict.c (estimate_bb_frequencies): Initialize the sreal constants once per compilation. X-Git-Tag: releases/gcc-3.4.0~8331 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c4f6b78e43edb37bfd77018770d9cb820633f9f0;p=thirdparty%2Fgcc.git predict.c (estimate_bb_frequencies): Initialize the sreal constants once per compilation. * predict.c (estimate_bb_frequencies): Initialize the sreal constants once per compilation. From-SVN: r63607 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 63db809189f7..b76dec586d56 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-03-01 Richard Earnshaw + + * predict.c (estimate_bb_frequencies): Initialize the sreal + constants once per compilation. + 2003-02-28 Richard Henderson * toplev.c (flag_eliminate_unused_debug_types): Enable by default. diff --git a/gcc/predict.c b/gcc/predict.c index 704f269a7f61..29d7c46dc05c 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -1173,13 +1173,18 @@ estimate_bb_frequencies (loops) counts_to_freqs (); else { - sreal_init (&real_zero, 0, 0); - sreal_init (&real_one, 1, 0); - sreal_init (&real_br_prob_base, REG_BR_PROB_BASE, 0); - sreal_init (&real_bb_freq_max, BB_FREQ_MAX, 0); - sreal_init (&real_one_half, 1, -1); - sreal_div (&real_inv_br_prob_base, &real_one, &real_br_prob_base); - sreal_sub (&real_almost_one, &real_one, &real_inv_br_prob_base); + static int real_values_initialized = 0; + + if (!real_values_initialized) + { + sreal_init (&real_zero, 0, 0); + sreal_init (&real_one, 1, 0); + sreal_init (&real_br_prob_base, REG_BR_PROB_BASE, 0); + sreal_init (&real_bb_freq_max, BB_FREQ_MAX, 0); + sreal_init (&real_one_half, 1, -1); + sreal_div (&real_inv_br_prob_base, &real_one, &real_br_prob_base); + sreal_sub (&real_almost_one, &real_one, &real_inv_br_prob_base); + } mark_dfs_back_edges (); /* Fill in the probability values in flowgraph based on the REG_BR_PROB