------- Comment #25 from vmakarov at redhat dot com 2008-09-03 15:36 ------- The problem is in sorting insn chains according to their frequencies to get a better reloads for most frequently executed insns. This very simple optimization was introduced on IRA branch. Correct updating elimination offsets in reload needs original insn chain order. I see two solutions of the problem:
o Restore evaluation of elimination offsets by using original order of insn chains. It means move of sorting insn chains to function calculate_needs_all_insns and process offsets there before sorting. It also needs to save elimination offsets not only at code labels (as it now) but at any BB end start. So it complicates significantly this very simple optimization and makes it even slower because we need sort insn chain on each reload iteration (not once as it now). o Just remove sorting of insn chain. I've checked the optimization impact on SPEC2000 for x86 and found it is not significant (about 0.1% improvement on SPECINT2000 which is in measurement error range and 0.02% codes size decrease on SPECFP2000). It should speed up the compiler although in reality I did not find a visible speedup. After some thinking, I've decided to stic to the 2nd solution. The patch solving the problem will follow soon. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37296