OSDN Git Service

./:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Feb 2007 14:55:09 +0000 (14:55 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Feb 2007 14:55:09 +0000 (14:55 +0000)
PR debug/30898
* dwarf2out.c (concatn_mem_loc_descriptor): New static function.
(mem_loc_descriptor): Call it.
testsuite/:
* g++.dg/debug/pr30898.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122228 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/debug/pr30898.C [new file with mode: 0644]

index d7f0f49..15adfd3 100644 (file)
@@ -1,3 +1,9 @@
+2007-02-22  Ian Lance Taylor  <iant@google.com>
+
+       PR debug/30898
+       * dwarf2out.c (concatn_mem_loc_descriptor): New static function.
+       (mem_loc_descriptor): Call it.
+
 2007-02-22  Zdenek Dvorak  <dvorakz@suse.cz>
             Ira Rosen  <irar@il.ibm.com>
 
index 901fbff..2bb68dc 100644 (file)
@@ -8811,6 +8811,32 @@ is_based_loc (rtx rtl)
               && GET_CODE (XEXP (rtl, 1)) == CONST_INT)));
 }
 
+/* Return a descriptor that describes the concatenation of N locations
+   used to form the address of a memory location.  */
+
+static dw_loc_descr_ref
+concatn_mem_loc_descriptor (rtx concatn, enum machine_mode mode)
+{
+  unsigned int i;
+  dw_loc_descr_ref cc_loc_result = NULL;
+  unsigned int n = XVECLEN (concatn, 0);
+
+  for (i = 0; i < n; ++i)
+    {
+      dw_loc_descr_ref ref;
+      rtx x = XVECEXP (concatn, 0, i);
+
+      ref = mem_loc_descriptor (x, mode);
+      if (ref == NULL)
+       return NULL;
+
+      add_loc_descr (&cc_loc_result, ref);
+      add_loc_descr_op_piece (&cc_loc_result, GET_MODE_SIZE (GET_MODE (x)));
+    }
+
+  return cc_loc_result;
+}
+
 /* The following routine converts the RTL for a variable or parameter
    (resident in memory) into an equivalent Dwarf representation of a
    mechanism for getting the address of that same variable onto the top of a
@@ -9006,6 +9032,10 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode)
       mem_loc_result = int_loc_descriptor (INTVAL (rtl));
       break;
 
+    case CONCATN:
+      mem_loc_result = concatn_mem_loc_descriptor (rtl, mode);
+      break;
+
     default:
       gcc_unreachable ();
     }
index 1e52e49..883e51e 100644 (file)
@@ -1,3 +1,8 @@
+2007-02-22  Ian Lance Taylor  <iant@google.com>
+
+       PR debug/30898
+       * g++.dg/debug/pr30898.C: New test.
+
 2007-02-22  Ira Rosen  <irar@il.ibm.com>
 
        * gcc.dg/vect/vect-106.c: New test.
diff --git a/gcc/testsuite/g++.dg/debug/pr30898.C b/gcc/testsuite/g++.dg/debug/pr30898.C
new file mode 100644 (file)
index 0000000..4c06ea6
--- /dev/null
@@ -0,0 +1,13 @@
+// { dg-do compile }
+
+double foo()
+{
+  union
+  {
+    int i;
+    double d;
+  };
+
+  i = 0;
+  return d;
+}