This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[DWARF] Fix multiple register spanning location.
- From: Christian Bruel <christian dot bruel at st dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: <ccoutant at google dot com>, <jason at redhat dot com>
- Date: Mon, 29 Apr 2013 10:48:01 +0200
- Subject: [DWARF] Fix multiple register spanning location.
Hello,
We noticed a few failures with the gdb testsuite due to incorrect
mapping of floating point, noticed on SH that defines both
TARGET_DWARF_REGISTER_SPAN and DBX_REGISTER_NUMBER.
The problem was that the converted pseudo reg was never converted to the
dbx format when fed from 'multiple_reg_loc_descriptor'
reg tested for sh-elf (including gdb). bootstrap OK for arm-none-eabi,
sh64-elf and x86_64-unknown-linux-gnu
Note that this could apply to the ARM, C6X, RS6000, MIPS targets that
also defines the same macro combination. Although asking approval from
the DWARF maintainers, feedback from the respective arch maintainers
would be appreciated as I don't run the gdb testsuite on those targets.
Many thanks,
Christian
2013-04-26 Christian Bruel <christian.bruel@st.com>
* dwarf2out.c (multiple_reg_loc_descriptor): Use DBX_REGISTER_NUMBER
for spaning registers.
2013-04-26 Christian Bruel <christian.bruel@st.com>
* gcc.dg/debug/dwarf2/dwarf_span.c: New test case.
Index: dwarf2out.c
===================================================================
--- dwarf2out.c (revision 198287)
+++ dwarf2out.c (working copy)
@@ -10656,7 +10656,8 @@ multiple_reg_loc_descriptor (rtx rtl, rtx regs,
{
dw_loc_descr_ref t;
- t = one_reg_loc_descriptor (REGNO (XVECEXP (regs, 0, i)),
+ reg = REGNO (XVECEXP (regs, 0, i));
+ t = one_reg_loc_descriptor (DBX_REGISTER_NUMBER (reg),
VAR_INIT_STATUS_INITIALIZED);
add_loc_descr (&loc_result, t);
size = GET_MODE_SIZE (GET_MODE (XVECEXP (regs, 0, 0)));
Index: testsuite/gcc.dg/debug/dwarf2/dwarf_span.c
===================================================================
--- testsuite/gcc.dg/debug/dwarf2/dwarf_span.c (revision 0)
+++ testsuite/gcc.dg/debug/dwarf2/dwarf_span.c (revision 0)
@@ -0,0 +1,18 @@
+/* { dg-do compile { target "sh*-*-*" } } */
+/* { dg-require-effective-target hard_float } */
+/* { dg-options "-g -dA" } */
+/* { dg-final { scan-assembler-times "DW_OP_regx" 4 } } */
+
+double
+add_double (register double u, register double v)
+{
+ return u + v;
+}
+
+double
+wack_double (register double u, register double v)
+{
+ register double l = u, r = v;
+ l = add_double (l, r);
+ return l + r;
+}