This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: undef'ed C++/dwarf labels, was: Failed compile (namespaces)


	The exact same source hosting and targeting Linux does finish the build,
	making me wonder if it's a dwarf thing, though I see no changelogs for
	dwarf*.c.

This is usually a C++ front end problem, though it is possible that a C++
front end change has exposed a latent dwarf bug.  In this case, it appears
to be a bit of both.

This is related to the C++ namespace changes.

We are emitting bad assembly code for the built-in "global type" which is
used to represent the global namespace.  dwarf2out.c has slightly different
code, and doesn't run into this problem.  Since I have no easy way to
reproduce the problem, I tried writing the safest dwarfout.c patch to avoid it.

I also think that the C++ front end shouldn't be using a LANG_TYPE tree.
There is no way for the back end debug info files to handle them, because
it can't know anything about them.  It would be better if there was some
language independent way to represent the global namespace.

1998-05-18  Jim Wilson  <wilson@cygnus.com>

	* dwarfout.c (dwarfout_file_scope_decl, case TYPE_DECL): Ignore
	LANG_TYPE trees with DECL_SOURCE_LINE of 0.

Index: dwarfout.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/dwarfout.c,v
retrieving revision 1.19
diff -p -r1.19 dwarfout.c
*** dwarfout.c	1998/05/06 21:06:55	1.19
--- dwarfout.c	1998/05/19 04:15:49
*************** dwarfout_file_scope_decl (decl, set_fina
*** 5185,5192 ****
  	 really need to output these (non-fundamental) types because other
  	 DIEs may contain references to them.  */
  
        if (DECL_SOURCE_LINE (decl) == 0
! 	  && type_is_fundamental (TREE_TYPE (decl)))
  	return;
  
        /* If we are in terse mode, don't generate any DIEs to represent
--- 5185,5202 ----
  	 really need to output these (non-fundamental) types because other
  	 DIEs may contain references to them.  */
  
+       /* Also ignore language dependent types here, because they are probably
+ 	 also built-in types.  If we didn't ignore them, then we would get
+ 	 references to undefined labels because output_type doesn't support
+ 	 them.   So, for now, we need to ignore them to avoid assembler
+ 	 errors.  */
+ 
+       /* ??? This code is different than the equivalent code in dwarf2out.c.
+ 	 The dwarf2out.c code is probably more correct.  */
+ 
        if (DECL_SOURCE_LINE (decl) == 0
! 	  && (type_is_fundamental (TREE_TYPE (decl))
! 	      || TREE_CODE (TREE_TYPE (decl)) == LANG_TYPE))
  	return;
  
        /* If we are in terse mode, don't generate any DIEs to represent


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]