aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr87485.c
blob: 17d1c24c4f7080ff3859be711dc29f2758e78bf8 (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
/* PR rtl-optimization/87485 */
/* { dg-do compile { target int128 } } */
/* { dg-options "-O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-types -fno-tree-ccp -fno-tree-sra" } */
/* { dg-additional-options "-fstack-protector-strong" { target fstack_protector } } */
/* { dg-require-effective-target scheduling } */

int *a;

int
foo (__int128 x, int y, int z)
{
  __int128 b;
  *a = ((!!y ? y : x) * y | x) * 2;
  if (z == 0)
    {
      unsigned int c = 1;
      __int128 *d = &b;
      for (*a = 0; *a < 1; *a += y)
	;
      *a += b < (c / 0);	/* { dg-warning "division by zero" } */
      goto l;
 m:
      while (b < 1)
	;
      ++*a;
    }
  goto m;
 l:
  return 0;
}