Commit d7831fdb by H.J. Lu Committed by H.J. Lu

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
parent 12aea97a
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> 2008-07-31 Richard Guenther <rguenther@suse.de>
PR tree-optimization/36978 PR tree-optimization/36978
......
...@@ -387,6 +387,7 @@ static void output_cfi (dw_cfi_ref, dw_fde_ref, int); ...@@ -387,6 +387,7 @@ static void output_cfi (dw_cfi_ref, dw_fde_ref, int);
static void output_call_frame_info (int); static void output_call_frame_info (int);
static void dwarf2out_note_section_used (void); static void dwarf2out_note_section_used (void);
static void dwarf2out_stack_adjust (rtx, bool); 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 void flush_queued_reg_saves (void);
static bool clobbers_queued_reg_save (const_rtx); static bool clobbers_queued_reg_save (const_rtx);
static void dwarf2out_frame_debug_expr (rtx, const char *); static void dwarf2out_frame_debug_expr (rtx, const char *);
...@@ -1225,9 +1226,21 @@ dwarf2out_stack_adjust (rtx insn, bool after_p) ...@@ -1225,9 +1226,21 @@ dwarf2out_stack_adjust (rtx insn, bool after_p)
if (offset == 0) if (offset == 0)
return; 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) if (cfa.reg == STACK_POINTER_REGNUM)
cfa.offset += offset; cfa.offset += offset;
if (cfa_store.reg == STACK_POINTER_REGNUM)
cfa_store.offset += offset;
#ifndef STACK_GROWS_DOWNWARD #ifndef STACK_GROWS_DOWNWARD
offset = -offset; offset = -offset;
#endif #endif
...@@ -1236,7 +1249,6 @@ dwarf2out_stack_adjust (rtx insn, bool after_p) ...@@ -1236,7 +1249,6 @@ dwarf2out_stack_adjust (rtx insn, bool after_p)
if (args_size < 0) if (args_size < 0)
args_size = 0; args_size = 0;
label = dwarf2out_cfi_label ();
def_cfa_1 (label, &cfa); def_cfa_1 (label, &cfa);
if (flag_asynchronous_unwind_tables) if (flag_asynchronous_unwind_tables)
dwarf2out_args_size (label, args_size); dwarf2out_args_size (label, args_size);
...@@ -1668,22 +1680,7 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label) ...@@ -1668,22 +1680,7 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label)
HOST_WIDE_INT offset = stack_adjust_offset (elem); HOST_WIDE_INT offset = stack_adjust_offset (elem);
if (offset != 0) if (offset != 0)
{ dwarf2out_args_size_adjust (offset, label);
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);
}
} }
} }
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment