Debian Codegraph @

gcc/testsuite/gcc.dg/uninit-pr100250.c

raw
1 /* PR middle-end/100250 - ICE related to -Wmaybe-uninitialized
2 { dg-do compile }
3 { dg-options "-O2 -Wall" } */
4
5 extern void f (int D, const int[D], const int[D]);
6
7 void g (int D, const int a[D], const int b[D], const int c[D], const int d[D])
8 {
9 int c2[D];
10
11 for (int i = 0; i < D; i++) {
12
13 if (a[i] >= D) __builtin_abort ();
14 if (b[i] != d[a[i]]) __builtin_abort ();
15
16 c2[a[i]] = c[i];
17 }
18
19 f (D, d, c2);
20 }
21
22 void h (int D, const int d[D])
23 {
24 int a[D];
25 int b[D];
26 int c[D];
27
28 g (D, a, b, c, d); // { dg-warning "-Wmaybe-uninitialized" }
29 }