aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-patterns.cc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2023-09-29 11:23:16 +0200
committerJakub Jelinek <jakub@redhat.com>2023-09-29 11:23:16 +0200
commit59cda1f9525702d5d6560002c874f12c0103f7df (patch)
tree4d917f72ce53bc4d47fcd812053eeff9153fe3c6 /gcc/tree-vect-patterns.cc
parent7525707c5f3edb46958c4fdfbe30de5ddfa8923a (diff)
downloadgcc-59cda1f9525702d5d6560002c874f12c0103f7df.zip
gcc-59cda1f9525702d5d6560002c874f12c0103f7df.tar.gz
gcc-59cda1f9525702d5d6560002c874f12c0103f7df.tar.bz2
use *_grow_cleared rather than *_grow on vect_unpromoted_value
vect_recog_over_widening_pattern is another spot which triggers the right now commented out static assertion in vec.h which asserts {quick,safe}_grow vec operations are only used with trivially default constructible types. I had a look at this and I think using quick_grow_cleared is best choice here. The nops is 2 or 1 most of the time, worst case 3, so the price of extra initialization of 4 pointer-sized-or-less members times 1, 2 or 3 doesn't seem worth bothering, it is similar to the bitmap_head case where we already pay the price for just one structure anytime we do vect_unpromoted_value unprom_diff; (and later set_op on it) or even vect_unpromoted_value unprom0[2]; With this patch and Richard S's poly_int_pod removal the static_assert can be enabled as well and gcc builds. 2023-09-29 Jakub Jelinek <jakub@redhat.com> * tree-vect-patterns.cc (vect_recog_over_widening_pattern): Use quick_grow_cleared method on unprom rather than quick_grow.
Diffstat (limited to 'gcc/tree-vect-patterns.cc')
-rw-r--r--gcc/tree-vect-patterns.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-vect-patterns.cc b/gcc/tree-vect-patterns.cc
index a2ed036..6964c99 100644
--- a/gcc/tree-vect-patterns.cc
+++ b/gcc/tree-vect-patterns.cc
@@ -2944,7 +2944,7 @@ vect_recog_over_widening_pattern (vec_info *vinfo,
/* Check the operands. */
unsigned int nops = gimple_num_ops (last_stmt) - first_op;
auto_vec <vect_unpromoted_value, 3> unprom (nops);
- unprom.quick_grow (nops);
+ unprom.quick_grow_cleared (nops);
unsigned int min_precision = 0;
bool single_use_p = false;
for (unsigned int i = 0; i < nops; ++i)