From 1a0f964e4d100a39eb388ea68b71d870f5de2049 Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Fri, 2 Oct 2020 00:06:56 +0000 Subject: [PATCH] rs6000: Don't use operands[] for temporaries in define_expand In ac001f5ce604 Alan fixed my thinko using operands that do not refer to anything mentioned in the RTL pattern. Instead, it just uses fresh new local rtxes for those. This patch takes that a tiny bit further: it uses local rtx for all temporaries used in the expanders. As a bonus that simplifies the code a tiny bit as well. 2020-11-06 Segher Boessenkool * config/rs6000/rs6000.md (@tablejump_normal): Don't abuse operands[]. (@tablejump_nospec): Ditto. --- gcc/config/rs6000/rs6000.md | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index acbf1303ab2..5e5ad9f7c3d 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -12732,14 +12732,11 @@ (use (match_operand:P 1))] "rs6000_speculate_indirect_jumps" { - rtx off; - operands[0] = force_reg (SImode, operands[0]); - if (mode == SImode) - off = operands[0]; - else + rtx off = force_reg (SImode, operands[0]); + if (mode != SImode) { + rtx src = gen_rtx_fmt_e (SIGN_EXTEND, Pmode, off); off = gen_reg_rtx (Pmode); - rtx src = gen_rtx_fmt_e (SIGN_EXTEND, Pmode, operands[0]); emit_move_insn (off, src); } @@ -12757,14 +12754,11 @@ (use (match_operand:CC 2))] "!rs6000_speculate_indirect_jumps" { - rtx off; - operands[0] = force_reg (SImode, operands[0]); - if (mode == SImode) - off = operands[0]; - else + rtx off = force_reg (SImode, operands[0]); + if (mode != SImode) { + rtx src = gen_rtx_fmt_e (SIGN_EXTEND, Pmode, off); off = gen_reg_rtx (Pmode); - rtx src = gen_rtx_fmt_e (SIGN_EXTEND, Pmode, operands[0]); emit_move_insn (off, src); } -- 2.30.2