This makes make_more_copies do what its documentation says, that is, only make an intermediate pseudo if copying to a pseudo.
This regressed generated code quality when we didn't keep the original notes that were on the copy, but since r265582 we do, and only allowing pseudos now is a win. It also simplifies the code. Committing. Segher 2018-11-10 Segher Boessenkool <seg...@kernel.crashing.org> * combine.c (make_more_copies): Only make an intermediate copy if the dest of a move is a pseudo. --- gcc/combine.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gcc/combine.c b/gcc/combine.c index 77eeae7..c314206 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -14990,12 +14990,11 @@ make_more_copies (void) rtx set = single_set (insn); if (!set) continue; + rtx dest = SET_DEST (set); - if (dest == pc_rtx) - continue; - /* See PR87871. */ - if (dest == frame_pointer_rtx) - continue; + if (!(REG_P (dest) && !HARD_REGISTER_P (dest))) + continue; + rtx src = SET_SRC (set); if (!(REG_P (src) && HARD_REGISTER_P (src))) continue; -- 1.8.3.1