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: [PATCH] Fix -mno-accumulate-outgoing-args -fasynchronous-unwind-tables (PR rtl-optimization/36419, take 2)


On Thu, Jun 19, 2008 at 12:48 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Sun, Jun 15, 2008 at 11:58:59PM +0200, Eric Botcazou wrote:
>> > I agree that representing it in RTL rather than on the side would be
>> > cleaner.  But from what I can see, most of the targets set
>> > REG_FRAME_RELATED_EXPR to something that doesn't have RTX_FRAME_RELATED_P,
>> > so dwarf2out.c would be confused about them.  Furthermore, it is
>> > possible that some target already has different REG_FRAME_RELATED_EXPR
>> > on it (maybe not, haven't read all the backends to see what they set
>> > REG_FRAME_RELATED_EXPR on).
>>
>> My understanding is that you can always add a new CFI, even if there is
>> already one, just make a PARALLEL if needed.  So we could devise a new
>> RTL representation for DW_CFA_GNU_args_size and use it there.  But I
>> cannot really approve anything in this area so discussing this with a
>> maintainer would probably be more productive. :-)
>
> Actually, it seems it is possible to use REG_FRAME_RELATED_EXPR
> here, as dwarf2out documents, for compatibility reasons the first set
> in PARALLEL/SEQUENCE isn't checked from RTX_FRAME_RELATED_P, but all
> others are.
>
> Here is what I've bootstrapped/regtested on i686-linux.  It shouldn't
> fix just the case of CSA pass merging post-prologue stack adjustment
> into prologue stack adjustment, but also merging two prologue stack
> adjustments if the first one has REG_FRAME_RELATED_EXPR on it.
>
> Ok for trunk/4.3?
>
> 2008-06-19  Jakub Jelinek  <jakub@redhat.com>
>
>        PR rtl-optimization/36419
>        * combine-stack-adj.c (adjust_frame_related_expr): New function.
>        (combine_stack_adjustments_for_block): Call it if needed.  Delete
>        correct insn.
>        * dwarf2out.c (dwarf2out_frame_debug_expr): Adjust
>        DW_CFA_GNU_args_size if CSA pass merged some adjustments into
>        prologue sp adjustment.
>
>        * g++.dg/eh/async-unwind1.C: New test.
>

Don't you also need

Index: dwarf2out.c
===================================================================
--- dwarf2out.c (revision 3335)
+++ dwarf2out.c (working copy)
@@ -1672,6 +1672,9 @@ dwarf2out_frame_debug_expr (rtx expr, co
                  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

Otherwise, cfa_store.offset will be wrong if it is ever used. It does
happen in a testcase on
stack branch.


-- 
H.J.


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