From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 99C183858C2F; Mon, 26 Jun 2023 11:02:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99C183858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687777334; bh=LFh7BlisG9tqz+maKyOpPbr1REapN+fdmW3FRvJHkeI=; h=From:To:Subject:Date:From; b=I3fzslrwr0ZsMu0dnjVyycVzMD43i+XgTCtB9eEnwlmTguoNM8XfY43956M6oLZMZ wNA3smOgA/vr5iTGj70bBt6oAxcUofM7NdTOdKUdL0WtA9P8X3UkX0yr380HxWyrsc ESaWa6E0/dVmP8LX5Gnswi02Jcib+/M2z0vAVTjk= 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 r14-2089] tree-optimization/110392 - ICE with predicate analysis X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: 78da7a4278a1417f1060fd8f664291026e5856fb X-Git-Newrev: ab6eac20f00761695c69b555f6b0a026bc25770d Message-Id: <20230626110214.99C183858C2F@sourceware.org> Date: Mon, 26 Jun 2023 11:02:14 +0000 (GMT) List-Id: https://gcc.gnu.org/g:ab6eac20f00761695c69b555f6b0a026bc25770d commit r14-2089-gab6eac20f00761695c69b555f6b0a026bc25770d Author: Richard Biener Date: Mon Jun 26 11:21:43 2023 +0200 tree-optimization/110392 - ICE with predicate analysis Feeding not optimized IL can result in predicate normalization to simplify things so a predicate can get true or false. The following re-orders the early exit in that case to come after simplification and normalization to take care of that. PR tree-optimization/110392 * gimple-predicate-analysis.cc (uninit_analysis::is_use_guarded): Do early exits on true/false predicate only after normalization. Diff: --- gcc/gimple-predicate-analysis.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/gimple-predicate-analysis.cc b/gcc/gimple-predicate-analysis.cc index 7f20f81ad86..373163ba9c8 100644 --- a/gcc/gimple-predicate-analysis.cc +++ b/gcc/gimple-predicate-analysis.cc @@ -2216,11 +2216,11 @@ uninit_analysis::is_use_guarded (gimple *use_stmt, basic_block use_bb, return false; use_preds.simplify (use_stmt, /*is_use=*/true); + use_preds.normalize (use_stmt, /*is_use=*/true); if (use_preds.is_false ()) return true; if (use_preds.is_true ()) return false; - use_preds.normalize (use_stmt, /*is_use=*/true); /* Try to prune the dead incoming phi edges. */ if (!overlap (phi, opnds, visited, use_preds)) @@ -2238,11 +2238,11 @@ uninit_analysis::is_use_guarded (gimple *use_stmt, basic_block use_bb, return false; m_phi_def_preds.simplify (phi); + m_phi_def_preds.normalize (phi); if (m_phi_def_preds.is_false ()) return false; if (m_phi_def_preds.is_true ()) return true; - m_phi_def_preds.normalize (phi); } /* Return true if the predicate guarding the valid definition (i.e.,