public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Question about a varasm change
@ 2000-09-15  3:25 Bernd Schmidt
  2000-09-18  0:24 ` Jason Merrill
  0 siblings, 1 reply; 7+ messages in thread
From: Bernd Schmidt @ 2000-09-15  3:25 UTC (permalink / raw)
  To: jason; +Cc: gcc

I have a question about the patch below which was applied in March.  It
appears to be causing us to generate incorrect debugging information with
static local variables in C.  The following testcase is from Fred Fish:

  void foo ()
  {
    static int funclocal = 101;
  }

The correct output is supposed to be

  .stabs "funclocal:V1",38,0,3,funclocal.3

while the current compiler produces

  .stabs "funclocal.0:V1",38,0,3,funclocal.0

The code in dbxout_symbol_name uses DECL_ASSEMBLER_NAME to print the first
string.  DECL_ASSEMBLER_NAME has the correct value ("funclocal") in the
beginning when it's created by build_decl, but it gets overwritten with
"funclocal.0" in make_decl_rtl with the change below installed.

What does the change accomplish, and do you have an idea how to fix this
problem?


Bernd

2000-03-03  Jason Merrill  <jason@casey.cygnus.com>

        * varasm.c (make_function_rtl): If we change the name used in the
	rtl, update DECL_ASSEMBLER_NAME accordingly.
	(make_decl_rtl): Likewise.

Index: varasm.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/varasm.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -p -r1.101 -r1.102
--- varasm.c	2000/03/02 23:30:38	1.101
+++ varasm.c	2000/03/04 00:48:46	1.102
@@ -553,6 +553,7 @@ make_function_rtl (decl)
 
   if (DECL_RTL (decl) == 0)
     {
+      DECL_ASSEMBLER_NAME (decl) = get_identifier (name);
       DECL_RTL (decl)
 	= gen_rtx_MEM (DECL_MODE (decl),
 		       gen_rtx_SYMBOL_REF (Pmode, name));
@@ -792,6 +793,7 @@ make_decl_rtl (decl, asmspec, top_level)
 	      name = new_name;
 	    }
 
+	  DECL_ASSEMBLER_NAME (decl) = get_identifier (name);
 	  DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl),
 					 gen_rtx_SYMBOL_REF (Pmode, name));
 	  MEM_ALIAS_SET (DECL_RTL (decl)) = get_alias_set (decl);

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-09-22 10:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-15  3:25 Question about a varasm change Bernd Schmidt
2000-09-18  0:24 ` Jason Merrill
2000-09-18  2:32   ` Bernd Schmidt
2000-09-18  8:34     ` Jeffrey A Law
2000-09-19  8:34       ` Bernd Schmidt
2000-09-21 14:28         ` Jason Merrill
2000-09-22 10:56           ` Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).