summaryrefslogtreecommitdiff
path: root/gcc/passes.c
diff options
context:
space:
mode:
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-05 05:52:01 +0000
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-05 05:52:01 +0000
commitb2c4af5e79a1c17df9214775988a66dac92f2667 (patch)
treedd22110790902e6a0fb0065c11210552323ea19e /gcc/passes.c
parentdffd35e9cbc1fc31997e74bcbccfab6a0d5327a6 (diff)
downloadgcc-b2c4af5e79a1c17df9214775988a66dac92f2667.tar.gz
2004-08-04 Geoffrey Keating <geoffk@apple.com>
PR 14516 * c-common.c (c_expand_decl): Don't special-case static VAR_DECLs. * c-common.h (make_rtl_for_local_static): Delete. * c-decl.c (shadow_tag_warned): Clean up comment. (finish_decl): Clean up spacing. Use set_user_assembler_name when appropriate. Don't pass asmspec to rest_of_decl_compilation. * c-semantics.c (make_rtl_for_local_static): Delete. * expr.c (init_block_move_fn): Use set_user_assembler_name. (init_block_clear_fn): Likewise. * passes.c (rest_of_decl_compilation): Remove asmspec parameter, expect it to be in DECL_ASSEMBLER_NAME. Update callers in many files. * toplev.h (rest_of_decl_compilation): Remove asmspec parameter. * tree.h (make_decl_rtl): Remove second parameter. (set_user_assembler_name): New. * varasm.c (set_user_assembler_name): New. (make_decl_rtl): Remove second parameter. Update callers in many files. Index: cp/ChangeLog 2004-08-04 Geoffrey Keating <geoffk@apple.com> * decl.c (make_rtl_for_nonlocal_decl): Set DECL_ASSEMBLER_NAME rather than passing it as a parameter to rest_of_decl_compilation. * decl2.c (grokfield): Use set_user_assembler_name. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85593 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/passes.c')
-rw-r--r--gcc/passes.c36
1 files changed, 10 insertions, 26 deletions
diff --git a/gcc/passes.c b/gcc/passes.c
index 4b50a1f5a41..2f625c57a6d 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -320,18 +320,16 @@ close_dump_file (enum dump_file_index index,
and TYPE_DECL nodes.
This does nothing for local (non-static) variables, unless the
- variable is a register variable with an ASMSPEC. In that case, or
- if the variable is not an automatic, it sets up the RTL and
- outputs any assembler code (label definition, storage allocation
- and initialization).
+ variable is a register variable with DECL_ASSEMBLER_NAME set. In
+ that case, or if the variable is not an automatic, it sets up the
+ RTL and outputs any assembler code (label definition, storage
+ allocation and initialization).
- DECL is the declaration. If ASMSPEC is nonzero, it specifies
- the assembler symbol name to be used. TOP_LEVEL is nonzero
+ DECL is the declaration. TOP_LEVEL is nonzero
if this declaration is not within a function. */
void
rest_of_decl_compilation (tree decl,
- const char *asmspec,
int top_level,
int at_end)
{
@@ -348,6 +346,11 @@ rest_of_decl_compilation (tree decl,
}
}
+ /* Can't defer this, because it needs to happen before any
+ later function definitions are processed. */
+ if (DECL_REGISTER (decl) && DECL_ASSEMBLER_NAME_SET_P (decl))
+ make_decl_rtl (decl);
+
/* Forward declarations for nested functions are not "external",
but we need to treat them as if they were. */
if (TREE_STATIC (decl) || DECL_EXTERNAL (decl)
@@ -355,9 +358,6 @@ rest_of_decl_compilation (tree decl,
{
timevar_push (TV_VARCONST);
- if (asmspec)
- make_decl_rtl (decl, asmspec);
-
/* Don't output anything when a tentative file-scope definition
is seen. But at end of compilation, do output code for them.
@@ -393,22 +393,6 @@ rest_of_decl_compilation (tree decl,
timevar_pop (TV_VARCONST);
}
- else if (DECL_REGISTER (decl) && asmspec != 0)
- {
- if (decode_reg_name (asmspec) >= 0)
- {
- SET_DECL_RTL (decl, NULL_RTX);
- make_decl_rtl (decl, asmspec);
- }
- else
- {
- error ("%Hinvalid register name `%s' for register variable",
- &DECL_SOURCE_LOCATION (decl), asmspec);
- DECL_REGISTER (decl) = 0;
- if (!top_level)
- expand_decl (decl);
- }
- }
else if (TREE_CODE (decl) == TYPE_DECL)
{
timevar_push (TV_SYMOUT);