PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr21171.c
blob0c07e7ea58d31345be99a8db1089437fa62ac497
1 /* PR 21171. Ivopts should not rewrite references to volatile memory. */
2 /* { dg-do compile } */
3 /* { dg-options "-O1 -fdump-tree-optimized" } */
5 typedef unsigned int u_int32_t;
6 typedef unsigned char u_int8_t;
8 #define AIC_VECTORS 32
10 typedef volatile struct AT91RM9200_regs {
11 u_int32_t SVR[AIC_VECTORS];
12 } AT91RM9200_regs_t;
14 #define CPUReg ((AT91RM9200_regs_t*)0xFFF00000)
16 extern const u_int32_t __IntTable[AIC_VECTORS];
18 int main()
20 int c;
22 for (c = 0; c < AIC_VECTORS; c++)
23 CPUReg->SVR[c] = __IntTable[c];
25 return 0;
28 /* { dg-final { scan-tree-dump-times "SVR" 1 "optimized"} } */