GCC 3.0 Status Report
John David Anglin
dave@hiauly1.hia.nrc.ca
Thu Apr 19 13:07:00 GMT 2001
Forwarded message:
>From dave Thu Apr 19 16:06:10 EDT 2001
Subject: Re: GCC 3.0 Status Report
To: chastain@cygnus.com (Michael Elizabeth Chastain)
Date: Thu, 19 Apr 2001 16:06:10 -0400 (EDT)
From: "John David Anglin" <dave@hiauly1>
Cc: law@redhat.com, gcc@gcc.gnu.org, libstdc++@gcc.gnu.org,
gcc-patches@gc.gnu.org, mark@codesourcery.com
In-Reply-To: <200104182009.NAA09066@bosch.cygnus.com> from "Michael Elizabeth Chastain" at Apr 18, 2001 01:09:19 pm
X-Mailer: ELM [version 2.4 PL25]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 2093
> It's not a patch -- the patch fragment you see is the patch that
> broke g++ (I think). I don't know enough about g++ data structures
> to write a good patch.
Here is a fix for the undefined reference std::errno. The language
experts can debate whether it is the right thing to do. I have checked
that `namespace std { extern "C" int errno; }' is not mangled under
hpux and I don't see any regressions of the libstdc++ or g++ testsuite
under i686 linux.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
2001-04-18 John David Anglin <dave@hiauly1.hia.nrc.ca>
* mangle.c (mangle_decl_string): Don't mangle variables with
extern "C" linkage.
* decl.c (grokvardecl): Use full language declaration for `extern'
variables.
--- mangle.c.orig Tue Apr 17 14:38:43 2001
+++ mangle.c Wed Apr 18 20:29:54 2001
@@ -2093,9 +2093,11 @@
functions with C++ linkage. */
&& (!DECL_LANG_SPECIFIC (decl)
|| DECL_EXTERN_C_FUNCTION_P (decl)))
- /* The names of global variables aren't mangled either. */
+ /* The names of global and extern "C" variables aren't
+ mangled either. */
|| (TREE_CODE (decl) == VAR_DECL
- && CP_DECL_CONTEXT (decl) == global_namespace))
+ && (CP_DECL_CONTEXT (decl) == global_namespace
+ || (DECL_LANG_SPECIFIC (decl) && DECL_EXTERN_C_P (decl)))))
write_string (IDENTIFIER_POINTER (DECL_NAME (decl)));
else
{
--- decl.c.orig Mon Apr 16 17:58:53 2001
+++ decl.c Thu Apr 19 14:58:37 2001
@@ -9022,9 +9022,10 @@
else
context = NULL_TREE;
- if (processing_template_decl && context)
- /* For global variables, declared in a template, we need the
- full lang_decl. */
+ if (RIDBIT_SETP (RID_EXTERN, specbits)
+ || (processing_template_decl && context))
+ /* For `extern' variables or variables declared in a template,
+ we need the full lang_decl. */
decl = build_lang_decl (VAR_DECL, declarator, type);
else
decl = build_decl (VAR_DECL, declarator, type);
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
More information about the Gcc-patches
mailing list