diff options
author | Richard Biener <rguenther@suse.de> | 2022-08-30 10:04:15 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2022-08-30 10:05:37 +0200 |
commit | bfaa6807defb18874e4c4b6b8608fe0afee7d7b8 (patch) | |
tree | 5568ba6d07533aeac84c4c605c4a294bb72221cb | |
parent | 8a63343a744a8584a9dfcbc3817f66755baafe8a (diff) | |
download | gcc-bfaa6807defb18874e4c4b6b8608fe0afee7d7b8.zip gcc-bfaa6807defb18874e4c4b6b8608fe0afee7d7b8.tar.gz gcc-bfaa6807defb18874e4c4b6b8608fe0afee7d7b8.tar.bz2 |
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.
-rw-r--r-- | gcc/testsuite/gcc.dg/uninit-pr63660.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/uninit-pr63660.c b/gcc/testsuite/gcc.dg/uninit-pr63660.c new file mode 100644 index 0000000..eab7c74 --- /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(); +} |