aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2017-12-04 10:30:37 +0100
committerSegher Boessenkool <segher@gcc.gnu.org>2017-12-04 10:30:37 +0100
commit80850da1e9e9866ff7792865bebea52114d0231c (patch)
treeb2fb5b95780d8b3443f180aa4ebd7bf4bdc96007
parent155f67eb98d082414be01425ca5eff3b9c3230fe (diff)
downloadgcc-80850da1e9e9866ff7792865bebea52114d0231c.zip
gcc-80850da1e9e9866ff7792865bebea52114d0231c.tar.gz
gcc-80850da1e9e9866ff7792865bebea52114d0231c.tar.bz2
lra: Clobbers in a parallel are earlyclobbers (PR83245)
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). PR rtl-optimization/83245 * lra.c (collect_non_operand_hard_regs): Treat clobbers of non-operand hard registers as earlyclobber, also if not in an asm. From-SVN: r255377
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/lra.c12
2 files changed, 10 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9549613..3b0f55f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2017-12-04 Segher Boessenkool <segher@kernel.crashing.org>
+ PR rtl-optimization/83245
+ * lra.c (collect_non_operand_hard_regs): Treat clobbers of non-operand
+ hard registers as earlyclobber, also if not in an asm.
+
+2017-12-04 Segher Boessenkool <segher@kernel.crashing.org>
+
PR bootstrap/83265
Revert
2017-12-01 Segher Boessenkool <segher@kernel.crashing.org>
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);