From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id B6B4F385E00A for ; Tue, 30 Aug 2022 08:05:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B6B4F385E00A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 8F80B1F9E0 for ; Tue, 30 Aug 2022 08:05:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1661846711; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=BxR+sqOWrIpeCCTf5y1/UjzTKn+A7z2YATRlZeZEaIA=; b=18eO0D3vfzysEuuRraS0P2dqZq7SVuu++MDo/dQrIev+MA41dmH2QrCpzQw5irhZty6HYK Ivs0Tk94ljIBqZwnrYB4Oc/CcQSfbfvgx5m4xT2ClkdYY3q/pLAjZ14OVZZktwXLOvFd+D e8dURSsDXRoYdY2Z/sTsFt9Ub2vZOcw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1661846711; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=BxR+sqOWrIpeCCTf5y1/UjzTKn+A7z2YATRlZeZEaIA=; b=RmQTWcXAw5tNfwRFrFBqOmGdhZ2a/jaFB1bnpFnkwThpaU58jDlzRQOYFgOyK5wkffgHGM jDwI+UqOw/1nbUDw== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 8B45E2C141 for ; Tue, 30 Aug 2022 08:05:11 +0000 (UTC) Date: Tue, 30 Aug 2022 08:05:11 +0000 (UTC) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/63660 - testcase for fixed PR User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,MISSING_MID,SCC_5_SHORT_WORD_LINES,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Message-ID: <20220830080511.A23Exn3JdV9ifTGx_bu8sgxAS1l8VyKEwopoOsi2Aco@z> This adds a testcase for the PR which was fixed with r13-2155-gbaa3ffb19c54fa Pushed. PR tree-optimization/63660 * gcc.dg/uninit-pr63660.c: New testcase. --- gcc/testsuite/gcc.dg/uninit-pr63660.c | 58 +++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/uninit-pr63660.c 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(); +} -- 2.35.3