From: rguenth Date: Tue, 6 Dec 2011 13:26:09 +0000 (+0000) Subject: 2011-12-06 Richard Guenther X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;ds=sidebyside;h=45dd47e2c8727c552cfe66e0a9e5b6610e73f115;p=pf3gnuchains%2Fgcc-fork.git 2011-12-06 Richard Guenther PR middle-end/50601 * varasm.c (assemble_alias): Move DECL_EXTERNAL implementation quirk adjustjment ... * passes.c (rest_of_decl_compilation): ... here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182048 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 76c8b183a16..f0cb27ab930 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2011-12-06 Richard Guenther + 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 + PR middle-end/51436 * gimple-fold.c (gimplify_and_update_call_from_tree): Guard vdef check for the fact we do not have virtual operands when diff --git a/gcc/passes.c b/gcc/passes.c index a3512419ee2..d060bb4ae3d 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -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); } } diff --git a/gcc/varasm.c b/gcc/varasm.c index 8d555487818..78dc4cd83f0 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -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;