aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/opt/pr59647.C
blob: 1fc5067d83fc57a4cadbc8818505e5f7d2dd6e9f (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
// PR rtl-optimization/59647
// { dg-do compile }
// { dg-options "-O2 -fno-tree-vrp" }
// { dg-additional-options "-msse2 -mfpmath=sse" { target { { i?86-*-* x86_64-*-* } && ia32 } } }

void f1 (int);
void f2 ();
double f3 (int);

struct A
{
  int f4 () const
  {
    if (a == 0)
      return 1;
    return 0;
  }
  unsigned f5 ()
  {
    if (!f4 ())
      f2 ();
    return a;
  }
  int a;
};

void
f6 (A *x)
{
  unsigned b = x->f5 ();
  f1 (b - 1 - f3 (x->f5 () - 1U));
}