From 2c3d487a9a8af00c0c462cd4e1a112804b9cc156 Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Sun, 13 Dec 2020 20:46:17 +0000 Subject: [PATCH] VAX: Unify push operation selection Avoid the possibility of code discrepancies like one fixed with the previous change and improve the structure of code by selecting between push and non-push operations in a single place in `vax_output_int_move'. The PUSHAB/MOVAB address moves are never actually produced from this code as the SImode invocation of this function is guarded with the `nonsymbolic_operand' predicate, but let's not mess up with this code too much on this occasion and keep the piece in place. * config/vax/vax.c (vax_output_int_move): Unify push operation selection. --- gcc/config/vax/vax.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index 7c0adac6aaf..f5968d60fd6 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -1235,6 +1235,7 @@ vax_output_int_move (rtx insn ATTRIBUTE_UNUSED, rtx *operands, { rtx hi[3], lo[3]; const char *pattern_hi, *pattern_lo; + bool push_p; switch (mode) { @@ -1345,19 +1346,13 @@ vax_output_int_move (rtx insn ATTRIBUTE_UNUSED, rtx *operands, return "movq %1,%0"; case E_SImode: + push_p = push_operand (operands[0], SImode); + if (symbolic_operand (operands[1], SImode)) - { - if (push_operand (operands[0], SImode)) - return "pushab %a1"; - return "movab %a1,%0"; - } + return push_p ? "pushab %a1" : "movab %a1,%0"; if (operands[1] == const0_rtx) - { - if (push_operand (operands[0], SImode)) - return "pushl %1"; - return "clrl %0"; - } + return push_p ? "pushl %1" : "clrl %0"; if (CONST_INT_P (operands[1]) && (unsigned HOST_WIDE_INT) INTVAL (operands[1]) >= 64) @@ -1383,9 +1378,7 @@ vax_output_int_move (rtx insn ATTRIBUTE_UNUSED, rtx *operands, if (i >= -0x8000 && i < 0) return "cvtwl %1,%0"; } - if (push_operand (operands[0], SImode)) - return "pushl %1"; - return "movl %1,%0"; + return push_p ? "pushl %1" : "movl %1,%0"; case E_HImode: if (CONST_INT_P (operands[1])) -- 2.30.2