This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: dwarf2/ACCUMULATE_OUTGOING_ARGS fix
- To: Jason Merrill <jason at redhat dot com>
- Subject: Re: dwarf2/ACCUMULATE_OUTGOING_ARGS fix
- From: Jan Hubicka <jh at suse dot cz>
- Date: Wed, 21 Feb 2001 17:49:21 +0100
- Cc: Jan Hubicka <jh at suse dot cz>, Jeffrey A Law <law at redhat dot com>, patches at x86-64 dot org, gcc-patches at gcc dot gnu dot org
- References: <20010102200705.H6101@atrey.karlin.mff.cuni.cz> <2114.978494367@upchuck> <20010103155639.C13216@atrey.karlin.mff.cuni.cz> <u9wvbc99m5.fsf@casey.cambridge.redhat.com>
>
> > Simply because the i386 "pascal" convention makes function to deallocate the
> > stack after return. This needs to be handled with -maccumulate-outgoing-args
> > by adjusting stack back after the return.
>
> Why does this need to happen for EH unwinding? If we're returning via
> exception, we won't have run the epilogue which would have deallocated the
> stack. The args_size stuff is there to handle caller-pop semantics.
You've missed what I am saying. The sequence is
pascal function call changing stack pointer
..
<some code>
..
lazy update of stack back to original value
<some branch>
If exception happends in <some code>, the information about stack offset is
bogus. This is rare case, but can actually happen.
>
> > Later the stack adjustments may be moved further into code, so they cause
> > failures in the tests explicitly constructed for this case.
>
> > But the real motivation for this patch was different - I was investigating
> > possibility of using dwarf2 unwind info as the only way to unwind stack on
> > x86_64 (by dropping the i386 base pointer) and I needed to measure how large
> > code bloat it causes to emit explicit unwind info for each instruction.
>
> > Enabling -maccumulate-outgoing-args caused important improvements, since gcc
> > dropped updating the CFA offsets in the epilogues, that still do use pop
> > instruction.
>
> Yes. For an arbitrary testcase, I see that -fomit-frame-pointer causes the
> unwind info to explode, and adding -maccumulate-outgoing-args brings it
> back under control.
This is still true after the patch, since the code pointed out above is really,
really rare. The benefits are just slightly lower.
Honza
>
> Jason