https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88758
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |jakub at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org --- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 45382 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45382&action=edit gcc9-pr88758.patch Untested fix. Unfortunately, the testcase isn't really usable, because it fails to link when this ICE is fixed (plus contains uninitialized use). The problem is that while for non-VECTOR_CST_STEPPED_P VECTOR_CSTs it is just fine when initializer_each_zero_or_onep checks only the encoded elts, if there are fewer than subparts, the last one is repeated. But, with VECTOR_CST_STEPPED_P, the one after last one needs to be computed. unsigned HOST_WIDE_INT nelts = vector_cst_encoded_nelts (expr); if (VECTOR_CST_STEPPED_P (expr) && !TYPE_VECTOR_SUBPARTS (TREE_TYPE (expr)).is_constant (&nelts)) return false; seems to had this in mind, the only problem is that it results in nelts being larger than vector_cst_encoded_nelts for those VECTOR_CST_STEPPED_P csts. With the attached patch, it will do what it did before for the encoded elts, vector_cst_elt just returns what was used before.