public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-2262] tree-optimization/63660 - testcase for fixed PR
@ 2022-08-30  8:05 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-08-30  8:05 UTC (permalink / raw)
  To: gcc-cvs

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();
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-30  8:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-30  8:05 [gcc r13-2262] tree-optimization/63660 - testcase for fixed PR Richard Biener

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).