https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89224
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot gnu.org --- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Ok, I have a simple fix: ``` diff --git a/gcc/c-family/c-common.cc b/gcc/c-family/c-common.cc index e15eff698df..9d0e1ae574d 100644 --- a/gcc/c-family/c-common.cc +++ b/gcc/c-family/c-common.cc @@ -8949,9 +8949,10 @@ convert_vector_to_array_for_subscript (location_t loc, to not run into the gimplifiers premature setting of DECL_GIMPLE_REG_P for function parameters. */ c_common_mark_addressable_vec (*vecp); + tree newinnertype = build_qualified_type (TREE_TYPE (type), TYPE_QUALS (type)); *vecp = build1 (VIEW_CONVERT_EXPR, - build_array_type_nelts (TREE_TYPE (type), + build_array_type_nelts (newinnertype, TYPE_VECTOR_SUBPARTS (type)), *vecp); } ```