c-common.h (DECL_C_HARD_REGISTER): New.
authorRichard Henderson <rth@redhat.com>
Sun, 26 Nov 2000 00:40:46 +0000 (16:40 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Sun, 26 Nov 2000 00:40:46 +0000 (16:40 -0800)
        * 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.

From-SVN: r37748

gcc/ChangeLog
gcc/c-common.h
gcc/c-decl.c
gcc/c-semantics.c

index 33f3d53ba675102758f076733ba7f889bfa2e411..e6497ee9d74ab099ce92cda5cce7e0b1ea2a1685 100644 (file)
@@ -1,3 +1,9 @@
+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
index b27c76069a80dbc2eaa9c3dc396c3d3e12804e21..94c89cfce14f1377815365f0f9ce4d72cb890440 100644 (file)
@@ -686,6 +686,10 @@ extern int anon_aggr_type_p                     PARAMS ((tree));
 #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));
index 780681929870a25f374a43191c45cbd353a8e588..7653479a280e9af19a8d77bfb620a950deb10c35 100644 (file)
@@ -3765,7 +3765,10 @@ finish_decl (decl, init, asmspec_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);
        }
 
index 8988680415e04448ef68e4ed99589d2bb20d3d99..d5150ba45f4cb9ab9ff2477751bf046310224d7a 100644 (file)
@@ -313,9 +313,9 @@ emit_local_var (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);