tree-optimization/103489 - fix ICE when bool pattern recog fails
authorRichard Biener <rguenther@suse.de>
Tue, 30 Nov 2021 13:08:19 +0000 (14:08 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 30 Nov 2021 14:01:25 +0000 (15:01 +0100)
commit0194d92c35ca8b3aa850b805d9becb4491cf6bec
treea4009cca2cc467eb5bbe664febb8e261b4d8c0d3
parent7e846b0f13b8a111484eb3a330044726b9d7ad79
tree-optimization/103489 - fix ICE when bool pattern recog fails

bool pattern recog currently does not handle cycles correctly
and when it fails we can ICE later vectorizing PHIs with
mismatched bool and non-bool vector types.  The following avoids
blindly trusting bool pattern recog here and verifies things
more thoroughly in vectorizable_phi.  A bool pattern recog fix
is for GCC 13.

2021-11-30  Richard Biener  <rguenther@suse.de>

PR tree-optimization/103489
* tree-vect-loop.c (vectorizable_phi): Verify argument
vector type compatibility to mitigate bool pattern recog
bug.

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