Commit bbee5843 by Steven Bosscher

toplev.c (check_global_declaration_1): Do not call assemble_external.

	* toplev.c (check_global_declaration_1): Do not call assemble_external.
	* expr.c (emit_block_move_libcall_fn): Likewise.
	(clear_storage_libcall_fn): Likewise.
	(expand_expr_addr_expr_1): Likewise.
	(expand_expr_real_1): Likewise.
	* calls.c (rtx_for_function_call): Likewise.

From-SVN: r185813
parent ffe5d708
2012-03-26 Steven Bosscher <steven@gcc.gnu.org> 2012-03-26 Steven Bosscher <steven@gcc.gnu.org>
* toplev.c (check_global_declaration_1): Do not call assemble_external.
* expr.c (emit_block_move_libcall_fn): Likewise.
(clear_storage_libcall_fn): Likewise.
(expand_expr_addr_expr_1): Likewise.
(expand_expr_real_1): Likewise.
* calls.c (rtx_for_function_call): Likewise.
* varasm.c (assemble_external): Assert this function is only called * varasm.c (assemble_external): Assert this function is only called
during or after expanding to RTL. during or after expanding to RTL.
......
...@@ -1642,13 +1642,8 @@ rtx_for_function_call (tree fndecl, tree addr) ...@@ -1642,13 +1642,8 @@ rtx_for_function_call (tree fndecl, tree addr)
/* Get the function to call, in the form of RTL. */ /* Get the function to call, in the form of RTL. */
if (fndecl) if (fndecl)
{ {
/* If this is the first use of the function, see if we need to
make an external definition for it. */
if (!TREE_USED (fndecl) && fndecl != current_function_decl) if (!TREE_USED (fndecl) && fndecl != current_function_decl)
{ TREE_USED (fndecl) = 1;
assemble_external (fndecl);
TREE_USED (fndecl) = 1;
}
/* Get a SYMBOL_REF rtx for the function address. */ /* Get a SYMBOL_REF rtx for the function address. */
funexp = XEXP (DECL_RTL (fndecl), 0); funexp = XEXP (DECL_RTL (fndecl), 0);
......
...@@ -1375,8 +1375,7 @@ emit_block_move_via_libcall (rtx dst, rtx src, rtx size, bool tailcall) ...@@ -1375,8 +1375,7 @@ emit_block_move_via_libcall (rtx dst, rtx src, rtx size, bool tailcall)
} }
/* A subroutine of emit_block_move_via_libcall. Create the tree node /* A subroutine of emit_block_move_via_libcall. Create the tree node
for the function we use for block copies. The first time FOR_CALL for the function we use for block copies. */
is true, we call assemble_external. */
static GTY(()) tree block_move_fn; static GTY(()) tree block_move_fn;
...@@ -1419,7 +1418,6 @@ emit_block_move_libcall_fn (int for_call) ...@@ -1419,7 +1418,6 @@ emit_block_move_libcall_fn (int for_call)
{ {
emitted_extern = true; emitted_extern = true;
make_decl_rtl (block_move_fn); make_decl_rtl (block_move_fn);
assemble_external (block_move_fn);
} }
return block_move_fn; return block_move_fn;
...@@ -2747,8 +2745,7 @@ set_storage_via_libcall (rtx object, rtx size, rtx val, bool tailcall) ...@@ -2747,8 +2745,7 @@ set_storage_via_libcall (rtx object, rtx size, rtx val, bool tailcall)
} }
/* A subroutine of set_storage_via_libcall. Create the tree node /* A subroutine of set_storage_via_libcall. Create the tree node
for the function we use for block clears. The first time FOR_CALL for the function we use for block clears. */
is true, we call assemble_external. */
tree block_clear_fn; tree block_clear_fn;
...@@ -2791,7 +2788,6 @@ clear_storage_libcall_fn (int for_call) ...@@ -2791,7 +2788,6 @@ clear_storage_libcall_fn (int for_call)
{ {
emitted_extern = true; emitted_extern = true;
make_decl_rtl (block_clear_fn); make_decl_rtl (block_clear_fn);
assemble_external (block_clear_fn);
} }
return block_clear_fn; return block_clear_fn;
...@@ -7413,11 +7409,8 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -7413,11 +7409,8 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode,
result = XEXP (result, 0); result = XEXP (result, 0);
/* ??? Is this needed anymore? */ /* ??? Is this needed anymore? */
if (DECL_P (exp) && !TREE_USED (exp) == 0) if (DECL_P (exp))
{ TREE_USED (exp) = 1;
assemble_external (exp);
TREE_USED (exp) = 1;
}
if (modifier != EXPAND_INITIALIZER if (modifier != EXPAND_INITIALIZER
&& modifier != EXPAND_CONST_ADDRESS && modifier != EXPAND_CONST_ADDRESS
...@@ -9012,11 +9005,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9012,11 +9005,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
/* Ensure variable marked as used even if it doesn't go through /* Ensure variable marked as used even if it doesn't go through
a parser. If it hasn't be used yet, write out an external a parser. If it hasn't be used yet, write out an external
definition. */ definition. */
if (! TREE_USED (exp)) TREE_USED (exp) = 1;
{
assemble_external (exp);
TREE_USED (exp) = 1;
}
/* Show we haven't gotten RTL for this yet. */ /* Show we haven't gotten RTL for this yet. */
temp = 0; temp = 0;
......
...@@ -486,7 +486,6 @@ check_global_declaration_1 (tree decl) ...@@ -486,7 +486,6 @@ check_global_declaration_1 (tree decl)
warning (OPT_Wunused_function, "%q+F declared %<static%> but never defined", decl); warning (OPT_Wunused_function, "%q+F declared %<static%> but never defined", decl);
/* This symbol is effectively an "extern" declaration now. */ /* This symbol is effectively an "extern" declaration now. */
TREE_PUBLIC (decl) = 1; TREE_PUBLIC (decl) = 1;
assemble_external (decl);
} }
/* Warn about static fns or vars defined but not used. */ /* Warn about static fns or vars defined but not used. */
...@@ -591,7 +590,7 @@ compile_file (void) ...@@ -591,7 +590,7 @@ compile_file (void)
output_shared_constant_pool (); output_shared_constant_pool ();
output_object_blocks (); output_object_blocks ();
finish_tm_clone_pairs (); finish_tm_clone_pairs ();
/* Write out any pending weak symbol declarations. */ /* Write out any pending weak symbol declarations. */
weak_finish (); weak_finish ();
......
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