re PR middle-end/20263 (Incorrect asm for global register vars)
authorEric Botcazou <ebotcazou@libertysurf.fr>
Tue, 29 Mar 2005 12:08:54 +0000 (14:08 +0200)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 29 Mar 2005 12:08:54 +0000 (12:08 +0000)
PR middle-end/20263
* varasm.c (make_decl_rtl) [ASM_DECLARE_REGISTER_GLOBAL]: Use
the DECL_NAME, not the DECL_ASSEMBLER_NAME.

From-SVN: r97157

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/sparc-reg-1.c [new file with mode: 0644]
gcc/varasm.c

index ef0ccbffbb47416b98990cf29e63f285be5f9e21..cc7dedd3c24cd0944ae282f4d4f528e6c62d3cad 100644 (file)
@@ -1,3 +1,9 @@
+2005-03-29  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       PR middle-end/20263
+       * varasm.c (make_decl_rtl) [ASM_DECLARE_REGISTER_GLOBAL]: Use
+       the DECL_NAME, not the DECL_ASSEMBLER_NAME.
+
 2005-03-29  Dale Johannesen <dalej@apple.com>
 
        * Makefile.in (value-prof.o): New dependencies on $(DIAGNOSTIC_H)
index 73aa6eb1e1001997bccd72ebedd2a2a68b544ec8..6ba4ac90b8dba0a18815283030c3b6e68d0f5c50 100644 (file)
@@ -1,3 +1,7 @@
+2005-03-29  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * gcc.dg/sparc-reg-1.c: New test.
+
 2005-03-28  Steve Ellcey  <sje@cup.hp.com>
 
        PR target/19890
diff --git a/gcc/testsuite/gcc.dg/sparc-reg-1.c b/gcc/testsuite/gcc.dg/sparc-reg-1.c
new file mode 100644 (file)
index 0000000..8600942
--- /dev/null
@@ -0,0 +1,11 @@
+/* PR middle-end/20263 */
+
+/* { dg-do assemble { target sparc64-*-* } } */
+/* { dg-options "" } */
+
+register void *tp __asm__("%g7");
+
+void set_tp(void)
+{
+  tp = 0;
+} 
index c174eb4141462d3363b2090540fc64e270e47403..751c8bce959f6606c6b0c9cce72e056457908a29 100644 (file)
@@ -897,7 +897,6 @@ make_decl_rtl (tree decl)
 
   name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
 
-
   if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl))
     {
       reg_number = decode_reg_name (name);
@@ -940,6 +939,7 @@ make_decl_rtl (tree decl)
              /* Make this register global, so not usable for anything
                 else.  */
 #ifdef ASM_DECLARE_REGISTER_GLOBAL
+             name = IDENTIFIER_POINTER (DECL_NAME (decl));
              ASM_DECLARE_REGISTER_GLOBAL (asm_out_file, decl, reg_number, name);
 #endif
              nregs = hard_regno_nregs[reg_number][DECL_MODE (decl)];