The documentation (rtl.texi) says: When a @code{clobber} expression for a register appears inside a @code{parallel} with other side effects, the register allocator guarantees that the register is unoccupied both before and after that insn if it is a hard register clobber.
and at least the rs6000 backend relies on that (see PR83245). This patch restores that behaviour. Registers that are also used as operands in the instruction are not treated as earlyclobber, so such insns also still work (PR80818, an s390 testcase). Tested on powerpc64-linux {-m32,-m64}, also tested with a s390 cross. Andreas, can you confirm this really still works after this patch? Vlad, if so, is this okay for trunk? Segher 2017-12-02 Segher Boessenkool <seg...@kernel.crashing.org> * lra.c (collect_non_operand_hard_regs): Treat clobbers of non-operand hard registers as earlyclobber, also if not in an asm. --- gcc/lra.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/gcc/lra.c b/gcc/lra.c index f49c50a..0d76eac 100644 --- a/gcc/lra.c +++ b/gcc/lra.c @@ -888,14 +888,10 @@ collect_non_operand_hard_regs (rtx_insn *insn, rtx *x, list, OP_IN, false); break; case CLOBBER: - { - int code = INSN_CODE (insn); - /* We treat clobber of non-operand hard registers as early - clobber (the behavior is expected from asm). */ - list = collect_non_operand_hard_regs (insn, &XEXP (op, 0), data, - list, OP_OUT, code < 0); - break; - } + /* We treat clobber of non-operand hard registers as early clobber. */ + list = collect_non_operand_hard_regs (insn, &XEXP (op, 0), data, + list, OP_OUT, true); + break; case PRE_INC: case PRE_DEC: case POST_INC: case POST_DEC: list = collect_non_operand_hard_regs (insn, &XEXP (op, 0), data, list, OP_INOUT, false); -- 1.8.3.1