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] Fix multiple_reg_loc_descriptor on i?86


Hi!

multiple_reg_loc_descriptor relies on DBX_REGISTER_NUMBER giving
contiguous numbers for parts of a multi-register hard reg.
But e.g. i386 violates this:
  0, 2, 1, 3, 6, 7, 4, 5,               /* general regs */
say for (reg:DI 2 %ecx) this gives { 1, 2 } while { 1, 3 }
should be encoded, for (reg:DI 3 %ebx) { 3, 4 } while { 3, 6 }
should be given, etc.

Ok for HEAD (and similar patch for 4.0/3.4)?

2005-11-08  Jakub Jelinek  <jakub@redhat.com>

	* dwarf2out.c (multiple_reg_loc_descriptor): Don't assume
	DBX_REGISTER_NUMBER being contiguous.

--- gcc/dwarf2out.c.jj	2005-11-04 09:41:19.000000000 +0100
+++ gcc/dwarf2out.c	2005-11-08 15:27:47.000000000 +0100
@@ -8536,7 +8536,11 @@ multiple_reg_loc_descriptor (rtx rtl, rt
   unsigned reg;
   dw_loc_descr_ref loc_result = NULL;
 
-  reg = dbx_reg_number (rtl);
+  reg = REGNO (rtl);
+#ifdef LEAF_REG_REMAP
+  reg = LEAF_REG_REMAP (reg);
+#endif
+  gcc_assert ((unsigned) DBX_REGISTER_NUMBER (reg) == dbx_reg_number (rtl));
   nregs = hard_regno_nregs[REGNO (rtl)][GET_MODE (rtl)];
 
   /* Simple, contiguous registers.  */
@@ -8549,7 +8553,7 @@ multiple_reg_loc_descriptor (rtx rtl, rt
 	{
 	  dw_loc_descr_ref t;
 
-	  t = one_reg_loc_descriptor (reg);
+	  t = one_reg_loc_descriptor (DBX_REGISTER_NUMBER (reg));
 	  add_loc_descr (&loc_result, t);
 	  add_loc_descr_op_piece (&loc_result, size);
 	  ++reg;

	Jakub


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