https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122274

--- Comment #6 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Jeffrey A. Law from comment #5)
> WRT c#2, I concur with Segher and Surya.  Once regcprop does its job we lose
> track of the fact we're mucking around the LR.  There's no reasonable way
> for the CFI bits to recover that information once we do the propagation and
> delete insn 44.

It should be possible (but non-trivial) to when we CSE two insns differing in
frame-relatedness, to figure out if the result should be frame-related or not.
OTOH, it is easier to just refuse to CSE such insns, and we should also mark
the insns generated by __builtin_return_address (and its granddaddy
__builtin_frame_address) as frame-related, fixing the trivial performance loss
caused by the first fix.

Reply via email to