aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ubsan/pr78248.c
blob: 3483c7747355014e38641bb8dbb798d755ca2923 (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
28
29
30
31
/* PR rtl-optimization/78232 */
/* PR rtl-optimization/78248 */
/* { dg-do run } */
/* { dg-options "-fsanitize=undefined" } */

static struct S
{
  int f0:15;
} a;

int b[1], c = 2, d, e, f, g;

int main ()
{
  struct S h = { -2 };
  for (; e < 640; e++)
    for (; f < 1; f++)
      {
        if (c < 2)
          {
            d = b[e];
            h = a;
          }
        g = c;
        c = 1;
        if (!h.f0)
          break;
        c = g;
      }
  return 0; 
}