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]
Other format: [Raw text]

Re: Fix PR24908: ICE in dwarf2out for cpu2000 with -funroll-loops


On Fri, Nov 18, 2005 at 02:08:41PM -0800, Geoff Keating wrote:
> 
> On 18/11/2005, at 1:40 PM, Richard Henderson wrote:
> 
> >On Fri, Nov 18, 2005 at 11:46:25AM -0800, Geoff Keating wrote:
> >>The assert is because it's ambiguous; for instance, you can't tell if
> >>it's a save of lr in r26, or a restore of r26 from lr.

That's awkward.

> >Not at all; first of all, we don't model restores.
> 
> I'm pretty sure we can generate them even in the prolog; you see code  
> like
> 
> 	mflr r12  // save return address in r12
> 	bl __GLOBAL_OFFSET_TABLE__@local
> 	mflr r28  // save GOT address in r28 (not frame related)
> 	mtlr r12  // restore return address from r12
> 
> I don't know if this code tries to deal with that or not; maybe we  
> just don't mark the save/restore as frame related and hope that no  
> trapping operation gets scheduled between the 'mflr' and the 'mtlr'.

Hmm, if we don't track the restore of lr in this case, then we will
confuse the unwinder.  Imagine unwinding through a point a little later
in the function where we have used r12 as a scratch.  Unless we tell the
unwinder that the return address is no longer in r12, it will use an
invalid address as the return.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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