Commit 8af11e80 by Jan Hubicka Committed by Jan Hubicka

varasm.c (notice_global_symbol): Fix handling of variables; avoid re-computing of variable.


	* varasm.c (notice_global_symbol):  Fix handling of variables; avoid
	re-computing of variable.

From-SVN: r72343
parent a28e846b
Sat Oct 11 12:24:23 CEST 2003 Jan Hubicka <jh@suse.cz>
* varasm.c (notice_global_symbol): Fix handling of variables; avoid
re-computing of variable.
2003-10-11 Richard Henderson <rth@redhat.com> 2003-10-11 Richard Henderson <rth@redhat.com>
* config/alpha/alpha.c (alpha_return_in_memory): Rename from * config/alpha/alpha.c (alpha_return_in_memory): Rename from
......
...@@ -1041,13 +1041,24 @@ default_ctor_section_asm_out_constructor (rtx symbol, ...@@ -1041,13 +1041,24 @@ default_ctor_section_asm_out_constructor (rtx symbol,
void void
notice_global_symbol (tree decl) notice_global_symbol (tree decl)
{ {
if ((!first_global_object_name || !weak_global_object_name) const char **type = &first_global_object_name;
&& TREE_PUBLIC (decl) && !DECL_COMMON (decl)
&& !DECL_EXTERNAL (decl) if (first_global_object_name
&& (TREE_CODE (decl) == FUNCTION_DECL || !TREE_PUBLIC (decl) || DECL_EXTERNAL (decl)
|| (TREE_CODE (decl) == VAR_DECL || !DECL_NAME (decl)
&& (DECL_INITIAL (decl) != 0 || (TREE_CODE (decl) != FUNCTION_DECL
&& DECL_INITIAL (decl) != error_mark_node)))) && (TREE_CODE (decl) != VAR_DECL
|| (DECL_COMMON (decl)
&& (DECL_INITIAL (decl) == 0
|| DECL_INITIAL (decl) == error_mark_node)))))
return;
/* We win when global object is found, but it is usefull to know about weak
symbol as well so we can produce nicer unique names. */
if (DECL_WEAK (decl) || DECL_ONE_ONLY (decl))
type = &weak_global_object_name;
if (!*type)
{ {
const char *p; const char *p;
char *name; char *name;
...@@ -1056,10 +1067,7 @@ notice_global_symbol (tree decl) ...@@ -1056,10 +1067,7 @@ notice_global_symbol (tree decl)
p = (* targetm.strip_name_encoding) (XSTR (XEXP (decl_rtl, 0), 0)); p = (* targetm.strip_name_encoding) (XSTR (XEXP (decl_rtl, 0), 0));
name = xstrdup (p); name = xstrdup (p);
if (! DECL_WEAK (decl) && ! DECL_ONE_ONLY (decl)) *type = name;
first_global_object_name = name;
else
weak_global_object_name = name;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment