Commit 7a17c588 by Jim Wilson

(find_reg): Store divide results in temporary variables.

From-SVN: r7778
parent 8c4f5c09
......@@ -1096,11 +1096,18 @@ find_reg (allocno, losers, alt_regs_p, accept_call_clobbered, retrying)
if (local_reg_n_refs[regno] != 0
/* Don't use a reg no good for this pseudo. */
&& ! TEST_HARD_REG_BIT (used2, regno)
&& HARD_REGNO_MODE_OK (regno, mode)
&& (((double) local_reg_n_refs[regno]
/ local_reg_live_length[regno])
< ((double) allocno_n_refs[allocno]
/ allocno_live_length[allocno])))
&& HARD_REGNO_MODE_OK (regno, mode))
{
/* We explicitly evaluate the divide results into temporary
variables so as to avoid excess precision problems that occur
on a i386-unknown-sysv4.2 (unixware) host. */
double tmp1 = ((double) local_reg_n_refs[regno]
/ local_reg_live_length[regno]);
double tmp2 = ((double) allocno_n_refs[allocno]
/ allocno_live_length[allocno]);
if (tmp1 < tmp2)
{
/* Hard reg REGNO was used less in total by local regs
than it would be used by this one allocno! */
......@@ -1121,6 +1128,7 @@ find_reg (allocno, losers, alt_regs_p, accept_call_clobbered, retrying)
}
}
}
}
/* Did we find a register? */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment