aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-02-22 14:55:09 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2007-02-22 14:55:09 +0000
commit0c5c188f0759e74255b4792d141d97926e6dc4a1 (patch)
treede6cf2c13662d233050fd62c75dc19ebed5769b6 /gcc/dwarf2out.c
parentd1789dc25a1a6f1d8f9e481cd094eeacdc9b2275 (diff)
downloadgcc-0c5c188f0759e74255b4792d141d97926e6dc4a1.zip
gcc-0c5c188f0759e74255b4792d141d97926e6dc4a1.tar.gz
gcc-0c5c188f0759e74255b4792d141d97926e6dc4a1.tar.bz2
re PR debug/30898 (ICE with anonymous union and -g)
./: 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. From-SVN: r122228
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 901fbff..2bb68dc 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -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 ();
}