Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Softfloat miscompiled by gcc 4.5.x

Inspired by the tests done by SAITOH Masanobu, I narrowed down the -O2
miscompilation a bit more. The attached patch uses -O1 for all softfloat
source files, and keeps whatever other optimizations are used for the
reminder of libc (and the whole base system).

With this patch my shark goes down from 31 test failures (in -current)
to 13. The only remaining floating point related one is 

I'm tempted to just commit this as is plus an entry in doc/HACKS for
it, unless anyone wants to poke into gcc deeper.

Has anyone tried with gcc 4.7 yet?

Index: Makefile.inc
RCS file: /cvsroot/src/lib/libc/softfloat/Makefile.inc,v
retrieving revision 1.10
diff -c -u -r1.10 Makefile.inc
--- Makefile.inc        4 Jul 2011 02:53:15 -0000       1.10
+++ Makefile.inc        30 Sep 2012 21:06:27 -0000
@@ -26,3 +26,10 @@
      ${MACHINE_CPU} == "sh3")
 COPTS.softfloat.c+=    -Wno-enum-compare
+# XXX gcc seriously mis-optimizes some things in here
+.if defined(HAVE_GCC) && ${HAVE_GCC} == 45 && ${MACHINE_CPU} == "arm"
+.for i in ${SRCS.softfloat}
+COPTS.${i}+=   -O1

Home | Main Index | Thread Index | Old Index