]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/97255 - missing vector bool pattern of SRAed bool
authorRichard Biener <rguenther@suse.de>
Thu, 1 Oct 2020 07:29:32 +0000 (09:29 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 1 Oct 2020 08:22:18 +0000 (10:22 +0200)
commit36e691d3a62145fda1f4a1b3143d215cc113c10a
tree1cc5121575fddb868b318e72ab631bf480d67154
parent324bec558e95584e8c1997575ae9d75978af59f1
tree-optimization/97255 - missing vector bool pattern of SRAed bool

SRA tends to use VIEW_CONVERT_EXPR when replacing bool fields with
unsigned char fields.  Those are not handled in vector bool pattern
detection causing vector true values to leak.  The following fixes
this by turning those into b ? 1 : 0 as well.

2020-10-01  Richard Biener  <rguenther@suse.de>

* tree-vect-patterns.c (vect_recog_bool_pattern): Also handle
VIEW_CONVERT_EXPR.

* g++.dg/vect/pr97255.cc: New testcase.
gcc/testsuite/g++.dg/vect/pr97255.cc [new file with mode: 0644]
gcc/tree-vect-patterns.c