]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/10127 (-fstack-check let's program crash)
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 25 Nov 2009 19:55:11 +0000 (19:55 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 25 Nov 2009 19:55:11 +0000 (19:55 +0000)
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

gcc/ChangeLog
gcc/dwarf2out.c

index 557946011254ebfe57ab2efbaed1cd2929e918b5..55acd66d12990feb2883563dafb0e4692ead8d36 100644 (file)
@@ -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.
index 3a6053e529de4400bf01e35033ec22603875c68d..3e3cf316acbe6b4f0e7dd84268d05b53a905d36a 100644 (file)
@@ -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;
     }