* c-decl.c (finish_decl): Set it for asm register variables.
* c-semantics.c (emit_local_var): Test it when instantiating one.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37748
138bc75d-0d04-0410-961f-
82ee72b054a4
2000-11-25 Richard Henderson <rth@redhat.com>
+ * c-common.h (DECL_C_HARD_REGISTER): New.
+ * c-decl.c (finish_decl): Set it for asm register variables.
+ * c-semantics.c (emit_local_var): Test it when instantiating one.
+
+2000-11-25 Richard Henderson <rth@redhat.com>
+
* c-decl.c (c_expand_body): Use DECL_SOURCE_LINE rather than
lineno for the start of the function.
#define CLEAR_DECL_C_BIT_FIELD(NODE) \
(DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) = 0)
+/* In a VAR_DECL, nonzero if the decl is a register variable with
+ an explicit asm specification. */
+#define DECL_C_HARD_REGISTER(DECL) DECL_LANG_FLAG_4 (VAR_DECL_CHECK (DECL))
+
extern void emit_local_var PARAMS ((tree));
extern void make_rtl_for_local_static PARAMS ((tree));
extern tree expand_cond PARAMS ((tree));
else
{
if (asmspec)
- DECL_ASSEMBLER_NAME (decl) = get_identifier (asmspec);
+ {
+ DECL_ASSEMBLER_NAME (decl) = get_identifier (asmspec);
+ DECL_C_HARD_REGISTER (decl) = 1;
+ }
add_decl_stmt (decl);
}
/* Create RTL for this variable. */
if (!DECL_RTL (decl))
{
- if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
- /* The user must have specified an assembler name for this
- variable. Set that up now. */
+ if (DECL_C_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);