aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2009-11-25 19:55:11 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2009-11-25 19:55:11 +0000
commit42da303a46b048bab9a00ae44fd38ca837984e69 (patch)
treed58606aeb47222923d07c9450d1ac0e8dfd73593 /gcc
parent85b1d1bd1aeba0edb8625894287dba91350fb929 (diff)
downloadgcc-42da303a46b048bab9a00ae44fd38ca837984e69.zip
gcc-42da303a46b048bab9a00ae44fd38ca837984e69.tar.gz
gcc-42da303a46b048bab9a00ae44fd38ca837984e69.tar.bz2
re PR target/10127 (-fstack-check let's program crash)
PR target/10127 PR ada/20548 PR middle-end/42004 * dwarf2out.c (dwarf2out_args_size_adjust): Rename to... (dwarf2out_stack_adjust): ...this. Do not adjust the arg size for ACCUMULATE_OUTGOING_ARGS targets. Rename former version to... (dwarf2out_notice_stack_adjust): ...this. Adjust for above renaming. (dwarf2out_frame_debug_expr): Revert previous change and adjust for above renaming. (dwarf2out_frame_debug): Add ??? comment. Adjust for above renaming. From-SVN: r154650
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/dwarf2out.c27
2 files changed, 29 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5579460..55acd66 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,16 @@
+2009-11-25 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/10127
+ PR ada/20548
+ PR middle-end/42004
+ * dwarf2out.c (dwarf2out_args_size_adjust): Rename to...
+ (dwarf2out_stack_adjust): ...this. Do not adjust the arg size for
+ ACCUMULATE_OUTGOING_ARGS targets. Rename former version to...
+ (dwarf2out_notice_stack_adjust): ...this. Adjust for above renaming.
+ (dwarf2out_frame_debug_expr): Revert previous change and adjust for
+ above renaming.
+ (dwarf2out_frame_debug): Add ??? comment. Adjust for above renaming.
+
2009-11-25 Uros Bizjak <ubizjak@gmail.com>
* config/i386/predicates.md (emms_operation): New predicate.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 3a6053e..3e3cf31 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -1524,10 +1524,10 @@ dwarf2out_args_size (const char *label, HOST_WIDE_INT size)
add_fde_cfi (label, cfi);
}
-/* Adjust args_size based on stack adjustment OFFSET. */
+/* Record a stack adjustment of OFFSET bytes. */
static void
-dwarf2out_args_size_adjust (HOST_WIDE_INT offset, const char *label)
+dwarf2out_stack_adjust (HOST_WIDE_INT offset, const char *label)
{
if (cfa.reg == STACK_POINTER_REGNUM)
cfa.offset += offset;
@@ -1535,6 +1535,9 @@ dwarf2out_args_size_adjust (HOST_WIDE_INT offset, const char *label)
if (cfa_store.reg == STACK_POINTER_REGNUM)
cfa_store.offset += offset;
+ if (ACCUMULATE_OUTGOING_ARGS)
+ return;
+
#ifndef STACK_GROWS_DOWNWARD
offset = -offset;
#endif
@@ -1549,11 +1552,11 @@ dwarf2out_args_size_adjust (HOST_WIDE_INT offset, const char *label)
}
/* Check INSN to see if it looks like a push or a stack adjustment, and
- make a note of it if it does. EH uses this information to find out how
- much extra space it needs to pop off the stack. */
+ make a note of it if it does. EH uses this information to find out
+ how much extra space it needs to pop off the stack. */
static void
-dwarf2out_stack_adjust (rtx insn, bool after_p)
+dwarf2out_notice_stack_adjust (rtx insn, bool after_p)
{
HOST_WIDE_INT offset;
const char *label;
@@ -1637,7 +1640,7 @@ dwarf2out_stack_adjust (rtx insn, bool after_p)
return;
label = dwarf2out_cfi_label (false);
- dwarf2out_args_size_adjust (offset, label);
+ dwarf2out_stack_adjust (offset, label);
}
#endif
@@ -2206,8 +2209,7 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label)
&& (!MEM_P (SET_DEST (elem)) || GET_CODE (expr) == SEQUENCE)
&& (RTX_FRAME_RELATED_P (elem) || par_index == 0))
dwarf2out_frame_debug_expr (elem, label);
- else if (!ACCUMULATE_OUTGOING_ARGS
- && GET_CODE (elem) == SET
+ else if (GET_CODE (elem) == SET
&& par_index != 0
&& !RTX_FRAME_RELATED_P (elem))
{
@@ -2216,7 +2218,7 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label)
HOST_WIDE_INT offset = stack_adjust_offset (elem, args_size, 0);
if (offset != 0)
- dwarf2out_args_size_adjust (offset, label);
+ dwarf2out_stack_adjust (offset, label);
}
}
return;
@@ -2709,10 +2711,13 @@ dwarf2out_frame_debug (rtx insn, bool after_p)
if (!NONJUMP_INSN_P (insn) || clobbers_queued_reg_save (insn))
flush_queued_reg_saves ();
- if (! RTX_FRAME_RELATED_P (insn))
+ if (!RTX_FRAME_RELATED_P (insn))
{
+ /* ??? This should be done unconditionally since stack adjustments
+ matter if the stack pointer is not the CFA register anymore but
+ is still used to save registers. */
if (!ACCUMULATE_OUTGOING_ARGS)
- dwarf2out_stack_adjust (insn, after_p);
+ dwarf2out_notice_stack_adjust (insn, after_p);
return;
}