tree-optimization/95487 - use a truth type for scatter masks
This makes sure to get a truth type for scatter masks even when they are invariant. 2020-06-03 Richard Biener <rguenther@suse.de> PR tree-optimization/95487 * tree-vect-stmts.c (vectorizable_store): Use a truth type for the scatter mask. * g++.dg/vect/pr95487.cc: New testcase.
This commit is contained in:
parent
6d36cc21b6
commit
887c45fb5b
20
gcc/testsuite/g++.dg/vect/pr95487.cc
Normal file
20
gcc/testsuite/g++.dg/vect/pr95487.cc
Normal file
@ -0,0 +1,20 @@
|
||||
// { dg-do compile }
|
||||
// { dg-additional-options "-O3" }
|
||||
// { dg-additional-options "-march=skylake-avx512" { target x86_64-*-* i?86-*-* } }
|
||||
|
||||
int a;
|
||||
bool d;
|
||||
char e;
|
||||
extern short f[];
|
||||
extern int g[];
|
||||
short j;
|
||||
void h() {
|
||||
for (short b = j; b < 0; b += 2) {
|
||||
f[b] = 0;
|
||||
if (d) {
|
||||
for (char c = 0; c < a; c += 3)
|
||||
e = 0;
|
||||
g[b] = 0;
|
||||
}
|
||||
}
|
||||
}
|
@ -7676,8 +7676,12 @@ vectorizable_store (vec_info *vinfo,
|
||||
gs_info.offset,
|
||||
stmt_info);
|
||||
if (mask)
|
||||
mask_op = vec_mask = vect_get_vec_def_for_operand (vinfo, mask,
|
||||
stmt_info);
|
||||
{
|
||||
tree mask_vectype = truth_type_for (vectype);
|
||||
mask_op = vec_mask
|
||||
= vect_get_vec_def_for_operand (vinfo, mask,
|
||||
stmt_info, mask_vectype);
|
||||
}
|
||||
}
|
||||
else if (modifier != NONE && (j & 1))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user