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 RFA: large regs sizes in expand_builtin_init_dwarf_reg_sizes


The function expand_builtin_init_dwarf_reg_sizes does this:

  enum machine_mode mode = TYPE_MODE (char_type_node);
  ...
	enum machine_mode save_mode = reg_raw_mode[i];
  ...
  	size = GET_MODE_SIZE (save_mode);
  ...
	emit_move_insn (adjust_address (mem, mode, offset), GEN_INT (size));

What this does is store the size, in bytes, of each register into a
char array.

I am using a target in which a few registers are 128 bytes long
(honest).  The above code winds up storing 128 == 0x80 via a QImode
address.  This later runs afoul of an assert in do_SUBST:

      /* Sanity check that we're replacing oldval with a CONST_INT
	 that is a valid sign-extension for the original mode.  */
      gcc_assert (INTVAL (newval)
		  == trunc_int_for_mode (INTVAL (newval), GET_MODE (oldval)));

This is the obvious patch.  The patch looks quite safe to me, I've
been using it for a while, and it should not make any difference on a
target for which all registers are less than 128 bytes long.  I'm
running a bootstrap and testsuite run on i686-pc-linux-gnu.  OK to
commit if these pass?

Ian


2005-06-23  Ian Lance Taylor  <ian@airs.com>

	* dwarf2out.c (expand_builtin_init_dwarf_reg_sizes): Change
	GEN_INT to gen_int_for_mode when storing register size to memory.


Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.601
diff -p -u -r1.601 dwarf2out.c
--- dwarf2out.c	9 Jun 2005 16:21:31 -0000	1.601
+++ dwarf2out.c	23 Jun 2005 21:12:35 -0000
@@ -499,7 +499,8 @@ expand_builtin_init_dwarf_reg_sizes (tre
 	if (offset < 0)
 	  continue;
 
-	emit_move_insn (adjust_address (mem, mode, offset), GEN_INT (size));
+	emit_move_insn (adjust_address (mem, mode, offset),
+			gen_int_mode (size, mode));
       }
 
 #ifdef DWARF_ALT_FRAME_RETURN_COLUMN


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