]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR debug/36976 (FAIL: g++.dg/torture/stackalign/unwind-2.C)
authorH.J. Lu <hongjiu.lu@intel.com>
Thu, 31 Jul 2008 14:33:43 +0000 (14:33 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Thu, 31 Jul 2008 14:33:43 +0000 (07:33 -0700)
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

gcc/ChangeLog
gcc/dwarf2out.c

index c83a2faa81cdeff93bf19ab01ca6d19effd4cf7d..e293cc5ec021ca02f05e1035cc528ea52ce2cc72 100644 (file)
@@ -1,3 +1,10 @@
+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>
 
        PR tree-optimization/36978
index dbf5105604b8652fe4996418a3c2790f4d6948fc..888ac99d187c8ab50e35bab56c3c1277332530f0 100644 (file)
@@ -387,6 +387,7 @@ static void output_cfi (dw_cfi_ref, dw_fde_ref, int);
 static void output_call_frame_info (int);
 static void dwarf2out_note_section_used (void);
 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 bool clobbers_queued_reg_save (const_rtx);
 static void dwarf2out_frame_debug_expr (rtx, const char *);
@@ -1225,9 +1226,21 @@ dwarf2out_stack_adjust (rtx insn, bool after_p)
   if (offset == 0)
     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)
     cfa.offset += offset;
 
+  if (cfa_store.reg == STACK_POINTER_REGNUM)
+    cfa_store.offset += offset;
+
 #ifndef STACK_GROWS_DOWNWARD
   offset = -offset;
 #endif
@@ -1236,7 +1249,6 @@ dwarf2out_stack_adjust (rtx insn, bool after_p)
   if (args_size < 0)
     args_size = 0;
 
-  label = dwarf2out_cfi_label ();
   def_cfa_1 (label, &cfa);
   if (flag_asynchronous_unwind_tables)
     dwarf2out_args_size (label, args_size);
@@ -1668,22 +1680,7 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label)
              HOST_WIDE_INT offset = stack_adjust_offset (elem);
 
              if (offset != 0)
-               {
-                 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);
-               }
+               dwarf2out_args_size_adjust (offset, label);
            }
        }
       return;