[PATCH] Fix PR optimization/10157
Eric Botcazou
ebotcazou@libertysurf.fr
Wed Apr 2 10:42:00 GMT 2003
Hi,
This is a regression from the 3.3 branch, present on mainline on Sparc.
The improved loop invariant hoisting machinery
http://gcc.gnu.org/ml/gcc-patches/2003-02/msg02300.html
produces invalid CCmode moves on Sparc, which doesn't feature the "movcc"
pattern.
The proposed fix is to use the same precaution as GCSE before trying to apply
the new transformation. Bootstrapped/regtested on sparc-sun-solaris2.9
(c,c++,objc,f77 mainline).
--
Eric Botcazou
2003-04-02 Eric Botcazou <ebotcazou@libertysurf.fr>
PR optimization/10157
* gcse.c (can_copy_p): Change it to bool. Export.
(can_copy_init_p): Likewise.
(compute_can_copy): Export.
(gcse_main): Set can_copy_init_p to true instead of 1.
(bypass_jumps): Likewise.
* rtl.h (can_copy_p): Declare.
(can_copy_init_p): Likewise.
(compute_can_copy): Likewise.
* loop.c (scan_loop): Initialize can_copy_p if necessary.
Don't move the source and add a reg-to-reg copy if the
mode doesn't support copy operations.
2003-04-02 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/sparc-loop-1.c: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr10157.diff
Type: text/x-diff
Size: 4234 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20030402/7f5515a3/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sparc-loop-1.c
Type: text/x-csrc
Size: 409 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20030402/7f5515a3/attachment-0001.bin>
More information about the Gcc-patches
mailing list