decl.c (make_rtl_for_nonlocal_decl): Set DECL_C_HARD_REGISTER for `register' variable...
authorMark Mitchell <mark@codesourcery.com>
Thu, 12 Jul 2001 07:50:58 +0000 (07:50 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 12 Jul 2001 07:50:58 +0000 (07:50 +0000)
* decl.c (make_rtl_for_nonlocal_decl): Set DECL_C_HARD_REGISTER
for `register' variables with an asm-specification.

From-SVN: r43963

gcc/cp/ChangeLog
gcc/cp/decl.c

index 486533b44cfb9ccb195abeb131311ac3e37aa0c4..3d8f346349eaf426d453a1dff135dca003a1076b 100644 (file)
@@ -1,3 +1,8 @@
+2001-07-12  Mark Mitchell  <mark@codesourcery.com>
+
+       * decl.c (make_rtl_for_nonlocal_decl): Set DECL_C_HARD_REGISTER
+       for `register' variables with an asm-specification.
+
 2001-07-11  Mark Mitchell  <mark@codesourcery.com>
 
        * semantics.c (finish_asm_stmt): Mark the output operands
index 5de715086267d8f4cc9e73ffe03d0fcb8d91878a..c0e9b85a4718552e720edb9c3c03e63104e4b0cc 100644 (file)
@@ -7806,7 +7806,14 @@ make_rtl_for_nonlocal_decl (decl, init, asmspec)
 
   /* Set the DECL_ASSEMBLER_NAME for the variable.  */
   if (asmspec)
-    SET_DECL_ASSEMBLER_NAME (decl, get_identifier (asmspec));
+    {
+      SET_DECL_ASSEMBLER_NAME (decl, get_identifier (asmspec));
+      /* The `register' keyword, when used together with an
+        asm-specification, indicates that the variable should be
+        placed in a particular register.  */
+      if (DECL_REGISTER (decl))
+       DECL_C_HARD_REGISTER (decl) = 1;
+    }
 
   /* We don't create any RTL for local variables.  */
   if (DECL_FUNCTION_SCOPE_P (decl) && !TREE_STATIC (decl))