Assert dbx_reg_number doesn't return INVALID_REGNUM
authorH.J. Lu <hongjiu.lu@intel.com>
Wed, 25 Apr 2012 19:08:23 +0000 (19:08 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Wed, 25 Apr 2012 19:08:23 +0000 (12:08 -0700)
PR debug/52857
* dwarf2out.c (dbx_reg_number): Assert return value !=
INVALID_REGNUM.

From-SVN: r186837

gcc/ChangeLog
gcc/dwarf2out.c

index f51ccbc28438fc4ac79a3add9aae4d34aba30971..820ba1bd5b48e985900dad127162f92ae7676867 100644 (file)
@@ -1,3 +1,9 @@
+2012-04-25  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR debug/52857
+       * dwarf2out.c (dbx_reg_number): Assert return value !=
+       INVALID_REGNUM.
+
 2012-04-25  Jakub Jelinek  <jakub@redhat.com>
 
        * common.opt (flag_debug_types_section): Default to 0.
index 1240ddb563789280b22c0c99a23909628d0fa08d..766edbad130678a0f43fe9fb63679b99daf863d8 100644 (file)
@@ -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.