On Wed, Jul 30, 2025 at 09:29:49AM GMT, Jakub Jelinek wrote: > On Fri, Jul 25, 2025 at 10:53:37AM +0800, Yang Yujie wrote: > > + > > addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (var)); > > if (as != TYPE_ADDR_SPACE (ltype)) > > ltype = build_qualified_type (ltype, TYPE_QUALS (ltype) > > @@ -651,12 +655,12 @@ bitint_large_huge::limb_access (tree type, tree var, > > tree idx, bool write_p) > > { > > unsigned HOST_WIDE_INT nelts > > = CEIL (tree_to_uhwi (TYPE_SIZE (TREE_TYPE (var))), limb_prec); > > - tree atype = build_array_type_nelts (ltype, nelts); > > + tree atype = build_array_type_nelts (m_limb_type, nelts); > > This looks wrong. It needs to be from the right address space, see above > if (as != TYPE_ADDR_SPACE (ltype)) > ltype = build_qualified_type ... > > > var = build1 (VIEW_CONVERT_EXPR, atype, var); > > } > > ret = build4 (ARRAY_REF, ltype, var, idx, NULL_TREE, NULL_TREE); > > } > > - if (!write_p && !useless_type_conversion_p (atype, m_limb_type)) > > + if (!write_p && !useless_type_conversion_p (atype, ltype)) > > Again, this looks wrong for non-standard address spaces. > > Jakub
Thanks for the quick review. So is it OK if I replace these references to LTYPE with the LTYPE before being processed by build_qualified_type? Yujie