This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/31360] [4.2/4.3 Regression] rtl loop invariant is broken
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Mar 2007 21:33:39 -0000
- Subject: [Bug rtl-optimization/31360] [4.2/4.3 Regression] rtl loop invariant is broken
- References: <bug-31360-6528@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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