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

Re: [vta->trunk] VTA merge


On Sep  2, 2009, Tom Tromey <tromey@redhat.com> wrote:

> FWIW I changed my mind on this topic.  I was swayed by your argument
> about compatibility: the alternative to emitting DW_OP_*_value seems to
> be to emit nothing.  Either way an older debugger is just not going to
> be able to print the value.

I think the important question is whether older debuggers would be able
to deal gracefully with these location entries or constant values.  I
understand they're supposed to, and I have no evidence that GDB isn't,
so I offer this patch to revert the last-minute addition of tests for
dwarf_version >= 4 in the VTA merge patch.

Should I check it in so that we can get a better idea of what, if
anything, breaks?

for  gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* dwarf2out.c (loc_descriptor): Emit DW_OP_stack_value and
	DW_OP_implicit_value even without dwarf_version 4.

Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c.orig	2009-09-03 04:09:03.000000000 -0300
+++ gcc/dwarf2out.c	2009-09-03 04:09:21.000000000 -0300
@@ -11744,7 +11744,7 @@ loc_descriptor (rtx rtl, enum machine_mo
       break;
 
     case CONST_INT:
-      if (mode != VOIDmode && mode != BLKmode && dwarf_version >= 4)
+      if (mode != VOIDmode && mode != BLKmode)
         {
           HOST_WIDE_INT i = INTVAL (rtl);
           int litsize;
@@ -11798,7 +11798,7 @@ loc_descriptor (rtx rtl, enum machine_mo
       break;
 
     case CONST_DOUBLE:
-      if (mode != VOIDmode && dwarf_version >= 4)
+      if (mode != VOIDmode)
 	{
 	  /* Note that a CONST_DOUBLE rtx could represent either an integer
 	     or a floating-point constant.  A CONST_DOUBLE is used whenever
@@ -11829,7 +11829,7 @@ loc_descriptor (rtx rtl, enum machine_mo
       break;
 
     case CONST_VECTOR:
-      if (mode != VOIDmode && dwarf_version >= 4)
+      if (mode != VOIDmode)
 	{
 	  unsigned int elt_size = GET_MODE_UNIT_SIZE (GET_MODE (rtl));
 	  unsigned int length = CONST_VECTOR_NUNITS (rtl);
@@ -11917,8 +11917,7 @@ loc_descriptor (rtx rtl, enum machine_mo
 	  && SYMBOL_REF_TLS_MODEL (rtl) != TLS_MODEL_NONE)
 	break;
     case LABEL_REF:
-      if (mode != VOIDmode && GET_MODE_SIZE (mode) == DWARF2_ADDR_SIZE
-	  && dwarf_version >= 4)
+      if (mode != VOIDmode && GET_MODE_SIZE (mode) == DWARF2_ADDR_SIZE)
 	{
 	  loc_result = new_loc_descr (DW_OP_implicit_value,
 				      DWARF2_ADDR_SIZE, 0);
@@ -11930,8 +11929,7 @@ loc_descriptor (rtx rtl, enum machine_mo
 
     default:
       if (GET_MODE_CLASS (mode) == MODE_INT && GET_MODE (rtl) == mode
-	  && GET_MODE_SIZE (GET_MODE (rtl)) <= DWARF2_ADDR_SIZE
-	  && dwarf_version >= 4)
+	  && GET_MODE_SIZE (GET_MODE (rtl)) <= DWARF2_ADDR_SIZE)
 	{
 	  /* Value expression.  */
 	  loc_result = mem_loc_descriptor (rtl, VOIDmode, initialized);

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

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