austern     02/11/01 13:41:14

  Modified:    live/gcc3/gcc/cp Tag: pre-import-2002-10-21 decl.c
  Log:
  Bug #: 3011026
  Reviewed by: mrs
  Fixes a coalescing bug: make sure that static local variables are coalesced iff the 
function they're in is coalesced.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.119.2.1 +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.119
  retrieving revision 1.119.2.1
  diff -u -r1.119 -r1.119.2.1
  --- decl.c    2002/09/25 00:59:51     1.119
  +++ decl.c    2002/11/01 21:41:13     1.119.2.1
  @@ -8016,6 +8016,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;
  @@ -8027,14 +8034,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.  */
   
  @@ -8043,6 +8042,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);
  
  
  


Reply via email to