This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch RFC] SH: PR target/22553
- From: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: gcc-patches at gcc dot gnu dot org
- Cc: joern dot rennecke at st dot com, aoliva at redhat dot com
- Date: Sun, 25 Sep 2005 09:52:36 +0900 (JST)
- Subject: [patch RFC] SH: PR target/22553
Hi,
It seems that target/22553 is one of the 4.1 regressions which
is critial for sh4-*-linux-gnu. It causes the build failure
during libstdc++ build on some systems, though my nightly builds
on this target couldn't catch it because I'm using slightly
different libc headers with those of the reporter of that PR.
The reduced testcase in #2 of the audit trail of the PR fails
even with the 4.0 compiler.
Taking a look at it, it seems to be the problem of the first
scheduling pass in PIC case.
The attached patch is to stop sched1 for PIC SH4. It might be
papering over a real problem elsewhere, but I have no other idea.
BTW, I've run CSiBE to compare the runtime performances with and
without -fno-schedule-insns in PIC on sh4-unknown-linux-gnu:
--
test name sched1 no-sched1 sched1/no-sched1
bzip2-1.0.2 bzip2.c 46.34 45.21 1.02499
bzip2-1.0.2 bzip2.d 10.45 10.43 1.00192
bzip2-1.0.2 bzip2recover 5.23 5.29 0.988658
compiler vam.fact 1.69 1.66 1.01807
compiler vam.fib 1.76 1.78 0.988764
compiler vam.test2 0.24 0.24 1
flex-2.5.31 flex 17.41 17.32 1.0052
jpeg-6b cjpeg2 3.70 3.73 0.991957
jpeg-6b cjpeg0 0.58 0.59 0.983051
jpeg-6b cjpeg1 3.71 3.67 1.0109
jpeg-6b djpeg0 0.43 0.42 1.02381
jpeg-6b djpeg1 2.72 2.76 0.985507
jpeg-6b djpeg2 2.80 2.80 1
jpeg-6b jpegtran0 0.32 0.31 1.03226
jpeg-6b jpegtran1 2.24 2.26 0.99115
jpeg-6b jpegtran2 5.22 5.26 0.992395
libpng-1.2.5 png2pnm0 1.12 1.12 1
libpng-1.2.5 png2pnm1 8.15 8.26 0.986683
libpng-1.2.5 pnm2png0 7.23 7.25 0.997241
libpng-1.2.5 pnm2png1 40.69 40.88 0.995352
teem-1.6.0-src src/hex/dehex0 1.77 1.78 0.994382
teem-1.6.0-src src/hex/dehex1 11.69 11.68 1.00086
teem-1.6.0-src src/hex/enhex0 5.56 5.56 1
teem-1.6.0-src src/hex/enhex1 36.44 36.52 0.997809
zlib-1.1.4 minigzip 6.28 6.24 1.00641
zlib-1.1.4 minigzip0 54.29 53.32 1.01819
where
sched1: runtime(sec) with -O2 -fPIC
no-sched1: runtime(sec) with -O2 -fPIC -fno-schedule-insns
--
It looks that the first scheduling optimization doesn't appeal in
this case and is just a waste of compile time. Perhaps it's a
rationale of this patch, though it's irrelevant to the PR.
The patch is tested with bootstrap and the toplevel "make -k check"
with no new failures on sh4-unknown-linux-gnu.
Regards,
kaz
--
:ADDPATCH target:
2005-09-24 Kaz Kojima <kkojima@gcc.gnu.org>
PR target/22553
* config/sh/sh.h (OVERRIDE_OPTIONS): Clear flag_schedule_insns
for PIC even in SH4.
--- ORIG/gcc/gcc/config/sh/sh.h 2005-09-13 05:56:10.000000000 +0900
+++ LOCAL/gcc/gcc/config/sh/sh.h 2005-09-24 09:41:41.000000000 +0900
@@ -659,7 +659,8 @@ do { \
/* 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) \
+ /* Disable sched1 for PIC to avoid spill failures for R0. */ \
+ if (!TARGET_HARD_SH4 || flag_pic) \
flag_schedule_insns = 0; \
} \
\