https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118852
--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> --- Created attachment 60497 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60497&action=edit patch to tree-ssa-sccvn.c Applying the attached patch to SPEC sources shows the vectorized loop not processing elements correctly. We assert #2 0x0000000001004bd9 in set_hashtable_value_ids_2 () at tree-ssa-sccvn.c:3192 3192 gcc_assert (vno->value_id == VN_INFO (vno->result)->value_id); and (gdb) p valid_info->nary->entries $1 = (void **) 0xa009590 (gdb) p slot $2 = (void **) 0xa009600 (gdb) p *valid_info->nary->entries@31 $3 = {0x70905e0, 0x0, 0x0, 0x7090610, 0x7090550, 0x7090400, 0x70903a0, 0x0, 0x0, 0x70904f0, 0x0, 0x0, 0x0, 0x0, 0x70904c0, 0x7090520, 0x7090460, 0x7090490, 0x7090430, 0x0, 0x0, 0x0, 0x7090640, 0x0, 0x0, 0x70903d0, 0x0, 0x7090580, 0x0, 0x0, 0x70905b0} (gdb) p *valid_info->nary $9 = {hash_f = 0x1001470 <vn_nary_op_hash>, eq_f = 0x1001270 <vn_nary_op_eq>, del_f = 0x0, entries = 0xa009590, size = 31, n_elements = 15, n_deleted = 0, searches = 33, collisions = 19, alloc_f = 0x1135ae0 <xcalloc>, free_f = 0x402200 <free@plt>, alloc_arg = 0x0, alloc_with_arg_f = 0x0, free_with_arg_f = 0x0, size_prime_index = 2} the vector loop skips from processing 0x70904f0 to 0x7090520. We do two vector iterations skipping 0x0, 0x0, 0x0, 0x0, and in the third iteration take the exit with. It seems that we use the wrong final value for the epilogue loop.