This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Builtins and C++ and such (take 2)
- From: Roger Sayle <roger at eyesopen dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: Benjamin Kosnik <bkoz at redhat dot com>, Jason Merrill <jason at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Mon, 25 Mar 2002 07:56:34 -0700 (MST)
- Subject: Re: [PATCH] Builtins and C++ and such (take 2)
Hi Mark,
Many thanks for reviewing the g++ changes.
> This version looks good to me. As I read it, the V3 change is only
> necessary to make the builtin optimization work -- without it, V3
> would still work, but we would get the unoptimized version of the
> builtins, correct?
Not quite. Without the change to <cmath> there are two regressions
in the libstdc++-v3 test suite, both in 26_numerics.
One side-effect of disabling the built-in, is that functions that
used to get C linkage due to the previously anticipated prototype,
end up with C++ linkage. This results in warnings about unresolved
references to std::abs and std::sqrt during linking (which should
be references to _abs and _sqrt).
Alternative fixes include either compiling libstdc++.so with the
-fno-builtin flag, or explictly adding an extern "C++" linkage for
these functions to the libstdc++ library. Ben, any preferences?
Simply re-ordering statements in cmath had the dual benefits of
fixing the linkage errors and enabling the builtin optimizations.
> If that is so, the patch is fine for mainline and branch.
Alas I don't have CVS write privileges. But we should wait for
the libstc++ issues to be resolved before proceeding.
Many thanks once again.
Roger
--
Roger Sayle, E-mail: roger@eyesopen.com
OpenEye Scientific Software, WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road, Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507. Fax: (+1) 505-473-0833