The code with an intermediate register is perfectly fine, but LRA apparently cannot handle the resulting code, or perhaps something else is wrong. In either case, making an extra temporary will not likely help here, so let's just skip it.
Committing. Segher 2018-11-05 Segher Boessenkool <seg...@kernel.crashing.org> PR rtl-optimization/87871 * combine.c (make_more_copies): Skip if dest is frame_pointer_rtx. --- gcc/combine.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/combine.c b/gcc/combine.c index dfb0b44..77eeae7 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -14993,6 +14993,9 @@ make_more_copies (void) rtx dest = SET_DEST (set); if (dest == pc_rtx) continue; + /* See PR87871. */ + if (dest == frame_pointer_rtx) + continue; rtx src = SET_SRC (set); if (!(REG_P (src) && HARD_REGISTER_P (src))) continue; -- 1.8.3.1