aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-semantics.c
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@apple.com>2004-08-05 05:52:01 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>2004-08-05 05:52:01 +0000
commit0e6df31e198fd8c0ab0daacc631de05365c2c216 (patch)
treedd22110790902e6a0fb0065c11210552323ea19e /gcc/c-semantics.c
parent99b1c586a59f235bb36457739f40ffe98fb18b66 (diff)
downloadgcc-0e6df31e198fd8c0ab0daacc631de05365c2c216.zip
gcc-0e6df31e198fd8c0ab0daacc631de05365c2c216.tar.gz
gcc-0e6df31e198fd8c0ab0daacc631de05365c2c216.tar.bz2
re PR c/14516 (-fleading-underscore does not work correctly for file static variables)
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. From-SVN: r85593
Diffstat (limited to 'gcc/c-semantics.c')
-rw-r--r--gcc/c-semantics.c39
1 files changed, 1 insertions, 38 deletions
diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c
index f164c95..f40f5a2 100644
--- a/gcc/c-semantics.c
+++ b/gcc/c-semantics.c
@@ -195,41 +195,6 @@ build_stmt (enum tree_code code, ...)
return ret;
}
-/* Create RTL for the local static variable DECL. */
-
-void
-make_rtl_for_local_static (tree decl)
-{
- const char *asmspec = NULL;
-
- /* If we inlined this variable, we could see it's declaration
- again. */
- if (TREE_ASM_WRITTEN (decl))
- return;
-
- /* If the DECL_ASSEMBLER_NAME is not the same as the DECL_NAME, then
- either we already created RTL for this DECL (and since it was a
- local variable, its DECL_ASSEMBLER_NAME got hacked up to prevent
- clashes with other local statics with the same name by a previous
- call to make_decl_rtl), or the user explicitly requested a
- particular assembly name for this variable, using the GNU
- extension for this purpose:
-
- int i asm ("j");
-
- There's no way to know which case we're in, here. But, it turns
- out we're safe. If there's already RTL, then
- rest_of_decl_compilation ignores the ASMSPEC parameter, so we
- may as well not pass it in. If there isn't RTL, then we didn't
- already create RTL, which means that the modification to
- DECL_ASSEMBLER_NAME came only via the explicit extension. */
- if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl)
- && !DECL_RTL_SET_P (decl))
- asmspec = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
-
- rest_of_decl_compilation (decl, asmspec, /*top_level=*/0, /*at_end=*/0);
-}
-
/* Let the back-end know about DECL. */
void
@@ -241,9 +206,7 @@ emit_local_var (tree decl)
if (DECL_HARD_REGISTER (decl))
/* The user specified an assembler name for this variable.
Set that up now. */
- rest_of_decl_compilation
- (decl, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)),
- /*top_level=*/0, /*at_end=*/0);
+ rest_of_decl_compilation (decl, 0, 0);
else
expand_decl (decl);
}