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]

PATCH: PR debug/52857: DW_OP_GNU_regval_type is generated with INVALID_REGNUM


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);


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