This is the mail archive of the
mailing list for the GCC project.
Re: dwarf2/ACCUMULATE_OUTGOING_ARGS fix
- To: Jan Hubicka <jh at suse dot cz>
- Subject: Re: dwarf2/ACCUMULATE_OUTGOING_ARGS fix
- From: Jason Merrill <jason at redhat dot com>
- Date: 21 Feb 2001 16:37:19 +0000
- Cc: 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>
>>>>> "Jan" == Jan Hubicka <email@example.com> writes:
>> In message <20010102200705.H6101@atrey.karlin.mff.cuni.cz>you write:
>> > Hi
>> > The final.c assumes that ACCUMULATE_OUTGOING_ARGS hosts never modify
>> > stack pointer in the function body. This is not quite true for i386
>> > that may call pascal functions and modify stack pointer in few
>> > other cases as well.
>> Under precisely what conditions can code still modify the stack pointer
>> when ACCUMULATE_OUTGOING_ARGS is true? And I'm curious why calling pascal
>> routines requires modification of the stack pointer.
> 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.
> 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
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.