public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-4328] use *_grow_cleared rather than *_grow on vect_unpromoted_value Date: Fri, 29 Sep 2023 09:31:22 +0000 (GMT) [thread overview] Message-ID: <20230929093122.383B43857C4F@sourceware.org> (raw) https://gcc.gnu.org/g:59cda1f9525702d5d6560002c874f12c0103f7df commit r14-4328-g59cda1f9525702d5d6560002c874f12c0103f7df Author: Jakub Jelinek <jakub@redhat.com> Date: Fri Sep 29 11:23:16 2023 +0200 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. Diff: --- gcc/tree-vect-patterns.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/tree-vect-patterns.cc b/gcc/tree-vect-patterns.cc index a2ed0365b18..6964c998698 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)
reply other threads:[~2023-09-29 9:31 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230929093122.383B43857C4F@sourceware.org \ --to=jakub@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).