From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id F01793946C36; Tue, 22 Mar 2022 13:05:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F01793946C36 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-7764] tree-optimization/105012 - fix ICE from local DSE of if-conversion X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: ef0e11ac88a1d7833cff5ec9ab26e99991d053c9 X-Git-Newrev: 08f263e703c4100fa7b9f08cb26cee6c0bd75e4a Message-Id: <20220322130534.F01793946C36@sourceware.org> Date: Tue, 22 Mar 2022 13:05:34 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2022 13:05:35 -0000 https://gcc.gnu.org/g:08f263e703c4100fa7b9f08cb26cee6c0bd75e4a commit r12-7764-g08f263e703c4100fa7b9f08cb26cee6c0bd75e4a Author: Richard Biener Date: Tue Mar 22 12:28:30 2022 +0100 tree-optimization/105012 - fix ICE from local DSE of if-conversion The following guards dse_classify_store with the same condition as the DSE pass does - availability of a virtual definition. For the PR we run into the fortran frontend generating a clobber for a FUNCTION_DECL lhs which is ignored by the operand scanner and has no virtual operands assigned. Apart from fixing the frontend the following fixes the ICE by adjusting if-conversion. 2022-03-22 Richard Biener PR tree-optimization/105012 * tree-if-conv.cc (ifcvt_local_dce): Only call dse_classify_store when we have a VDEF. Diff: --- gcc/tree-if-conv.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/tree-if-conv.cc b/gcc/tree-if-conv.cc index 375628e6e9e..7495ed653c0 100644 --- a/gcc/tree-if-conv.cc +++ b/gcc/tree-if-conv.cc @@ -3145,7 +3145,7 @@ ifcvt_local_dce (class loop *loop) gimple_stmt_iterator gsiprev = gsi; gsi_prev (&gsiprev); stmt = gsi_stmt (gsi); - if (gimple_store_p (stmt)) + if (gimple_store_p (stmt) && gimple_vdef (stmt)) { tree lhs = gimple_get_lhs (stmt); ao_ref write;