From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2119) id 3C1023858D32; Tue, 14 Nov 2023 21:30:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C1023858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699997450; bh=BcLECwQOUPb+ZAbwN2FaAYlqmz69gHv0qkvHOxoM4iw=; h=From:To:Subject:Date:From; b=OgX7EqTBXxOS1iUgUneZMb2beNHVYzzAw36DArzp37EssPQ3OoEvk7HBR6Hzth0I7 PPO4bDSXpO/yTH6Dv3fmRFleYEE/wNKZwFgQgwSmLhHRX56XGEZD5cf9tHAcbU2068 RAMGh3F6yLD5M5bB28ZO1auibG0ag2jiEtM9tdjI= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jeff Law To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/riscv/heads/ext-dce)] Strip STRICT_LOW_PART and paradoxical subregs before the mode size test. X-Act-Checkin: gcc X-Git-Author: Jeff Law X-Git-Refname: refs/vendors/riscv/heads/ext-dce X-Git-Oldrev: 8ee8193675df834fb5f7c7555531934bbb1ec6b5 X-Git-Newrev: 3b02d7ab96cf4d7fcdb8b9e0ed904002551e9597 Message-Id: <20231114213050.3C1023858D32@sourceware.org> Date: Tue, 14 Nov 2023 21:30:50 +0000 (GMT) List-Id: https://gcc.gnu.org/g:3b02d7ab96cf4d7fcdb8b9e0ed904002551e9597 commit 3b02d7ab96cf4d7fcdb8b9e0ed904002551e9597 Author: Jeff Law Date: Tue Nov 14 14:29:33 2023 -0700 Strip STRICT_LOW_PART and paradoxical subregs before the mode size test. Diff: --- gcc/ext-dce.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gcc/ext-dce.cc b/gcc/ext-dce.cc index e3e5cc5588c..d26da53418a 100644 --- a/gcc/ext-dce.cc +++ b/gcc/ext-dce.cc @@ -115,10 +115,6 @@ ext_dce_process_sets (rtx_insn *insn, bitmap livenow, bitmap live_tmp) if (VECTOR_MODE_P (GET_MODE (x)) || GET_MODE (x) > E_DImode) continue; - /* Similarly if we have a SUBREG of a wide mode. */ - if (SUBREG_P (x) && GET_MODE (SUBREG_REG (x)) > E_DImode) - continue; - /* We could have (strict_low_part (subreg ...)). It's always safe to leave bits live, even when they are not. So we can just strip the STRICT_LOW_PART for now. Similarly for a paradoxical @@ -126,6 +122,12 @@ ext_dce_process_sets (rtx_insn *insn, bitmap livenow, bitmap live_tmp) if (GET_CODE (x) == STRICT_LOW_PART || paradoxical_subreg_p (x)) x = XEXP (x, 0); + /* Similarly if we have a SUBREG of a wide mode. Do this after + stripping STRICT_LOW_PART or a paradoxical SUBREG to catch + stuff like (strict_low_part (subreg:HI (reg:TI))). */ + if (SUBREG_P (x) && GET_MODE (SUBREG_REG (x)) > E_DImode) + continue; + /* Phase one of destination handling. First remove any wrapper such as SUBREG or ZERO_EXTRACT. */ unsigned HOST_WIDE_INT mask = GET_MODE_MASK (GET_MODE (x));