From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 31C903986438; Tue, 30 Aug 2022 08:05:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 31C903986438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661846756; bh=DFa57FK1P2ABCDx4AsUly35MLM2AoZDpPTfyg28QuBo=; h=From:To:Subject:Date:From; b=hIlTuBFHQehP4JG/T+Vo8VaI3tbDWx7CJn8wwbBw9XIbjySR44Q/F1kOfFvMAYyWi ydPbT6sngcPxei9E1whCsV16iDvrvwYpocFGeTgidI6rM3L9FH1GENFttO/9augZY9 WrpMJb7OIEXD5SMD0TboHGhK52zP6w1TjXfihGZ8= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2262] tree-optimization/63660 - testcase for fixed PR X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: 8a63343a744a8584a9dfcbc3817f66755baafe8a X-Git-Newrev: bfaa6807defb18874e4c4b6b8608fe0afee7d7b8 Message-Id: <20220830080556.31C903986438@sourceware.org> Date: Tue, 30 Aug 2022 08:05:56 +0000 (GMT) List-Id: https://gcc.gnu.org/g:bfaa6807defb18874e4c4b6b8608fe0afee7d7b8 commit r13-2262-gbfaa6807defb18874e4c4b6b8608fe0afee7d7b8 Author: Richard Biener 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(); +}