aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/20020201-2.c
blob: 2a13c8d83caa32ab6483406974ad32be3a9a3413 (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
/* This testcase caused ICE because gcc was not able to add instructions
   on edge from ENTRY block successor to itself.  */
/* { dg-do compile } */
/* { dg-options "-O3 -fssa" } */

struct A { int a1; int a2; };
struct B { long int b[32]; };

extern int bar (struct B *, struct A *);

int
foo (struct B x)
{
  struct A a, b;
  struct B c;
  int d;

  while (1)
    {
      a.a1 = 0;
      a.a2 = 0;
      b = a;
      c = x;
      d = bar (&c, &b);
      if (d >= 0)
        return d;
    }

  return 0;
}