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]
Other format: [Raw text]

Re: PR 20505


James E Wilson wrote:
Nathan Sidwell wrote:

Being conservative I'd go for my patch on 4.0 and yours (if verified) on
mainline.


I'm fine with that. Have you actually written a patch yet? I don't see one in the bug report or in gcc-patches.
My mistake. I'd forgotten the post-to-list part :)

Here it is, ok?

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2005-04-01  Nathan Sidwell  <nathan@codesourcery.com>

	PR debug/20505
	* dwarf2out.c (tree_add_const_value_attribute): Only add if it's
	an INT_CST.

Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.572
diff -c -3 -p -r1.572 dwarf2out.c
*** dwarf2out.c	19 Mar 2005 03:06:51 -0000	1.572
--- dwarf2out.c	23 Mar 2005 12:13:23 -0000
*************** tree_add_const_value_attribute (dw_die_r
*** 10156,10181 ****
    tree init = DECL_INITIAL (decl);
    tree type = TREE_TYPE (decl);
  
!   if (TREE_READONLY (decl) && ! TREE_THIS_VOLATILE (decl) && init
!       && initializer_constant_valid_p (init, type) == null_pointer_node)
!     /* OK */;
!   else
      return;
! 
!   switch (TREE_CODE (type))
!     {
!     case INTEGER_TYPE:
!       if (host_integerp (init, 0))
! 	add_AT_unsigned (var_die, DW_AT_const_value,
! 			 tree_low_cst (init, 0));
!       else
! 	add_AT_long_long (var_die, DW_AT_const_value,
! 			  TREE_INT_CST_HIGH (init),
! 			  TREE_INT_CST_LOW (init));
!       break;
! 
!     default:;
!     }
  }
  
  /* Generate a DW_AT_name attribute given some string value to be included as
--- 10156,10177 ----
    tree init = DECL_INITIAL (decl);
    tree type = TREE_TYPE (decl);
  
!   if (!init)
      return;
!   if (!TREE_READONLY (decl) || TREE_THIS_VOLATILE (decl))
!     return;
!   if (TREE_CODE (type) != INTEGER_TYPE)
!     return;
!   if (TREE_CODE (init) != INTEGER_CST)
!     return;
!   
!   if (host_integerp (init, 0))
!     add_AT_unsigned (var_die, DW_AT_const_value,
! 		     tree_low_cst (init, 0));
!   else
!     add_AT_long_long (var_die, DW_AT_const_value,
! 		      TREE_INT_CST_HIGH (init),
! 		      TREE_INT_CST_LOW (init));
  }
  
  /* Generate a DW_AT_name attribute given some string value to be included as
// Copyright (C) 2005 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 1 Apr 2005 <nathan@codesourcery.com>

// { dg-options "-ggdb2" }
// Origin: ivan <ivanr@syncad.com>
//	   pinskia@gcc.gnu.org
// Bug 20505: ICE with -ggdb2

struct b
{
  static const int d;
  virtual bool IsEmpty() const=0;
  int e,c;
};
const int b::d = ((int)(&((b*)1)->c) - 1);

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