🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Karl Bunch Tue, 04 Aug 1992 17:24
More on gcc-2.2.2's failure to compile libg++-2.2
#259
Author: Karl Bunch
Date: Tue, 04 Aug 1992 17:24
31 lines
1470 bytes
Seems it's because DBX_REGISTER_NUMBER calls abort() if it
can't return a register number for what works out to be
greater than 15.  All I did then was to do: make CFLAGS=
and libg++ finnished compiling.  I would guess since it
isn't generating the dwarf output it doesn't run into this
problem.  I might also have been able to disable optimization
but, given the two choices I would rather optimize.

From: "config/i386v4.h" line 165:

#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) \
((n) == 0 ? 0 \
 : (n) == 1 ? 2 \
 : (n) == 2 ? 1 \
 : (n) == 3 ? 3 \
 : (n) == 4 ? 6 \
 : (n) == 5 ? 7 \
 : (n) == 6 ? 5 \
 : (n) == 7 ? 4 \
 : ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
 : (abort (), 0))

Thanks,
Karl

-- 
% ----------------------------------------------------------------------------
% Karl Bunch                        ||| UUCP: ..!uunet!cerritos.edu!ttank!karl
% Think Tank Software               ||| INTERNET: karl@ttank.com
% 42.5% of all quoted statistics are made up, of those 23.185% are right. :-)
SVR4/g++ fixes (was: More on gcc-2.2.2's failure to compile libg++-2.2)
#948
Author: Ronald F. Guilmette
Date: Sun, 16 Aug 1992 09:27
124 lines
5139 bytes
In article <9208050724.AA26091@ttank.ttank.com> karl@ttank.ttank.COM (Karl Bunch) writes:
>Seems it's because DBX_REGISTER_NUMBER calls abort() if it
>can't return a register number for what works out to be
>greater than 15...

That is correct, and the i386/svr4 definition of the DBX_REGISTER_NUMBER
macro was *intentionally* made that way to trap bogus stuff (i.e. pseudo
register numbers) being passed from the other parts of the compiler into
the debug-info generation routines (i.e. into dwarfout.c).  We want to
catch this if it ever happens, because that indicates that something is
seriously wrong elsewhere in the compiler.

The problem you ran into was actually due to the fact that the DWARF support
for inline functions (used heavily in C++) was not completed in time for the
2.2.2 release of the compiler(s).  This support has now been completed, and
it will be incorporated into the 2.3 release of the compiler(s).

For the time being, please use the following patches if you intend to try
to use the g++ compiler on SVR4 with the -g option.  These patches are
only work-arounds for the current problems with g++ and DWARF.  They are
only useful when applied to the most recent released version of the
compiler sources (i.e. version 2.2.2).

// Ron Guilmette


diff -prc2 2.2.2-/cp-decl.c 2.2.2+/cp-decl.c
*** 2.2.2-/cp-decl.c	Wed Jun 10 21:14:00 1992
--- 2.2.2+/cp-decl.c	Sun Jul 26 15:32:49 1992
*************** grokdeclarator (declarator, declspecs, d
*** 6216,6220 ****
    enum tree_code innermost_code = ERROR_MARK;
    int bitfield = 0;
!   int variable_size = 0;
    /* Set this to error_mark_node for FIELD_DECLs we could not handle properly.
       All FIELD_DECLs we build here have `init' put into their DECL_INITIAL.  */
--- 6216,6220 ----
    enum tree_code innermost_code = ERROR_MARK;
    int bitfield = 0;
!   int size_varies = 0;
    /* Set this to error_mark_node for FIELD_DECLs we could not handle properly.
       All FIELD_DECLs we build here have `init' put into their DECL_INITIAL.  */
*************** grokdeclarator (declarator, declspecs, d
*** 7086,7089 ****
--- 7086,7093 ----
  		  dont_grok_size:
  		    itype = build_binary_op (MINUS_EXPR, size, integer_one_node);
+ 		    /* Make sure the array size remains visibly nonconstant
+ 		       even if it is (eg) a const variable with known value.  */
+ 		    size_varies = 1;
+ 		    itype = variable_size (itype);
  		    itype = build_index_type (itype);
  		  }
diff -prc2 2.2.2-/dwarfout.c 2.2.2+/dwarfout.c
*** 2.2.2-/dwarfout.c	Sat May 30 22:08:49 1992
--- 2.2.2+/dwarfout.c	Sun Jul 26 15:42:38 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;
  
*************** output_decl (decl, containing_scope)
*** 3819,3823 ****
  
  	  if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE)
! 	    arg_decls = TREE_CHAIN (arg_decls);
  
  	  {
--- 3825,3829 ----
  
  	  if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE)
! 	    arg_decls = arg_decls ? TREE_CHAIN (arg_decls) : NULL_TREE;
  
  	  {
*************** 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))
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads