This is the mail archive of the gcc-bugs@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]

Re: ARM problems with the exception unwinder


>>>>> "Richard" == Richard Earnshaw <rearnsha@arm.com> writes:

>> > The problem is that when cfa_reg is set to the frame pointer, the stack 
>> > pointer value pushed on the stack is updated,
>> 
>> I think that's the bug.  How can that be right?  Surely the value pushed on
>> the stack in the prologue shouldn't need adjustment?
>> 
>> When unwinding, we should always restore SP using the offset, never using
>> the value saved in the stack.

> Are you suggesting I need to create special stack frame when compiling 
> __[re]throw that doesn't save the stack pointer?

No, just that we should avoid copying the saved values from other frames
into the __throw frame.  Thus the code to ignore that particular store.

>> No.  Usually a save slot for ustate.cfa_reg just means that the frame
>> pointer was saved at the beginning of the prologue.  The code you reference
>> in frame_dwarf2 refers to "saving" the CFA register after its value from
>> the caller has already been clobbered with some value derived from SP.

> So do we correctly restore the frame pointer when we have fp as the 
> cfa_reg and we have an instruction of the form

> 	stmfd	sp!, {...., fp, ...}

I don't see why not.

Jason

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