From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id 36DA73858419; Mon, 26 Sep 2022 10:08:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36DA73858419 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664186905; bh=TZpiqlivLS2S7QJUAbzclvkZBjPf1A4loSU7PuluylI=; h=From:To:Subject:Date:From; b=tyNrTpX7g2wtDL96bzKJC7tM/o79v4RleqQkw3puU9gsiPLYTO09DJX67xqdoCp1m BQKSPHj+PCNHdY9Ff2b+h1tbNGOrEPQLU7sOysR8RAKw1b1WU65GPoDtM5SoYhputL W+zdDRUcg3riufsWFL1+/ZxsY3bykDTD0XHfMy9c= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2867] s390: fix wrong refactoring X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/heads/master X-Git-Oldrev: c33e12fa479c01848f4a288883bf1ef848c94ca3 X-Git-Newrev: 2387cfc7f6e2065f5c040d62763f6f3a5997a444 Message-Id: <20220926100825.36DA73858419@sourceware.org> Date: Mon, 26 Sep 2022 10:08:25 +0000 (GMT) List-Id: https://gcc.gnu.org/g:2387cfc7f6e2065f5c040d62763f6f3a5997a444 commit r13-2867-g2387cfc7f6e2065f5c040d62763f6f3a5997a444 Author: Martin Liska Date: Mon Sep 26 12:06:48 2022 +0200 s390: fix wrong refactoring Since r13-2251-g1930c5d05ceff2, the refactoring is not 1:1 and we end up with a wrong rtx type. gcc/ChangeLog: * config/s390/s390.cc (s390_rtx_costs): Remove dest variable and use only dst. Diff: --- gcc/config/s390/s390.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/gcc/config/s390/s390.cc b/gcc/config/s390/s390.cc index 3ae586c60eb..9861913af05 100644 --- a/gcc/config/s390/s390.cc +++ b/gcc/config/s390/s390.cc @@ -3648,7 +3648,7 @@ s390_rtx_costs (rtx x, machine_mode mode, int outer_code, *total = 0; return true; case SET: { - rtx dest = SET_DEST (x); + rtx dst = SET_DEST (x); rtx src = SET_SRC (x); switch (GET_CODE (src)) @@ -3669,7 +3669,6 @@ s390_rtx_costs (rtx x, machine_mode mode, int outer_code, slightly more expensive than a normal load. */ *total = COSTS_N_INSNS (1) + 2; - rtx dst = SET_DEST (src); rtx then = XEXP (src, 1); rtx els = XEXP (src, 2); @@ -3696,25 +3695,25 @@ s390_rtx_costs (rtx x, machine_mode mode, int outer_code, break; } - switch (GET_CODE (dest)) + switch (GET_CODE (dst)) { case SUBREG: - if (!REG_P (SUBREG_REG (dest))) + if (!REG_P (SUBREG_REG (dst))) *total += rtx_cost (SUBREG_REG (src), VOIDmode, SET, 0, speed); /* fallthrough */ case REG: /* If this is a VR -> VR copy, count the number of registers. */ - if (VECTOR_MODE_P (GET_MODE (dest)) && REG_P (src)) + if (VECTOR_MODE_P (GET_MODE (dst)) && REG_P (src)) { - int nregs = s390_hard_regno_nregs (VR0_REGNUM, GET_MODE (dest)); + int nregs = s390_hard_regno_nregs (VR0_REGNUM, GET_MODE (dst)); *total = COSTS_N_INSNS (nregs); } /* Same for GPRs. */ else if (REG_P (src)) { int nregs - = s390_hard_regno_nregs (GPR0_REGNUM, GET_MODE (dest)); + = s390_hard_regno_nregs (GPR0_REGNUM, GET_MODE (dst)); *total = COSTS_N_INSNS (nregs); } else @@ -3722,7 +3721,7 @@ s390_rtx_costs (rtx x, machine_mode mode, int outer_code, *total += rtx_cost (src, mode, SET, 1, speed); return true; case MEM: { - rtx address = XEXP (dest, 0); + rtx address = XEXP (dst, 0); rtx tmp; HOST_WIDE_INT tmp2; if (s390_loadrelative_operand_p (address, &tmp, &tmp2))