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

[rth@cygnus.com: Re: gcc/cp/dwarf2out.c Broken]


----- Forwarded message from Richard Henderson <rth@cygnus.com> -----

Date: Wed, 1 Nov 2000 14:47:34 -0800
From: Richard Henderson <rth@cygnus.com>
To: Jeffrey Oldham <oldham@oz.codesourcery.com>
Cc: rth@redhat.com, mark@oz.codesourcery.com
Subject: Re: gcc/cp/dwarf2out.c Broken

On Wed, Nov 01, 2000 at 03:04:07PM -0800, Jeffrey Oldham wrote:
> rtl_for_decl_location() can return 0x0, which is assigned to the
> variable rtl.  Then, GET_CODE (rtl) causes a segmentation fault.  The
> original add_location_or_const_value_attribute() code returned if the
> rtl equals 0x0.

Fixed.  Not sure why this didn't show up in an alpha bootstrap
where it would for mips...


r~


        * dwarf2out.c (loc_descriptor_from_tree): Check for null result
        from rtl_for_decl_location.
        (add_location_or_const_value_attribute): Likewise.

Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/dwarf2out.c,v
retrieving revision 1.214
diff -c -p -d -r1.214 dwarf2out.c
*** dwarf2out.c	2000/11/01 00:20:34	1.214
--- dwarf2out.c	2000/11/01 22:44:05
*************** loc_descriptor_from_tree (loc, addressp)
*** 7506,7512 ****
  	rtx rtl = rtl_for_decl_location (loc);
  	enum machine_mode mode = DECL_MODE (loc);
  
! 	if (CONSTANT_P (rtl))
  	  {
  	    ret = new_loc_descr (DW_OP_addr, 0, 0);
  	    ret->dw_loc_oprnd1.val_class = dw_val_class_addr;
--- 7506,7514 ----
  	rtx rtl = rtl_for_decl_location (loc);
  	enum machine_mode mode = DECL_MODE (loc);
  
! 	if (rtl == NULL_RTX)
! 	  break;
! 	else if (CONSTANT_P (rtl))
  	  {
  	    ret = new_loc_descr (DW_OP_addr, 0, 0);
  	    ret->dw_loc_oprnd1.val_class = dw_val_class_addr;
*************** add_location_or_const_value_attribute (d
*** 8274,8279 ****
--- 8276,8283 ----
      abort ();
  
    rtl = rtl_for_decl_location (decl);
+   if (rtl == NULL_RTX)
+     return;
  
    switch (GET_CODE (rtl))
      {

----- End forwarded message -----

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