https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118487
--- Comment #3 from Christoph Müllner <cmuellner at gcc dot gnu.org> --- My initial comment about the need to sanitize the mask elements of VEC_PERM_EXPR was correct, but there is nothing to be done for that, because this is handled by ccp1. The ICE reported here comes from the issue of not checking the TREE_CODE of the mask tree. I've sent a fix for that to the list: https://gcc.gnu.org/pipermail/gcc-patches/2025-January/673703.html While analysing this, I noticed that we make redundant calls to to_constant(), which is addressed here: https://gcc.gnu.org/pipermail/gcc-patches/2025-January/673702.html