On Mon, Nov 03, 2025 at 09:45:50AM +0100, Eric Botcazou wrote: > > I would deeply appreciate if the community can provide feedback as to > > whether preventing hardreg copy propagation based on the frame-relatedness > > of the instructions is fine. > > This looks like the most straightforward approach, so I'd give it a try and > post a patch along these lines on the gcc-patches@ list (you can CC me on it). > If other people come up with a better idea, we can further discuss from there.
Thank you! As a follow-up, we'll post a patch to make the insns generated by __builtin_get_return_address (and its parent __builtin_get_frame_address) marked RTX_FRAME_RELATED (which really means: has its CFI automatically generated). This will then allow the insns in the motivating testcase to be CSE'd again (but without causing problems, this time :-) ) Segher
