This is the mail archive of the gcc-bugs@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]

bounds violation in dbxout_symbol_location


For testcase compile/920428-4.c, -O3 -g on i686:

The line indicated below barfs on (mem/s:BLK (reg:SI 70) 6),
attempting to read dbx_register_map[70], but 37 is the array size.

Greg

Index: gcc/dbxout.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/dbxout.c,v
retrieving revision 1.60
diff -u -p -c -1 -5 -u -r1.60 dbxout.c
--- dbxout.c	2000/07/23 17:53:21	1.60
+++ dbxout.c	2000/09/01 09:43:36
@@ -2097,31 +2097,31 @@ dbxout_symbol_location (decl, type, suff
 		   && REGNO (XEXP (home, 0)) != ARG_POINTER_REGNUM
 #endif
 		   )))
     /* If the value is indirect by memory or by a register
        that isn't the frame pointer
        then it means the object is variable-sized and address through
        that register or stack slot.  DBX has no way to represent this
        so all we can do is output the variable as a pointer.
        If it's not a parameter, ignore it.
        (VAR_DECLs like this can be made by integrate.c.)  */
     {
       if (GET_CODE (XEXP (home, 0)) == REG)
 	{
 	  letter = 'r';
 	  current_sym_code = N_RSYM;
-	  current_sym_value = DBX_REGISTER_NUMBER (REGNO (XEXP (home, 0)));
+	  current_sym_value = DBX_REGISTER_NUMBER (REGNO (XEXP (home, 0))); /* GKM BV: compile/920428-4.c, -O3 -g; (mem/s:BLK (reg:SI 70) 6) */
 	}
       else
 	{
 	  current_sym_code = N_LSYM;
 	  /* RTL looks like (MEM (MEM (PLUS (REG...) (CONST_INT...)))).
 	     We want the value of that CONST_INT.  */
 	  current_sym_value
 	    = DEBUGGER_AUTO_OFFSET (XEXP (XEXP (home, 0), 0));
 	}
 
       /* Effectively do build_pointer_type, but don't cache this type,
 	 since it might be temporary whereas the type it points to
 	 might have been saved for inlining.  */
       /* Don't use REFERENCE_TYPE because dbx can't handle that.  */
       type = make_node (POINTER_TYPE);

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