This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix -mno-accumulate-outgoing-args -fasynchronous-unwind-tables (PR rtl-optimization/36419, take 2)
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: "Jakub Jelinek" <jakub at redhat dot com>
- Cc: "Jason Merrill" <jason at redhat dot com>, "Eric Botcazou" <ebotcazou at adacore dot com>, gcc-patches at gcc dot gnu dot org, "Xuepeng Guo" <xuepeng dot guo at intel dot com>, "Joey Ye" <joey dot ye at intel dot com>
- Date: Mon, 21 Jul 2008 22:33:23 -0700
- Subject: Re: [PATCH] Fix -mno-accumulate-outgoing-args -fasynchronous-unwind-tables (PR rtl-optimization/36419, take 2)
- References: <20080611133108.GM8133@devserv.devel.redhat.com> <200806151630.27801.ebotcazou@adacore.com> <20080615155952.GH8133@devserv.devel.redhat.com> <200806152358.59302.ebotcazou@adacore.com> <20080619194814.GT8133@devserv.devel.redhat.com>
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.