From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id A90133835438; Fri, 22 Jul 2022 09:27:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A90133835438 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 r13-1795] tree-optimization/106403 - fix ICE with VN of .STORE_LANES X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: b2e99bb6900f33f46a0f4ca6ae94b8a39b0b9bb1 X-Git-Newrev: d85e5aeb7665ea941ff0ef7c11bfe1d39986b48a Message-Id: <20220722092702.A90133835438@sourceware.org> Date: Fri, 22 Jul 2022 09:27:02 +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: Fri, 22 Jul 2022 09:27:02 -0000 https://gcc.gnu.org/g:d85e5aeb7665ea941ff0ef7c11bfe1d39986b48a commit r13-1795-gd85e5aeb7665ea941ff0ef7c11bfe1d39986b48a Author: Richard Biener Date: Fri Jul 22 10:13:06 2022 +0200 tree-optimization/106403 - fix ICE with VN of .STORE_LANES While .STORE_LANES is not supported by the recent VN patch we were still accessing the stored value and valueizing it - but internal_fn_stored_value_index does not support .STORE_LANES and we failed to honor that case. Fixed by simply moving the affected code below the check for the actual supported internal functions. PR tree-optimization/106403 * tree-ssa-sccvn.cc (vn_reference_lookup_3): Move stored value valueization after check for IFN_MASKED_STORE or IFN_LEN_STORE. Diff: --- gcc/tree-ssa-sccvn.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc index 7d947b55a27..a1f6f309609 100644 --- a/gcc/tree-ssa-sccvn.cc +++ b/gcc/tree-ssa-sccvn.cc @@ -3221,11 +3221,6 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *data_, { gcall *call = as_a (def_stmt); internal_fn fn = gimple_call_internal_fn (call); - tree def_rhs = gimple_call_arg (call, - internal_fn_stored_value_index (fn)); - def_rhs = vn_valueize (def_rhs); - if (TREE_CODE (def_rhs) != VECTOR_CST) - return (void *)-1; tree mask = NULL_TREE, len = NULL_TREE, bias = NULL_TREE; switch (fn) @@ -3245,6 +3240,12 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *data_, default: return (void *)-1; } + tree def_rhs = gimple_call_arg (call, + internal_fn_stored_value_index (fn)); + def_rhs = vn_valueize (def_rhs); + if (TREE_CODE (def_rhs) != VECTOR_CST) + return (void *)-1; + ao_ref_init_from_ptr_and_size (&lhs_ref, vn_valueize (gimple_call_arg (call, 0)), TYPE_SIZE_UNIT (TREE_TYPE (def_rhs)));