Commit d2d93c32 by H.J. Lu Committed by H.J. Lu

re PR debug/36977 (Incorrect debug info for stack variables with stack alignment)

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

	PR debug/36977
	* cfgexpand.c (expand_stack_alignment): Set stack_realign_tried.

	* dwarf2out.c (based_loc_descr): Check crtl->stack_realign_tried
	for stack alignment.

	* function.h (rtl_data): Add stack_realign_tried.  Update
	comments.

From-SVN: r138438
parent c983efce
2008-07-31 H.J. Lu <hongjiu.lu@intel.com>
PR debug/36977
* cfgexpand.c (expand_stack_alignment): Set stack_realign_tried.
* dwarf2out.c (based_loc_descr): Check crtl->stack_realign_tried
for stack alignment.
* function.h (rtl_data): Add stack_realign_tried. Update
comments.
2008-07-31 Kaz Kojima <kkojima@gcc.gnu.org> 2008-07-31 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.c (sh_canonical_va_list_type): Remove. * config/sh/sh.c (sh_canonical_va_list_type): Remove.
......
...@@ -2217,6 +2217,7 @@ expand_stack_alignment (void) ...@@ -2217,6 +2217,7 @@ expand_stack_alignment (void)
crtl->stack_realign_needed crtl->stack_realign_needed
= INCOMING_STACK_BOUNDARY < crtl->stack_alignment_estimated; = INCOMING_STACK_BOUNDARY < crtl->stack_alignment_estimated;
crtl->stack_realign_tried = crtl->stack_realign_needed;
crtl->stack_realign_processed = true; crtl->stack_realign_processed = true;
......
...@@ -9453,8 +9453,7 @@ based_loc_descr (rtx reg, HOST_WIDE_INT offset, ...@@ -9453,8 +9453,7 @@ based_loc_descr (rtx reg, HOST_WIDE_INT offset,
pointer + offset to access stack variables. If stack pointer + offset to access stack variables. If stack
is aligned without drap, use stack pointer + offset to is aligned without drap, use stack pointer + offset to
access stack variables. */ access stack variables. */
if (fde if (crtl->stack_realign_tried
&& fde->stack_realign
&& cfa.reg == HARD_FRAME_POINTER_REGNUM && cfa.reg == HARD_FRAME_POINTER_REGNUM
&& reg == frame_pointer_rtx) && reg == frame_pointer_rtx)
{ {
......
...@@ -424,13 +424,18 @@ struct rtl_data GTY(()) ...@@ -424,13 +424,18 @@ struct rtl_data GTY(())
The value set after reload is the accurate one and is finalized. */ The value set after reload is the accurate one and is finalized. */
bool stack_realign_needed; bool stack_realign_needed;
/* Nonzero if function stack realignment is tried. This flag is set
only once before reload. It affects register elimination. This
is used to generate DWARF debug info for stack variables. */
bool stack_realign_tried;
/* Nonzero if function being compiled needs dynamic realigned /* Nonzero if function being compiled needs dynamic realigned
argument pointer (drap) if stack needs realigning. */ argument pointer (drap) if stack needs realigning. */
bool need_drap; bool need_drap;
/* Nonzero if function stack realignment estimation is done, namely /* Nonzero if function stack realignment estimation is done, namely
stack_realign_needed flag has been set before reload wrt stack_realign_needed flag has been set before reload wrt estimated
estimated stack alignment info. */ stack alignment info. */
bool stack_realign_processed; bool stack_realign_processed;
/* Nonzero if function stack realignment has been finalized, namely /* Nonzero if function stack realignment has been finalized, namely
......
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