On Thu, Mar 17, 2016 at 12:16:58PM +0100, Jakub Jelinek wrote: > the rs6000 backend for whatever strange reason I haven't understood > really wants pointer equality instead of REGNO comparison (even when the > modes match), one (reg:DI 12) should be replaced, another (reg:DI 12) > should not.
By the look of what you posted in the bugzilla, the pattern is the parallel emitted by rs6000_emit_savres_rtx. In that parallel, the stack memory locations for register saves are described relative to whatever frame_reg_rtx is in use, which may be r12. rs6000_frame_related wants to translate the frame_reg_rtx into stack pointer plus offset for debug info. The parallel matches save_gpregs_<mode>_r12 and similar in rs6000.md, which emit a call to an out-of-line register save function. This function actually takes r12 as a parameter, hence the (use (reg:P 12)) in the pattern. rs6000_frame_related probably should just be replacing individual SETs in the parallel using simplify_replace_rtx. Especially since after calling replace_rtx, it already iterates over them to simplify. -- Alan Modra Australia Development Lab, IBM