This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: fixincludes hack for solaris11 c99-math testsuite failures
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: "Mark Mitchell" <mark at codesourcery dot com>
- Cc: <bkorb at gnu dot org>, <gcc-patches at gcc dot gnu dot org>, <andreast-list at fgznet dot ch>, <ro at techfak dot uni-bielefeld dot de>
- Date: Mon, 18 Feb 2008 21:17:39 -0700
- Subject: Re: [PATCH]: fixincludes hack for solaris11 c99-math testsuite failures
- References: <Pine.GSO.4.58.0802171242530.325@caipclassic.rutgers.edu> <47BA239A.2030602@codesourcery.com>
From: "Mark Mitchell" <mark@codesourcery.com>
Kaveh R. GHAZI wrote:
I don't think it's a good idea to limit the fix to Solaris 11. It's
desirable to make a Solaris 10 compiler binary package work on Solaris 11,
if you rerun the fixincludes bits. That's why we package that with the
installed compiler -- we want people to be able to rerun.
So, if we want to fixinclude this, we should do something that detects at
the point of running fixincludes, not based on the target configuration.
But isn't this just a Solaris run-time library defect? Presumably if you
build the same code with Sun's compiler, you'd have the same bug.
No it's not a runtime library issue. Sun's compiler doesn't emit library
calls to implement the FP classification macros. It has compiler builtins
and the header reflects this by using them in the macros for Sun C. GCC-4.3
also has compiler builtins for these. Sun wanted to be GCC-friendly in
their header but since they don't know what version of GCC a user might
install, they tried to write generic implementations inside a GNUC clause of
their header that didn't rely on a GCC builtin, so e.g. a user installing
older gcc like 4.2 would still hav it work. They almost got it right, but
isinf is broken, and presumably only for GCC.
The header looks like this:
#ifdef __GNUC__
various generic FP classifications macros
buggy isinf()
#else
various Sun-specific FP classification macros calling Sun C builtins
solaris C's isinf() version calling a builtin
#endif
In theory we could ask Sun to fix their header, but if that was our approach
it would eliminate the rationale for any fixinclude hack.
With regards to limiting it (or not) to solaris11, I could very easily take
out the "mach" statement, or better still make it limited to "solaris2.*"
just to be conservative and not touch any other platforms. That would allow
carrying forward gcc binaries on solaris. The fix regex matches a very
specific pattern in one specific header file. So I'm comfortable relaxing
the solaris11 mach match.
While I can see a rationale for not installing it until after we branch, I
do think some form of this patch should be installed because it is a
correctness issue. And it's not a bug in the Sun runtime library. While it
is a bug in the header Sun wrote, having a fixinclude hack is exacly the way
we address these things.
So would you please reconsider and okay it for mainline?
Thanks,
--Kaveh
--
Kaveh R. Ghazi