This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: PR debug/52857: DW_OP_GNU_regval_type is generated with INVALID_REGNUM
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: jason at redhat dot com
- Date: Tue, 3 Apr 2012 18:01:23 -0700
- Subject: PATCH: PR debug/52857: DW_OP_GNU_regval_type is generated with INVALID_REGNUM
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
As the testcase in
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52857
shows, for
(subreg:SI (plus:DI (reg/f:DI 16 argp)
(const_int -128 [0xffffffffffffff80])) 0)
we generates DW_OP_GNU_regval_type with INVALID_REGNUM. This patch
checks dbx_reg_number for INVALID_REGNUM before using it. OK for
trunk and 4.7?
Thanks.
H.J.
---
2012-04-03 H.J. Lu <hongjiu.lu@intel.com>
PR debug/52857
* dwarf2out.c (mem_loc_descriptor): Don't generate
DW_OP_GNU_regval_type with INVALID_REGNUM.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index ca88fc5..935c86f 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -11664,7 +11664,8 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
if (dwarf_strict)
break;
- if (REGNO (rtl) > FIRST_PSEUDO_REGISTER)
+ if (REGNO (rtl) > FIRST_PSEUDO_REGISTER
+ || dbx_reg_number (rtl) == INVALID_REGNUM)
break;
type_die = base_type_for_mode (mode,
GET_MODE_CLASS (mode) == MODE_INT);