aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/pr92090-2.c
blob: 1710dfdd52ab294f63435e9f010f8642abbc0c66 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* { dg-do compile } */
/* { dg-options "-mdejagnu-cpu=power8 -Os -w" } */
/* { dg-additional-options "-mbig" { target powerpc64le-*-* } } */

/* Verify that we don't ICE.  */

int a;
static _Atomic long double b, c, d, m;
double n;
extern int foo (void);
extern void bar (int, int, int, int);

void
bug (void)
{
  b = 1.79769313486231580793728971405301199e308L;
  for (int i = 0; i < 10000; i++)
    if (__builtin_isinf (n))
      b;
  c = 1;
  int e, f, g, h;
  while (a)
    ;
  for (int i; i; i++)
    {
      double j = c /= foo ();
      if (__builtin_isinf (j))
	{
	  if (foo == 1 << 31)
	    e++;
	  f++;
	  c = 0;
	}
      else
	{
	  if (foo == 1 << 30)
	    g++;
	  h++;
	  c = 1;
	}
    }
  bar (e, f, g, h);
  d = 1.79769313486231580793728971405301199e308L;
  m = 1;
}