tree-optimization/127190 - ICE in vectorizable_lane_reducing
Checks
| Context |
Check |
Description |
| linaro-tcwg-bot/tcwg_simplebootstrap_build--master-aarch64-bootstrap |
fail
|
Patch failed to apply
|
Commit Message
The following properly fails analyzing a lane-reducing reduction
when vect_get_num_copies_for_invariant fails instead of asserting
it does not. While analysis later verifies we can create the
constant we use the info here for costing, so we have to fail
early.
Bootstrapped and tested on aarch64-linux-gnu, pushed.
PR tree-optimization/127190
* tree-vect-loop.cc (vectorizable_lane_reducing): Fail
when vect_get_num_copies_for_invariant does.
---
gcc/tree-vect-loop.cc | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
@@ -6855,10 +6855,16 @@ vectorizable_lane_reducing (loop_vec_info loop_vinfo, stmt_vec_info stmt_info,
/* Compute number of effective vector statements for costing from the
number of input lanes allow for excess lanes in the last input vector. */
unsigned int ncopies_for_cost, excess_elts;
- bool res = vect_get_num_copies_for_invariant (loop_vinfo, node_in,
- &ncopies_for_cost,
- &excess_elts);
- gcc_assert (res && ncopies_for_cost >= 1);
+ if (!vect_get_num_copies_for_invariant (loop_vinfo, node_in,
+ &ncopies_for_cost,
+ &excess_elts))
+ {
+ if (dump_enabled_p ())
+ dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
+ "incompatible vector types for invariants\n");
+ return false;
+ }
+ gcc_assert (ncopies_for_cost >= 1);
if (vect_is_emulated_mixed_dot_prod (slp_node))
{