[Bug rtl-optimization/31360] [4.2/4.3 Regression] rtl loop invariant is broken
steven at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Mar 26 21:33:00 GMT 2007
------- Comment #10 from steven at gcc dot gnu dot org 2007-03-26 22:33 -------
Just a small heuristics problem. This could be fixed by giving insns to move
with comp_cost - size_cost == 0 in gain_for_invariant a small gain anyway. Or
maybe comp_cost should overrule size_cost.
Just as a demonstration of how trivial this is, consider this hack:
Index: loop-invariant.c
===================================================================
--- loop-invariant.c (revision 123222)
+++ loop-invariant.c (working copy)
@@ -1101,8 +1101,10 @@ find_invariants_to_move (void)
}
new_regs = 0;
+
+ /* Find instructions to move. Nothing gained is nothing lost. */
while (best_gain_for_invariant (&inv, ®s_needed,
- new_regs, regs_used, n_inv_uses) > 0)
+ new_regs, regs_used, n_inv_uses) >= 0)
{
set_move_mark (inv->invno);
new_regs += regs_needed;
Looks to me like a small heuristics tweak and some benchmarking would get this
one out of the way with only a small effort.
--
steven at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.2.0 |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31360
More information about the Gcc-bugs
mailing list