aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2008-07-31 21:28:54 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2008-07-31 14:28:54 -0700
commitd2d93c32dc020c143ca5ffc8b72969cbef530778 (patch)
tree5b5de8d55327239ef11486dfd02ce87e62a4f059 /gcc
parentc983efcec6d1d022c5ec6cd0f3ff4c0126a0e415 (diff)
downloadgcc-d2d93c32dc020c143ca5ffc8b72969cbef530778.zip
gcc-d2d93c32dc020c143ca5ffc8b72969cbef530778.tar.gz
gcc-d2d93c32dc020c143ca5ffc8b72969cbef530778.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/cfgexpand.c1
-rw-r--r--gcc/dwarf2out.c3
-rw-r--r--gcc/function.h17
4 files changed, 24 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b7310f3..3823eb6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+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>
* config/sh/sh.c (sh_canonical_va_list_type): Remove.
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 623ad85..c9faa49 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -2217,6 +2217,7 @@ expand_stack_alignment (void)
crtl->stack_realign_needed
= INCOMING_STACK_BOUNDARY < crtl->stack_alignment_estimated;
+ crtl->stack_realign_tried = crtl->stack_realign_needed;
crtl->stack_realign_processed = true;
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 1219892..7e29d2a 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -9453,8 +9453,7 @@ based_loc_descr (rtx reg, HOST_WIDE_INT offset,
pointer + offset to access stack variables. If stack
is aligned without drap, use stack pointer + offset to
access stack variables. */
- if (fde
- && fde->stack_realign
+ if (crtl->stack_realign_tried
&& cfa.reg == HARD_FRAME_POINTER_REGNUM
&& reg == frame_pointer_rtx)
{
diff --git a/gcc/function.h b/gcc/function.h
index ebba29f..1153fb0 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -417,20 +417,25 @@ struct rtl_data GTY(())
/* When set, expand should optimize for speed. */
bool maybe_hot_insn_p;
- /* Nonzero if function stack realignment is needed. This flag may be
- set twice: before and after reload. It is set before reload wrt
- stack alignment estimation before reload. It will be changed after
- reload if by then criteria of stack realignment is different.
+ /* Nonzero if function stack realignment is needed. This flag may be
+ set twice: before and after reload. It is set before reload wrt
+ stack alignment estimation before reload. It will be changed after
+ reload if by then criteria of stack realignment is different.
The value set after reload is the accurate one and is finalized. */
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
argument pointer (drap) if stack needs realigning. */
bool need_drap;
/* Nonzero if function stack realignment estimation is done, namely
- stack_realign_needed flag has been set before reload wrt
- estimated stack alignment info. */
+ stack_realign_needed flag has been set before reload wrt estimated
+ stack alignment info. */
bool stack_realign_processed;
/* Nonzero if function stack realignment has been finalized, namely