From: rfg@segfault.UUCP
Subject: Workaround fixes for svr4 woes with -g.
Reply-To: lupine!segfault!rfg@uunet.uu.net
Organization: GNUs Not Usenet
Distribution: gnu
Date: Sat, 25 Jul 1992 15:23:54 GMT

Several people have reported problems with using g++ 2.2.2 under svr4
with the -g option (which causes DWARF debugging information to be
generated).  Specifically, there seem to have been two problems:

	o	The g++ front end was setting DECL_IGNORED_P on
		FUNCTION_DECL nodes when it should not have been, and

	o	the dwarfout.c implementation of support for inline
		functions (and inlined instances thereof) was not
		yet completed.

Both of these problems will be fixed in the next release of the compiler(s).

For the time being, people may wish to use the following work-around patches
in order to prevent further aborts when compiling C++ programs under
svr4 with the g++ compiler using the -g option.  THESE ARE NOT THE ACTUAL
AND FINAL FIXES.  They are only minimal work-arounds which prevent aborts.

Note that actually debugging g++ compiled code on svr4 systems will still
be problematic for some time to come, due to a large number of other
unresolved issues.  Nonetheless, I encourage people to continue to submit
bug reports whenever they see problems relating to g++ and the use of the
-g option under svr4.

These patches are for the 2.2.2 release of GCC/g++.

// Ron ("Loose Cannon") Guilmette
// Internet: rfg@ncd.com      uucp: ...uunet!ncd.com!rfg
// New new motto:  Quality control is a state of mind.


*** dwarfout.c-	Sat May 30 22:08:49 1992
--- dwarfout.c	Sat Jul 25 09:01:58 1992
*************** output_mem_loc_descriptor (rtl)
*** 1303,1308 ****
  
  	ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_BASEREG);
!         ASM_OUTPUT_DWARF_DATA4 (asm_out_file,
! 				DBX_REGISTER_NUMBER (REGNO (rtl)));
  	break;
  
--- 1303,1311 ----
  
  	ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_BASEREG);
! 	if (is_pseudo_reg (rtl))
!           ASM_OUTPUT_DWARF_DATA4 (asm_out_file, (unsigned) -1);
! 	else
!           ASM_OUTPUT_DWARF_DATA4 (asm_out_file,
! 				  DBX_REGISTER_NUMBER (REGNO (rtl)));
  	break;
  
*************** output_loc_descriptor (rtl)
*** 1359,1364 ****
      case REG:
  	ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_REG);
!         ASM_OUTPUT_DWARF_DATA4 (asm_out_file,
! 				DBX_REGISTER_NUMBER (REGNO (rtl)));
  	break;
  
--- 1362,1370 ----
      case REG:
  	ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_REG);
! 	if (is_pseudo_reg (rtl))
!           ASM_OUTPUT_DWARF_DATA4 (asm_out_file, (unsigned) -1);
! 	else
!           ASM_OUTPUT_DWARF_DATA4 (asm_out_file,
! 				  DBX_REGISTER_NUMBER (REGNO (rtl)));
  	break;
  
*************** dwarfout_file_scope_decl (decl, set_fina
*** 4098,4107 ****
       don't carry their own sequence numbers with them!)  */
  
!   if (DECL_IGNORED_P (decl))
!     {
!       if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INITIAL (decl) != NULL)
! 	abort ();
!       return;
!     }
  
    switch (TREE_CODE (decl))
--- 4104,4109 ----
       don't carry their own sequence numbers with them!)  */
  
!   if (DECL_IGNORED_P (decl) && TREE_CODE (decl) != FUNCTION_DECL)
!     return;
  
    switch (TREE_CODE (decl))

Newsgroups: gnu.g++.bug