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.

Attachment: patch
Description: Binary data

Attachment: patch_test
Description: Binary data

Reply via email to