public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Dimitar Dimitrov <dimitar@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-696] testsuite: Mark extra warnings for default_packed Date: Sat, 21 May 2022 18:35:25 +0000 (GMT) [thread overview] Message-ID: <20220521183525.DBB2A385737B@sourceware.org> (raw) https://gcc.gnu.org/g:bad2999ab2b910c2e6b4494c772163de2b7e90e5 commit r13-696-gbad2999ab2b910c2e6b4494c772163de2b7e90e5 Author: Dimitar Dimitrov <dimitar@dinux.eu> Date: Sat May 14 21:40:11 2022 +0300 testsuite: Mark extra warnings for default_packed If the target uses packed structs by default, there are no trailing padding bytes allocated. Hence extra warnings are emitted. gcc/testsuite/ChangeLog: * gcc.dg/Warray-bounds-48-novec.c: Add expected warnings if target packs the structs by default. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu> Diff: --- gcc/testsuite/gcc.dg/Warray-bounds-48-novec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-48-novec.c b/gcc/testsuite/gcc.dg/Warray-bounds-48-novec.c index da179a2c0f5..5cae8566209 100644 --- a/gcc/testsuite/gcc.dg/Warray-bounds-48-novec.c +++ b/gcc/testsuite/gcc.dg/Warray-bounds-48-novec.c @@ -238,15 +238,17 @@ static void warn_a1_init (struct A1 *p) static void warn_a1_local_buf (struct A1 *p) { - p->a1[0] = 0; p->a1[1] = 1; p->a1[2] = 2; p->a1[3] = 3; + p->a1[0] = 0; p->a1[1] = 1; p->a1[2] = 2; + p->a1[3] = 3; // { dg-warning "\\\[-Warray-bounds" "" { target default_packed } } p->a1[4] = 4; // { dg-warning "\\\[-Warray-bounds" } } static void warn_a1_extern_buf (struct A1 *p) { - p->a1[0] = 0; p->a1[1] = 1; p->a1[2] = 2; p->a1[3] = 3; p->a1[4] = 4; + p->a1[0] = 0; p->a1[1] = 1; p->a1[2] = 2; p->a1[3] = 3; + p->a1[4] = 4; // { dg-warning "\\\[-Warray-bounds" "" { target default_packed } } p->a1[5] = 5; // { dg-warning "\\\[-Warray-bounds" } }
reply other threads:[~2022-05-21 18:35 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=20220521183525.DBB2A385737B@sourceware.org \ --to=dimitar@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).