public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Richard Biener <rguenth@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2262] tree-optimization/63660 - testcase for fixed PR Date: Tue, 30 Aug 2022 08:05:56 +0000 (GMT) [thread overview] Message-ID: <20220830080556.31C903986438@sourceware.org> (raw) https://gcc.gnu.org/g:bfaa6807defb18874e4c4b6b8608fe0afee7d7b8 commit r13-2262-gbfaa6807defb18874e4c4b6b8608fe0afee7d7b8 Author: Richard Biener <rguenther@suse.de> Date: Tue Aug 30 10:04:15 2022 +0200 tree-optimization/63660 - testcase for fixed PR This adds a testcase for the PR which was fixed with r13-2155-gbaa3ffb19c54fa PR tree-optimization/63660 * gcc.dg/uninit-pr63660.c: New testcase. Diff: --- gcc/testsuite/gcc.dg/uninit-pr63660.c | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/gcc/testsuite/gcc.dg/uninit-pr63660.c b/gcc/testsuite/gcc.dg/uninit-pr63660.c new file mode 100644 index 00000000000..eab7c7401b9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-pr63660.c @@ -0,0 +1,58 @@ +/* { dg-do compile } */ +/* { dg-options "-O -Wuninitialized" } */ + +typedef struct +{ + int a; + int b; + int c; + int d; + int e; + int f; + int g; + int h; + int i; + int j; +} X; + +X *XX(int); + +int G(); + +static void F() +{ + X *x; + int m, n; + int xa, xb, xc, xd, xe, xf, xg, xh, xi, xj; + + m = G(); + n = G(); + if ( n & 1 ) xa = G(); + if ( n & 2 ) xb = G(); + if ( n & 4 ) xc = G(); + if ( n & 32 ) xd = G(); + if ( n & 16 ) xe = G(); + if ( n & 64 ) xf = G(); + if ( n & 256 ) xg = G(); + if ( n & 512 ) xh = G(); + if ( n & 1024 ) xi = G(); + if ( n & 2048 ) xj = G(); + + if ( m >= 64 ) return; + x = XX(m); + if ( n & 1 ) x->a = xa; + if ( n & 2 ) x->b = xb; + if ( n & 4 ) x->c = xc; + if ( n & 32 ) x->d = xd; + if ( n & 16 ) x->e = xe; + if ( n & 64 ) x->f = xf; + if ( n & 256 ) x->g = xg; + if ( n & 512 ) x->h = xh; + if ( n & 1024 ) x->i = xi; + if ( n & 2048 ) x->j = xj; /* { dg-bogus "uninitialized" } */ +} + +void H() +{ + F(); +}
reply other threads:[~2022-08-30 8:05 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=20220830080556.31C903986438@sourceware.org \ --to=rguenth@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).