c-semantics.c (make_rtl_for_local_static): Don't clobber DECL_ASSEMBLER_NAME.
* c-semantics.c (make_rtl_for_local_static): Don't clobber DECL_ASSEMBLER_NAME. From-SVN: r37112
This commit is contained in:
parent
8763704d9b
commit
2c21b2473c
2 changed files with 24 additions and 8 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2000-10-28 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
|
* c-semantics.c (make_rtl_for_local_static): Don't clobber
|
||||||
|
DECL_ASSEMBLER_NAME.
|
||||||
|
|
||||||
2000-10-28 Joseph S. Myers <jsm28@cam.ac.uk>
|
2000-10-28 Joseph S. Myers <jsm28@cam.ac.uk>
|
||||||
|
|
||||||
* configure.in: Determine and substitute gcc_version_full.
|
* configure.in: Determine and substitute gcc_version_full.
|
||||||
|
|
|
@ -281,14 +281,25 @@ make_rtl_for_local_static (decl)
|
||||||
if (TREE_ASM_WRITTEN (decl))
|
if (TREE_ASM_WRITTEN (decl))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
|
/* 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
|
||||||
/* The only way this situaton can occur is if the
|
local variable, its DECL_ASSMEMBLER_NAME got hacked up to prevent
|
||||||
user specified a name for this DECL using the
|
clashes with other local statics with the same name by a previous
|
||||||
`attribute' syntax. */
|
call to make_decl_rtl), or the user explicitly requested a
|
||||||
asmspec = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
|
particular assembly name for this variable, using the GNU
|
||||||
DECL_ASSEMBLER_NAME (decl) = DECL_NAME (decl);
|
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 (decl))
|
||||||
|
asmspec = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
|
||||||
|
|
||||||
rest_of_decl_compilation (decl, asmspec, /*top_level=*/0, /*at_end=*/0);
|
rest_of_decl_compilation (decl, asmspec, /*top_level=*/0, /*at_end=*/0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue