tree-optimization/108970 - ICE with vectorizer peeling
authorRichard Biener <rguenther@suse.de>
Wed, 1 Mar 2023 08:10:19 +0000 (09:10 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 1 Mar 2023 09:09:45 +0000 (10:09 +0100)
commit85203d52bfa4a84da5f50e0a242891308ffa8d83
tree6fb3095b02d869e025af99322173f3b06d7d9ac8
parent9b4f7004a77b10bc403875f56c94f73ef86562d8
tree-optimization/108970 - ICE with vectorizer peeling

The function slpeel_can_duplicate_loop_p fails to verify we can
copy blocks, instead slpeel_tree_duplicate_loop_to_edge_cfg does
but that's too late.  The following fixes this, also simplifying
error reporting which is somewhat pointless if we ICE immediately.

PR tree-optimization/108970
* tree-vect-loop-manip.cc (slpeel_can_duplicate_loop_p):
Check we can copy the BBs.
(slpeel_tree_duplicate_loop_to_edge_cfg): Avoid redundant
check.
(vect_do_peeling): Streamline error handling.

* gcc.dg/pr108970.c: New testcase.
gcc/testsuite/gcc.dg/pr108970.c [new file with mode: 0644]
gcc/tree-vect-loop-manip.cc