1 /* PR middle-end/31448, this used to ICE during expand because
2    reduce_to_bit_field_precision was not ready to handle constants. */
3 /* { dg-require-effective-target int32plus } */
4 
5 typedef struct _st {
6     int iIndex : 24;
7     int iIndex1 : 24;
8 } st;
9 st *next;
g(void)10 void g(void)
11 {
12     st *next = 0;
13     int nIndx;
14     const static int constreg[] = { 0,};
15     nIndx = 0;
16     next->iIndex = constreg[nIndx];
17 }
f(void)18 void f(void)
19 {
20     int nIndx;
21     const static int constreg[] = { 0xFEFEFEFE,};
22     nIndx = 0;
23     next->iIndex = constreg[nIndx];
24     next->iIndex1 = constreg[nIndx];
25 }
main(void)26 int main(void)
27 {
28   st a;
29   next = &a;
30   f();
31   if (next->iIndex != 0xFFFEFEFE)
32     __builtin_abort ();
33   if (next->iIndex1 != 0xFFFEFEFE)
34     __builtin_abort ();
35   return 0;
36 }
37 
38