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...@intel.com>

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

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.

Reply via email to