On Tuesday 20 May 2008, Andrew Pinski wrote: > On Tue, May 20, 2008 at 2:30 PM, Omar Torres <[EMAIL PROTECTED]> wrote: > > By looking at other ports, I learned that I can detect when this happens > > by using the reg_overlap_mentioned_p(). Here is one case: > > (insn 43 115 74 (set (reg:HI 7 %i0h) > > (mem/s/j:HI (plus:HI (reg/f:HI 7 %i0h [orig:39 source ] [39]) > > (const_int 2 [0x2])) [0 <variable>.r+0 S2 A8])) 3 > > {*movhi} (nil) > > (nil)) > > > > I need to tell the compiler not to use as destination the same base > > register when doing index operations. Any suggestions on how do I that? > > Early clobber, that is using "=&r" as the constraint.
Does this work reliably for straight mov patterns and during reload? Sounds like in the general case it would need secondary reloads, which is a whole lot of extra magic. I remember having similar problems with ARM doubleword loads and ended up having to hack round the restriction in the asm output routines, and outlaw some of the more problematic problematic autoincrement modes. Paul