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 Sun, Jul 27, 2008 at 02:08:54PM -0700, H.J. Lu wrote:
> On Sun, Jul 27, 2008 at 1:03 PM, Jakub Jelinek <jakub@redhat.com> wrote:

> and here is the insn:
> 
> (insn/f 91 90 92 x.ii:6 (parallel [
>             (set (reg/f:SI 7 sp)
>                 (plus:SI (reg/f:SI 7 sp)
>                     (const_int -184 [0xffffffffffffff48])))
>             (clobber (reg:CC 17 flags))
>             (clobber (mem:BLK (scratch) [0 A8]))
>         ]) 890 {pro_epilogue_adjust_stack_1}
> (expr_list:REG_FRAME_RELATED_EXPR (sequence [
>                 (set/f (reg/f:SI 7 sp)
>                     (plus:SI (reg/f:SI 7 sp)
>                         (const_int -152 [0xffffffffffffff68])))
>                 (set (reg/f:SI 7 sp)
>                     (plus:SI (reg/f:SI 7 sp)
>                         (const_int -32 [0xffffffffffffffe0])))
>             ])
>         (expr_list:REG_UNUSED (reg:CC 17 flags)
>             (nil))))
> 
> As you can see,  since RTX_FRAME_RELATED_P (insn) is true,
> dwarf2out_stack_adjust is never called on it.  We have
> 
> (gdb) p cfa
> $1 = {offset = 0, base_offset = 0, reg = 2, indirect = 0}
> (gdb) p cfa_store
> $2 = {offset = 0, base_offset = 0, reg = 7, indirect = 0}
> 
> It comes from function foo in g++.dg/torture/stackalign/unwind-2.C
> on stack branch. It failed with -O1, -O2, -O3 before we added the
> fix.

>From unwind info POV, the above insn is equivalent to

(insn/f 91 90 92 x.ii:6 (parallel [
            (set (reg/f:SI 7 sp)
                (plus:SI (reg/f:SI 7 sp)
                    (const_int -152 [0xffffffffffffff68])))
            (clobber (reg:CC 17 flags))
            (clobber (mem:BLK (scratch) [0 A8]))
        ]) 890 {pro_epilogue_adjust_stack_1}

(insn 92 91 93 x.ii:6 (parallel [
            (set (reg/f:SI 7 sp)
                (plus:SI (reg/f:SI 7 sp)
                    (const_int -32 [0xffffffffffffffe0])))
            (clobber (reg:CC 17 flags))
        ])

except that no DW_CFA_advance_loc* in between them will be needed.
Just disable stack adjustment combining and dwarf2out_stack_adjust
will be called on the second insn.  Does stackalign/unwind-2.C
fail at -O1+ if you unconditionally return 0 from
gate_handle_stack_adjustments?  If not, where is cfa_store updated?

	Jakub


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