Thank you! backported as r201068 in gcc-4_8-branch. Thanks, Wei.
On Thu, Jul 18, 2013 at 10:05 AM, Vladimir Makarov <vmaka...@redhat.com> wrote: > On 07/15/2013 02:26 PM, Wei Mi wrote: >> Hi, >> >> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57878 >> >> The bug occurs because tfreq is given higher priority than bigger mode >> in reload_pseudo_compare_func. When there are multiple reload pseudos >> in the same insn, and the pseudo with bigger mode has lower thread >> frequency than other reload pseudos, it is possible the bigger mode >> pseudo cannot find available hardregs. >> >> The proposed fix is to switch the priority of bigger mode and tfreq in >> reload_pseudo_compare_func. Besides I promoted lra_assert to >> gcc_assert at the end of to make adding testcase easier since >> lra_assert will not fire on 4.8.1. >> >> bootstrap and regression test are ok on x86_64-linux-gnu. Is it ok for >> trunk and 4.8 branch? >> >> Thanks, >> Wei. >> >> 2013-07-15 Wei Mi <w...@google.com> >> >> PR rtl-optimization/57878 >> * lra-assigns.c (reload_pseudo_compare_func): Switch the priority of >> bigger mode and tfreq. >> >> 2013-07-15 Wei Mi <w...@google.com> >> >> PR rtl-optimization/57878 >> * g++.dg/pr57518.C: New test. > In overall, the PR analysis and the patch is ok. The only problem the > patch can affect generated code performance especially for 32-bit > targets. I see regressions on 4 SPECInt2000 tests. > > Here is the patch I've committed into the trunk. It decreases the patch > effect on performance. > > The patch was successfully bootstrapped an tested on x86/x86-64. > > Committed to the trunk as rev. 201036. > > Wei Mi, could you commit it to gcc4.8 branch. > > Thanks. > > 2013-07-18 Vladimir Makarov <vmaka...@redhat.com> > Wei Mi <w...@google.com> > > PR rtl-optimization/57878 > * lra-assigns.c (assign_by_spills): Move non_reload_pseudos to the > top. > (reload_pseudo_compare_func): Check nregs first for reload > pseudos. > > 2013-07-18 Wei Mi <w...@google.com> > > PR rtl-optimization/57878 > * g++.dg/pr57518.C: New test. >