On 2012-11-18 23:53, Jakub Jelinek wrote: > I'd prefer to only invalidate the stack pointer on the first assignment > to the hard pointer. If the cselib link between sp and hfp is already > broken, invalidating sp will only result in worse code. Dunno if there > are any targets that adjust the hard frame pointer after it has been set > once or similar.
I'm not aware of such a target. Though I did not audit them now. > Perhaps we could walk here CSELIB_VAL_PTR (hfpval)->locs here, and look > if any rtls in there have find_base_term (x->loc) == find_base_term > (stack_pointer_rtx), and only if yes, invalidate (and guard it by the > modified_in_p test). Sounds plausible. > BTW, var-tracking.c uses a similar test. Ouch. Where is that? r~