This is the mail archive of the gcc@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: stack-protection vs alloca vs dwarf2


On 04/18/2014 11:31 PM, Richard Henderson wrote:
> On 04/17/2014 10:14 AM, DJ Delorie wrote:
>> _medium_frame:                           
>>         pushm   r6-r12                   
>>         add     #-4, r0, r6              ; marked frame-related (fp = sp - 4)
>>         mov.L   r6, r0                   ; marked frame-related (sp = fp)
> 
> There's your bug.  If the frame pointer is required, you shouldn't mark that
> third insn as frame related.
> 
> With this sequence, the auto-guessing code is assuming that r6 is just a
> computational temporary and that sp is still the cfa.

This auto-guessing mistake is why I strongly recommend not using it if
possible.  Better to use explicit REG_CFA_DEF_CFA (et al) notes.  Certainly
one *must* use the explicit notes for the epilogue.


r~


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