This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/36684] [4.3/4.4 Regression] spill failure for class 'R0_REGS' on sh4 with -fPIC -O2
- From: "kkojima at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Jul 2008 03:50:59 -0000
- Subject: [Bug target/36684] [4.3/4.4 Regression] spill failure for class 'R0_REGS' on sh4 with -fPIC -O2
- References: <bug-36684-16403@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from kkojima at gcc dot gnu dot org 2008-07-02 03:50 -------
SH backend enables insn scheduling before reload for SH4 when
the estimated R0 register pressure is low. This PR reveals
that it doesn't work well for PIC which will make many implicit
R0 uses. It seems that there is no easy way to compute accurate
R0 register pressure in that case. I'm testing the patch below.
--- ORIG/trunk/gcc/config/sh/sh.h 2008-05-23 07:30:02.000000000 +0900
+++ INTEST/trunk/gcc/config/sh/sh.h 2008-07-02 08:41:42.000000000 +0900
@@ -712,8 +712,8 @@ do {
\
to the pressure on R0. */ \
/* Enable sched1 for SH4; ready queue will be reordered by \
the target hooks when pressure is high. We can not do this for \
- SH3 and lower as they give spill failures for R0. */ \
- if (!TARGET_HARD_SH4) \
+ PIC, SH3 and lower as they give spill failures for R0. */ \
+ if (!TARGET_HARD_SH4 || flag_pic)
\
flag_schedule_insns = 0; \
/* ??? Current exception handling places basic block boundaries \
after call_insns. It causes the high pressure on R0 and gives \
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36684