diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-02-09 11:09:25 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-02-09 11:09:25 +0000 |
commit | bbe1fc8fc4cc8514ddc35a113d93c882ea33142f (patch) | |
tree | a5a4fa014573b90d9d7e979aabb0ae0586189fe4 /gcc/tree-ssa-coalesce.c | |
parent | fd49466951f7a9b62ec981be537381f35491904c (diff) | |
download | gcc-bbe1fc8fc4cc8514ddc35a113d93c882ea33142f.tar.gz |
PR middle-end/38981
* tree-ssa-coalesce.c (add_coalesce): Cap the costs of coalesce pairs
at MUST_COALESCE_COST-1 instead of MUST_COALESCE_COST.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144032 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-coalesce.c')
-rw-r--r-- | gcc/tree-ssa-coalesce.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c index 3af0c3285d8..8ac74f0c290 100644 --- a/gcc/tree-ssa-coalesce.c +++ b/gcc/tree-ssa-coalesce.c @@ -284,8 +284,7 @@ add_cost_one_coalesce (coalesce_list_p cl, int p1, int p2) /* Add a coalesce between P1 and P2 in list CL with a cost of VALUE. */ static inline void -add_coalesce (coalesce_list_p cl, int p1, int p2, - int value) +add_coalesce (coalesce_list_p cl, int p1, int p2, int value) { coalesce_pair_p node; @@ -295,13 +294,13 @@ add_coalesce (coalesce_list_p cl, int p1, int p2, node = find_coalesce_pair (cl, p1, p2, true); - /* Once the value is MUST_COALESCE_COST, leave it that way. */ - if (node->cost != MUST_COALESCE_COST) + /* Once the value is at least MUST_COALESCE_COST - 1, leave it that way. */ + if (node->cost < MUST_COALESCE_COST - 1) { - if (value == MUST_COALESCE_COST) - node->cost = value; - else + if (value < MUST_COALESCE_COST - 1) node->cost += value; + else + node->cost = value; } } |