This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/37263] [4.3/4.4 Regression] extra code for doloop with unsigned 32bit types on LP64
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Sep 2008 21:25:50 -0000
- Subject: [Bug rtl-optimization/37263] [4.3/4.4 Regression] extra code for doloop with unsigned 32bit types on LP64
- References: <bug-37263-6528@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from pinskia at gcc dot gnu dot org 2008-09-15 21:25 -------
Looks like http://www.nabble.com/-patch--Fix-nonsensical-exit-test-replacement-
td8289646.html caused the IV-opts difference.
The problem here is that the two costs are the same as we go for the
original one but we really should use elimination one as it will
provide for better optimizations later on.
The patch:
Index: tree-ssa-loop-ivopts.c
===================================================================
--- tree-ssa-loop-ivopts.c (revision 2825)
+++ tree-ssa-loop-ivopts.c (working copy)
@@ -3814,8 +3814,8 @@
fd_ivopts_data = data;
walk_tree (&cmp_iv->base, find_depends, &depends_on_express, NULL);
- /* Choose the better approach. */
- if (compare_costs (elim_cost, express_cost) < 0)
+ /* Choose the better approach, preferring the eliminating one. */
+ if (compare_costs (elim_cost, express_cost) <= 0)
{
cost = elim_cost;
depends_on = depends_on_elim;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37263