[PATCH] PR57878, Incorrect code: live register clobbered in split2

Wei Mi wmi@google.com
Mon Jul 15 18:44:00 GMT 2013


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  <wmi@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  <wmi@google.com>

        PR rtl-optimization/57878
        * g++.dg/pr57518.C: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: application/octet-stream
Size: 1244 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130715/18335af2/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_test
Type: application/octet-stream
Size: 7852 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130715/18335af2/attachment-0001.obj>


More information about the Gcc-patches mailing list