re PR lto/50601 (New LTO failures)
authorRichard Guenther <rguenther@suse.de>
Tue, 6 Dec 2011 13:26:09 +0000 (13:26 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 6 Dec 2011 13:26:09 +0000 (13:26 +0000)
2011-12-06  Richard Guenther  <rguenther@suse.de>

PR middle-end/50601
* varasm.c (assemble_alias): Move DECL_EXTERNAL implementation
quirk adjustjment ...
* passes.c (rest_of_decl_compilation): ... here.

From-SVN: r182048

gcc/ChangeLog
gcc/passes.c
gcc/varasm.c

index 76c8b183a164e4a0644772212b2641eb78064006..f0cb27ab9301154b20f63294eb9abc168cd96851 100644 (file)
@@ -1,3 +1,10 @@
+2011-12-06  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/50601
+       * varasm.c (assemble_alias): Move DECL_EXTERNAL implementation
+       quirk adjustjment ...
+       * passes.c (rest_of_decl_compilation): ... here.
+
 2011-12-06  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/51436
index a3512419ee2a85ed69f6b89995c122b2b7cd4edb..d060bb4ae3d9b534134f3edc342b213941617d54 100644 (file)
@@ -156,6 +156,11 @@ rest_of_decl_compilation (tree decl,
       {
        alias = TREE_VALUE (TREE_VALUE (alias));
        alias = get_identifier (TREE_STRING_POINTER (alias));
+       /* A quirk of the initial implementation of aliases required that the
+          user add "extern" to all of them.  Which is silly, but now
+          historical.  Do note that the symbol is in fact locally defined.  */
+       if (!lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)))
+         DECL_EXTERNAL (decl) = 0;
        assemble_alias (decl, alias);
       }
   }
index 8d555487818a2d164949d69675ec365ea9ab5f39..78dc4cd83f018a0ab86bdae0905e390ba0c44ce9 100644 (file)
@@ -5794,14 +5794,11 @@ void
 assemble_alias (tree decl, tree target)
 {
   tree target_decl;
-  bool is_weakref = false;
 
   if (lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)))
     {
       tree alias = DECL_ASSEMBLER_NAME (decl);
 
-      is_weakref = true;
-
       ultimate_transparent_alias_target (&target);
 
       if (alias == target)
@@ -5839,12 +5836,6 @@ assemble_alias (tree decl, tree target)
     }
   TREE_USED (decl) = 1;
 
-  /* A quirk of the initial implementation of aliases required that the user
-     add "extern" to all of them.  Which is silly, but now historical.  Do
-     note that the symbol is in fact locally defined.  */
-  if (! is_weakref)
-    DECL_EXTERNAL (decl) = 0;
-
   /* Allow aliases to aliases.  */
   if (TREE_CODE (decl) == FUNCTION_DECL)
     cgraph_get_create_node (decl)->alias = true;