This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix middle-end/37219 fwprop1 is broken for addresses


When I was looking into code generation differences between GCC 4.1.1
and GCC 4.3.0, I noticed that fwprop was not doing the same job as
CSE1 in 4.1.1 dealing with addresses in mem.  The issue was that the
check in fwprop was too restrictive when it comes to checking if the
use of reg is inside a loop.  Since there is an "outer loop",
loop_father will never be NULL, so we never do fwprop for addresses in
fwprop1 even though CSE1 used to do that.

This does not make a difference for the FSF GCC as we don't split
load/stores for the SPU early yet; Trevor has mentioned to me that he
is working on submitting that patch to the FSF but I don't know the
time frame on that.  I wanted to get this upstream as soon as
possible.

OK for trunk and 4.3.3? Bootstrapped and tested on i386-darwin,
powerpc64-linux-gnu and spu-elf with no regressions.
It would be nice if someone benchmarked this patch for another target
but I benchmarked this for spu-elf with our internal GCC 4.3.0 and the
code size was about 0.2% smaller and 0.1% faster.  Nothing big but it
is a code size win.

Thanks,
Andrew Pinski

ChangeLog:

* fwprop.c (fwprop): Check that the loop_father is the outer loop.
(fwprop_addr): Check that the loop_father is not the outer loop.

Attachment: fixfwprop.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]