This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[3.1.1/mainline] expand_builtin_init_dwarf_reg_sizes fix.
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, patches at x86-64 dot org, rth at cygnus dot com
- Date: Wed, 22 May 2002 16:10:26 +0200
- Subject: [3.1.1/mainline] expand_builtin_init_dwarf_reg_sizes fix.
Hi,
i386.h defines DWARF_FRAME_REGISTERS to 17 and this is enought for
x86-64 too. Problem is that expand_builin_init_dwarf_reg_sizes stores
out the first DWARF_FRAME_REGISTERS pseudo registers overflowing the
array, since the regsiters with small dwarf numbers are later in the
queue. This appears to fix the x86-64 exception handling crashes.
Bootstrapped/regtested i386/branch
Wed May 22 16:07:36 CEST 2002 Jan Hubicka <jh@suse.cz>
* dwarf2out.c (expand_builin_init_dwarf_reg_sizes):
Store first DWARF_FRAME_REGISTERS dwarf registers, not pseudo
registers.
Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.356.2.10
diff -c -3 -p -r1.356.2.10 dwarf2out.c
*** dwarf2out.c 16 May 2002 05:02:35 -0000 1.356.2.10
--- dwarf2out.c 22 May 2002 14:07:23 -0000
*************** expand_builtin_init_dwarf_reg_sizes (add
*** 417,432 ****
rtx addr = expand_expr (address, NULL_RTX, VOIDmode, 0);
rtx mem = gen_rtx_MEM (BLKmode, addr);
! for (i = 0; i < DWARF_FRAME_REGISTERS; i++)
! {
! HOST_WIDE_INT offset = DWARF_FRAME_REGNUM (i) * GET_MODE_SIZE (mode);
! HOST_WIDE_INT size = GET_MODE_SIZE (reg_raw_mode[i]);
! if (offset < 0)
! continue;
! emit_move_insn (adjust_address (mem, mode, offset), GEN_INT (size));
! }
}
/* Convert a DWARF call frame info. operation to its string name */
--- 417,433 ----
rtx addr = expand_expr (address, NULL_RTX, VOIDmode, 0);
rtx mem = gen_rtx_MEM (BLKmode, addr);
! for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
! if (DWARF_FRAME_REGNUM (i) < DWARF_FRAME_REGISTERS)
! {
! HOST_WIDE_INT offset = DWARF_FRAME_REGNUM (i) * GET_MODE_SIZE (mode);
! HOST_WIDE_INT size = GET_MODE_SIZE (reg_raw_mode[i]);
! if (offset < 0)
! continue;
! emit_move_insn (adjust_address (mem, mode, offset), GEN_INT (size));
! }
}
/* Convert a DWARF call frame info. operation to its string name */