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
5typedef struct _st {
6    int iIndex : 24;
7    int iIndex1 : 24;
8} st;
9st *next;
10void 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}
18void 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}
26int 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