From 3e8cc2f09de83dc203cd86573e39f2a3e9621d8a Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Fri, 7 Nov 2025 17:18:02 +0100 Subject: [PATCH] vect: Give up if there is no offset_vectype. vect_gather_scatter_fn_p currently ICEs if offset_vectype is NULL. This is an oversight in the patches that relax gather/scatter detection. Catch this. gcc/ChangeLog: * tree-vect-data-refs.cc (vect_gather_scatter_fn_p): Bail if offset_vectype is NULL. --- gcc/tree-vect-data-refs.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/tree-vect-data-refs.cc b/gcc/tree-vect-data-refs.cc index e8cfb884c1d..b35ba05fd08 100644 --- a/gcc/tree-vect-data-refs.cc +++ b/gcc/tree-vect-data-refs.cc @@ -4630,6 +4630,10 @@ vect_gather_scatter_fn_p (vec_info *vinfo, bool read_p, bool masked_p, tree offset_vectype = VECTOR_TYPE_P (offset_type) ? offset_type : get_vectype_for_scalar_type (vinfo, offset_type); + /* If there is no offset vectype, bail. */ + if (!offset_vectype) + return false; + offset_type = TREE_TYPE (offset_vectype); /* Get all supported configurations for this data vector type. */ -- 2.47.3