austern 02/11/01 13:56:02
Modified: live/gcc3/gcc/cp decl.c
Log:
Bug #: 3011026
Reviewed by: mrs
Fix coalescing bug: static local varriables in a function should be marked
coalesced iff the function is. Also checked into pre-import branch and
into fearless-kitty branch.
Revision Changes Path
1.121 +9 -8 src/live/gcc3/gcc/cp/decl.c
Index: decl.c
===================================================================
RCS file: /cvs/Darwin/src/live/gcc3/gcc/cp/decl.c,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -r1.120 -r1.121
--- decl.c 2002/10/24 23:46:37 1.120
+++ decl.c 2002/11/01 21:56:01 1.121
@@ -7947,6 +7947,13 @@
inlined. */
if (! flag_weak)
{
+ /* APPLE LOCAL begin coalescing */
+#ifdef MAKE_DECL_COALESCED
+ if (DECL_INTERFACE_KNOWN (current_function_decl))
+ DECL_EXTERNAL (decl) = DECL_EXTERNAL (current_function_decl);
+ TREE_PUBLIC (decl) = 1;
+ MAKE_DECL_COALESCED (decl);
+#else
if (DECL_INTERFACE_KNOWN (current_function_decl))
{
TREE_PUBLIC (decl) = 1;
@@ -7958,14 +7965,6 @@
TREE_PUBLIC (decl) = 1;
DECL_COMMON (decl) = 1;
}
- /* APPLE LOCAL coalescing */
-#ifdef MAKE_DECL_COALESCED
- else
- {
- /* A coalesced symbol is similar to an ELF weak symbol. */
- MAKE_DECL_COALESCED (decl);
- }
-#endif
/* else we lose. We can only do this if we can use common,
which we can't if it has been initialized. */
@@ -7974,6 +7973,8 @@
cp_warning_at ("sorry: semantics of inline function static data `%#D'
are wrong (you'll wind up with multiple copies)", decl);
cp_warning_at (" you can work around this by removing the initializer",
decl);
}
+#endif
+ /* APPLE LOCAL end coalescing */
}
else
comdat_linkage (decl);