On Thu, Mar 17, 2016 at 11:07:03PM +1030, Alan Modra wrote: > 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.
That was one thing, and another thing was during combiner, where it replaced just subset of the registers and left others in (e.g. with different mode). And on aarch64 trying to replace flags reg with CC_NZ mode when there is CC mode (or vice versa?). I bet for GCC 7 we want to analyze all uses of replace_rtx for what exactly we want. Jakub