From 743b56f226d67fc9ec841477c54c4f41864e7e9b Mon Sep 17 00:00:00 2001 From: bstarynk Date: Wed, 12 Nov 2008 16:03:01 +0000 Subject: 2008-11-12 Basile Starynkevitch MELT branch merged with trunk r141785 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@141786 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ira-costs.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'gcc/ira-costs.c') diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c index eade4da4d1c..14d473ed285 100644 --- a/gcc/ira-costs.c +++ b/gcc/ira-costs.c @@ -989,11 +989,14 @@ scan_one_insn (rtx insn) && (note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) != NULL_RTX && MEM_P (XEXP (note, 0))) { - COSTS_OF_ALLOCNO (allocno_costs, - ALLOCNO_NUM (ira_curr_regno_allocno_map - [REGNO (SET_DEST (set))]))->mem_cost - -= (ira_memory_move_cost[GET_MODE (SET_DEST (set))][GENERAL_REGS][1] - * frequency); + enum reg_class cl = GENERAL_REGS; + rtx reg = SET_DEST (set); + int num = ALLOCNO_NUM (ira_curr_regno_allocno_map[REGNO (reg)]); + + if (allocno_pref) + cl = allocno_pref[num]; + COSTS_OF_ALLOCNO (allocno_costs, num)->mem_cost + -= ira_memory_move_cost[GET_MODE (reg)][cl][1] * frequency; record_address_regs (GET_MODE (SET_SRC (set)), XEXP (SET_SRC (set), 0), 0, MEM, SCRATCH, frequency * 2); } -- cgit v1.2.1