aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr108657.c
blob: 37d0b8e863f916f30692b0a10da37b42c1715756 (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 tree-optimization/108657 */
/* { dg-do run } */
/* { dg-options "-O3 -ftrivial-auto-var-init=zero" } */

int c, e, f;
static int *d = &c;

__attribute__((noipa)) void
foo (void)
{
  if (c != 1)
    __builtin_abort ();
}

int
main ()
{
  for (c = 1; c >= 0; c--)
    {
      e = 0;
      for (int j = 0; j <= 2; j++)
	{
	  short k[1];
	  if (e)
	    break;
	  e ^= f;
	}
    }
  *d = 1;
  foo ();
}