diff mbox

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

Message ID 20120425135950.GA7855@intel.com
State New
Headers show

Commit Message

H.J. Lu April 25, 2012, 1:59 p.m. UTC
Hi,

We may generate DW_OP_GNU_regval_type with INVALID_REGNUM.  This patch
adds an assert to make sure that we don't.  OK for trunk?

Thanks.

H.J.
---
2012-04-06  H.J. Lu  <hongjiu.lu@intel.com>

	PR debug/52857
	* dwarf2out.c (dbx_reg_number): Assert return value !=
	INVALID_REGNUM.

Comments

Richard Henderson April 25, 2012, 6:52 p.m. UTC | #1
On 04/25/12 06:59, H.J. Lu wrote:
> 	PR debug/52857
> 	* dwarf2out.c (dbx_reg_number): Assert return value !=
> 	INVALID_REGNUM.

Ok.

r~
diff mbox

Patch

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index ca88fc5..515a824 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -10167,7 +10167,9 @@  dbx_reg_number (const_rtx rtl)
     }
 #endif
 
-  return DBX_REGISTER_NUMBER (regno);
+  regno = DBX_REGISTER_NUMBER (regno);
+  gcc_assert (regno != INVALID_REGNUM);
+  return regno;
 }
 
 /* Optionally add a DW_OP_piece term to a location description expression.