diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-18 13:49:47 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-18 13:49:47 +0000 |
commit | 3f9f9860db0f045c05e21da4c18752e60884bda0 (patch) | |
tree | c329bd49e22904b85730c8f4832ce3aa478c46bb | |
parent | 80dd37cb0971f6e3246d6a13cbfb13e9c043093d (diff) | |
download | gcc-3f9f9860db0f045c05e21da4c18752e60884bda0.tar.gz |
* ira-cost.c (copy_cost): Lazilly initialize move_cost if needed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142811 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ira-costs.c | 15 |
2 files changed, 16 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a798d85f283..8c10d1a789b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,11 @@ 2008-12-18 Jan Hubicka <jh@suse.cz> Kai Tietz <kai.tietz@onevision.com> + * ira-cost.c (copy_cost): Lazilly initialize move_cost if needed. + +2008-12-18 Jan Hubicka <jh@suse.cz> + Kai Tietz <kai.tietz@onevision.com> + * i386.h (CONDITIONAL_REGISTER_USAGE): Initialize for current function ABI. * i386.c (ix86_call_abi_override): Do not trigger target re-init and diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c index a2df9bde9ae..397affd4b1f 100644 --- a/gcc/ira-costs.c +++ b/gcc/ira-costs.c @@ -142,8 +142,12 @@ copy_cost (rtx x, enum machine_mode mode, enum reg_class rclass, bool to_p, ira_init_register_move_cost (mode); if (secondary_class != NO_REGS) - return (move_cost[mode][secondary_class][rclass] + sri.extra_cost - + copy_cost (x, mode, secondary_class, to_p, &sri)); + { + if (!move_cost[mode]) + init_move_cost (mode); + return (move_cost[mode][secondary_class][rclass] + sri.extra_cost + + copy_cost (x, mode, secondary_class, to_p, &sri)); + } /* For memory, use the memory move cost, for (hard) registers, use the cost to move between the register classes, and use 2 for @@ -151,8 +155,11 @@ copy_cost (rtx x, enum machine_mode mode, enum reg_class rclass, bool to_p, if (MEM_P (x) || rclass == NO_REGS) return sri.extra_cost + ira_memory_move_cost[mode][rclass][to_p != 0]; else if (REG_P (x)) - return - (sri.extra_cost + move_cost[mode][REGNO_REG_CLASS (REGNO (x))][rclass]); + { + if (!move_cost[mode]) + init_move_cost (mode); + return (sri.extra_cost + move_cost[mode][REGNO_REG_CLASS (REGNO (x))][rclass]); + } else /* If this is a constant, we may eventually want to call rtx_cost here. */ |