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]

Re: RTX_FRAME_RELATED_P?


>> > Is RTX_FRAME_RELATED_P supposed to be set only for instructions that
>> > actually modify the stack pointer (or frame pointer, or saves a
>> > register) -- or any instruction that vaguely contributes to that
>> > process?
>> > 
>> > The MIPS back-end sets RTX_FRAME_RELATED_P for instructions that
>> > manipulate constants involving the frame size -- even when those don't
>> > directly affect the frame pointer itself.  It seems silly to emit
>> > DWARF2 information for these instructions to me, but what do I know? :-)
>> > 
>> > Help?
>> 
>> It's set for precisely those instructions which
>> dwarf2out_frame_debug_expr needs to look at to produce the correct
>> DWARF2 debugging output.
>> 

Perhaps it should be changed to dwarf2out_frame_unwind_expr...
dwarf2out_frame_debug_expr is used only to generate the frame unwind info 
for the dwarf2 unwinder. In general, It needs to be set on any instruction
in the prologue which either saves a register which is restored in the
epilogue, or modifies one of the registers which the unwinder uses
to access the stack or figure out where the top of frame is.
This includes any modifications of the stack pointer, or register moves
between the stack pointer and frame pointer, etc.

I also beleive that dwarf2out_frame_debug_expr attempts to ignore any 
instruction which is marked but cannot be relevant, but wholesale marking 
of insns isn't a good idea.

>> > The MIPS back-end sets RTX_FRAME_RELATED_P for instructions that
>> > manipulate constants involving the frame size -- even when those don't

Any chance the register used to manipulate these constants is then used
in a stack bump? I beleive it will try to track the value of one register
in order to figure out how large a stack bump is using that register,
but its pretty rudimentary.

Andrew

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