re PR debug/36976 (FAIL: g++.dg/torture/stackalign/unwind-2.C)

2008-07-31  H.J. Lu  <hongjiu.lu@intel.com>

	PR debug/36976
	* dwarf2out.c (dwarf2out_args_size_adjust): New.
	(dwarf2out_stack_adjust): Use it.
	(dwarf2out_frame_debug_expr): Likewise.

From-SVN: r138416
This commit is contained in:
H.J. Lu 2008-07-31 14:33:43 +00:00 committed by H.J. Lu
parent 12aea97a8d
commit d7831fdb1e
2 changed files with 21 additions and 17 deletions

View File

@ -1,3 +1,10 @@
2008-07-31 H.J. Lu <hongjiu.lu@intel.com>
PR debug/36976
* dwarf2out.c (dwarf2out_args_size_adjust): New.
(dwarf2out_stack_adjust): Use it.
(dwarf2out_frame_debug_expr): Likewise.
2008-07-31 Richard Guenther <rguenther@suse.de>
PR tree-optimization/36978

View File

@ -387,6 +387,7 @@ static void output_cfi (dw_cfi_ref, dw_fde_ref, int);
static void output_call_frame_info (int);
static void dwarf2out_note_section_used (void);
static void dwarf2out_stack_adjust (rtx, bool);
static void dwarf2out_args_size_adjust (HOST_WIDE_INT, const char *);
static void flush_queued_reg_saves (void);
static bool clobbers_queued_reg_save (const_rtx);
static void dwarf2out_frame_debug_expr (rtx, const char *);
@ -1225,9 +1226,21 @@ dwarf2out_stack_adjust (rtx insn, bool after_p)
if (offset == 0)
return;
label = dwarf2out_cfi_label ();
dwarf2out_args_size_adjust (offset, label);
}
/* Adjust args_size based on stack adjustment OFFSET. */
static void
dwarf2out_args_size_adjust (HOST_WIDE_INT offset, const char *label)
{
if (cfa.reg == STACK_POINTER_REGNUM)
cfa.offset += offset;
if (cfa_store.reg == STACK_POINTER_REGNUM)
cfa_store.offset += offset;
#ifndef STACK_GROWS_DOWNWARD
offset = -offset;
#endif
@ -1236,7 +1249,6 @@ dwarf2out_stack_adjust (rtx insn, bool after_p)
if (args_size < 0)
args_size = 0;
label = dwarf2out_cfi_label ();
def_cfa_1 (label, &cfa);
if (flag_asynchronous_unwind_tables)
dwarf2out_args_size (label, args_size);
@ -1668,22 +1680,7 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label)
HOST_WIDE_INT offset = stack_adjust_offset (elem);
if (offset != 0)
{
if (cfa.reg == STACK_POINTER_REGNUM)
cfa.offset += offset;
#ifndef STACK_GROWS_DOWNWARD
offset = -offset;
#endif
args_size += offset;
if (args_size < 0)
args_size = 0;
def_cfa_1 (label, &cfa);
if (flag_asynchronous_unwind_tables)
dwarf2out_args_size (label, args_size);
}
dwarf2out_args_size_adjust (offset, label);
}
}
return;