summaryrefslogtreecommitdiff
path: root/gcc/global.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/global.c')
-rw-r--r--gcc/global.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/global.c b/gcc/global.c
index de6beb91fb4..8be113df60a 100644
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -404,6 +404,7 @@ global_alloc (void)
allocno[i].reg = regno;
allocno[i].size = PSEUDO_REGNO_SIZE (regno);
allocno[i].calls_crossed += REG_N_CALLS_CROSSED (regno);
+ allocno[i].freq_calls_crossed += REG_FREQ_CALLS_CROSSED (regno);
allocno[i].throwing_calls_crossed
+= REG_N_THROWING_CALLS_CROSSED (regno);
allocno[i].n_refs += REG_N_REFS (regno);
@@ -1164,8 +1165,9 @@ find_reg (int num, HARD_REG_SET losers, int alt_regs_p, int accept_call_clobbere
if (! accept_call_clobbered
&& allocno[num].calls_crossed != 0
&& allocno[num].throwing_calls_crossed == 0
- && CALLER_SAVE_PROFITABLE (allocno[num].n_refs,
- allocno[num].calls_crossed))
+ && CALLER_SAVE_PROFITABLE (optimize_size ? allocno[num].n_refs : allocno[num].freq,
+ optimize_size ? allocno[num].calls_crossed
+ : allocno[num].freq_calls_crossed))
{
HARD_REG_SET new_losers;
if (! losers)