1 /* PR middle-end/95136 - missing -Wuninitialized on an array access with
4 { dg-options "-O -Wall" } */
6 #define NOIPA __attribute__ ((noipa))
8 NOIPA
int a1_addr_varidx_plus_cst (int i
)
10 int a
[4]; // { dg-message "'a' declared here" }
12 return *p
; // { dg-warning "'a|a\\\[<unknown>]' is used uninitialized" }
15 NOIPA
int a1_plus_addr_varidx_cst (int i
)
17 int a
[4]; // { dg-message "'a' declared here" }
19 return *p
; // { dg-warning "'a' is used uninitialized" }
22 NOIPA
int a1_plus_addr_cstidx_var (int i
)
24 int a
[4]; // { dg-message "'a' declared here" }
26 return *p
; // { dg-warning "'a' is used uninitialized" }
29 NOIPA
int a1_plus_addr_varidx_var (int i
, int j
)
31 int a
[4]; // { dg-message "'a' declared here" }
33 return *p
; // { dg-warning "'a' is used uninitialized" }
37 NOIPA
int a2_addr_varidx_plus_cst (int i
, int j
)
39 int a
[4][4]; // { dg-message "'a' declared here" }
40 int *p
= &a
[i
+ 1][j
+ 1];
41 return *p
; // { dg-warning "'a|a\\\[<unknown>]\\\[<unknown>]' is used uninitialized" }
44 NOIPA
int a2_plus_addr_varidx_cst (int i
, int j
)
46 int a
[4][4]; // { dg-message "'a' declared here" }
47 int *p
= &a
[i
][j
] + 1;
48 return *p
; // { dg-warning "'a' is used uninitialized" }
51 NOIPA
int a2_plus_addr_cstidx_var (int i
)
53 int a
[4][4]; // { dg-message "'a' declared here" }
54 int *p
= &a
[1][1] + i
;
55 return *p
; // { dg-warning "'a' is used uninitialized" }
58 NOIPA
int a2_plus_addr_varidx_var (int i
, int j
, int k
)
60 int a
[4][4]; // { dg-message "'a' declared here" }
61 int *p
= &a
[i
][j
] + k
;
62 return *p
; // { dg-warning "'a' is used uninitialized" }