From: Victor Do Nascimento Date: Thu, 4 Sep 2025 12:19:44 +0000 (+0100) Subject: vect: Reject uncounted loop vectorization where alias analysis may fail X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed6afed22c994a86e95ece73be2530899003d97d;p=thirdparty%2Fgcc.git vect: Reject uncounted loop vectorization where alias analysis may fail Issues with alias list pruning for uncounted loops was found to cause as-of-yet unresolved issues in the execution of SpecV6. Disable this while a reduced testcase is developed and a solution implemented. Test derived from "omp_get_partition_place_nums" from libgomp "icv.c": unsigned len = 8; void alias_fail (int n[8]) { unsigned int i; for (i = 0; i < len; i++) *n++ = i; } gcc/ChangeLog: * tree-vect-data-refs.cc (vect_prune_runtime_alias_test_list): Reject when !operand_equal_p for any data ref pair. --- diff --git a/gcc/tree-vect-data-refs.cc b/gcc/tree-vect-data-refs.cc index 154bf5ac1b6..753224dd367 100644 --- a/gcc/tree-vect-data-refs.cc +++ b/gcc/tree-vect-data-refs.cc @@ -4324,7 +4324,13 @@ vect_prune_runtime_alias_test_list (loop_vec_info loop_vinfo) { if (!operand_equal_p (DR_STEP (dr_info_a->dr), DR_STEP (dr_info_b->dr), 0)) - length_factor = scalar_loop_iters; + { + length_factor = scalar_loop_iters; + if (TREE_CODE (length_factor) == SCEV_NOT_KNOWN) + return opt_result::failure_at (vect_location, + "Unsupported alias check on" + " uncounted loop\n"); + } else length_factor = size_int (vect_factor); segment_length_a = vect_vfa_segment_size (dr_info_a, length_factor);