This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fix incorrect computation of DW_CFA_GNU_args_size in nested calls


On Mar 16, 2006, Richard Henderson <rth@redhat.com> wrote:

> On Thu, Mar 16, 2006 at 01:44:34PM -0300, Alexandre Oliva wrote:
>> Ok to install the non-reversal patch?  Do you think a better
>> formulation of any of the bits in the reversal patch should go in too?

> Well, I certainly don't like the 0's

That's what I meant by `a better formulation' :-)  Please find an
exact reversal of the obsolete bits of your earlier patch below.  Ok
to install that?

> and the libjava patch reversal seems wrong.

Indeed, that was just for my testing, to try to exercise the formerly
faulty condition.

>> * dwarf2out.c (dwarf2out_stack_adjust): Always track the stack
>> pointer, instead of assuming it is possible to derive the
>> correct args size from a call insn.

> I'm ok with this though.

It's in the trunk now.  Should it go in earlier branches too?

for gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	PR target/23602
	* toplev.c (process_options): Revert 2005-10-05 work around.
	* config/i386/i386.c (override_options): Likewise.

for gcc/testsuite/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	PR target/23602
	* g++.dg/eh/omit-frame-pointer.C: Revert 2005-10-05 work around.
	* g++.dg/eh/omit-frame-pointer2.C: Likewise.

Index: gcc/config/i386/i386.c
===================================================================
--- gcc/config/i386/i386.c.orig	2006-03-17 03:10:53.000000000 -0300
+++ gcc/config/i386/i386.c	2006-03-17 03:11:59.000000000 -0300
@@ -1954,21 +1954,6 @@ override_options (void)
       && !optimize_size)
     target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS;
 
-  /* ??? Unwind info is not correct around the CFG unless either a frame
-     pointer is present or M_A_O_A is set.  Fixing this requires rewriting
-     unwind info generation to be aware of the CFG and propagating states
-     around edges.  */
-  if ((flag_unwind_tables || flag_asynchronous_unwind_tables
-       || flag_exceptions || flag_non_call_exceptions)
-      && flag_omit_frame_pointer
-      && !(target_flags & MASK_ACCUMULATE_OUTGOING_ARGS))
-    {
-      if (target_flags_explicit & MASK_ACCUMULATE_OUTGOING_ARGS)
-	warning (0, "unwind tables currently require either a frame pointer "
-		 "or -maccumulate-outgoing-args for correctness");
-      target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS;
-    }
-
   /* Figure out what ASM_GENERATE_INTERNAL_LABEL builds as a prefix.  */
   {
     char *p;
Index: gcc/toplev.c
===================================================================
--- gcc/toplev.c.orig	2006-03-16 04:30:54.000000000 -0300
+++ gcc/toplev.c	2006-03-17 03:12:13.000000000 -0300
@@ -1804,18 +1804,6 @@ process_options (void)
     }
   if (!flag_stack_protect)
     warn_stack_protect = 0;
-
-  /* ??? Unwind info is not correct around the CFG unless either a frame
-     pointer is present or A_O_A is set.  Fixing this requires rewriting
-     unwind info generation to be aware of the CFG and propagating states
-     around edges.  */
-  if (flag_unwind_tables && !ACCUMULATE_OUTGOING_ARGS
-      && flag_omit_frame_pointer)
-    {
-      warning (0, "unwind tables currently requires a frame pointer "
-	       "for correctness");
-      flag_omit_frame_pointer = 0;
-    }
 }
 
 /* Initialize the compiler back end.  */
Index: gcc/testsuite/g++.dg/eh/omit-frame-pointer.C
===================================================================
--- gcc/testsuite/g++.dg/eh/omit-frame-pointer.C.orig	2005-10-28 16:06:51.000000000 -0200
+++ gcc/testsuite/g++.dg/eh/omit-frame-pointer.C	2006-03-17 03:18:44.000000000 -0300
@@ -1,5 +1,6 @@
 // { dg-do run }
 // { dg-options -fomit-frame-pointer }
+// { dg-options "-fomit-frame-pointer -mno-accumulate-outgoing-args" { target i?86-*-* } }
 
 #include <iostream>
 
Index: gcc/testsuite/g++.dg/eh/omit-frame-pointer2.C
===================================================================
--- gcc/testsuite/g++.dg/eh/omit-frame-pointer2.C.orig	2005-10-28 16:06:51.000000000 -0200
+++ gcc/testsuite/g++.dg/eh/omit-frame-pointer2.C	2006-03-17 03:19:01.000000000 -0300
@@ -1,5 +1,6 @@
 // Reduced from PR c++/5246, PR c++/2447
 // { dg-options "-O -fomit-frame-pointer" }
+// { dg-options "-O -fomit-frame-pointer -mno-accumulate-outgoing-args" { target i?86-*-* } }
 // { dg-do run }
 
 void step (int)
-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Secretary for FSF Latin America        http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]