aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/20211118-1.c
blob: 67ef68420df2fdda31ecb4807f82cd0f484b1e13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* { dg-do run } */

unsigned p[3];
void __attribute__((noipa))
bar (float *q, int n, int m)
{
  for (int i = 0; i < m; ++i)
    {
      if (i == n)
        {
          unsigned a = p[1];
          p[1] = a + 1;
          *q = 1.;
        }
      q++;
    }
}

int main()
{
#if __SIZEOF_FLOAT__ == __SIZEOF_INT__
  bar ((float *)p, 1, 3);
  if (((float *)p)[1] != 1.)
    __builtin_abort ();
#endif
  return 0;
}