Merge reload-branch up to revision 101000
[official-gcc.git] / gcc / testsuite / g++.dg / opt / mmx1.C
blobf13b2f844af6ab0d11860c5837182490fd3bd705
1 // PR optimization/4994
2 // This testcase ICEd because movsi was not supporting direct
3 // mmx -> mmx register moves.
4 // { dg-do compile }
5 // { dg-options "-O2" }
6 // { dg-options "-fno-exceptions -O2 -mmmx -fPIC" { target { i?86-*-*  && ilp32 }  } }
7 // { dg-options "-fno-exceptions -O2 -mmmx -fPIC" { target { x86_64-*-* && ilp32 } } }
9 struct A {
10   unsigned a0;
11   bool a1 () { return !--a0; }
12   void a2 ();
15 struct B
17   B ();
18   B (const B &);
19   ~B();
20   B &operator= (const B &);
21   B b0 (unsigned long x, int y = 0, int z = 10) const;
23 private:
24   A *b1;
25   static A *b2;
28 inline B::~B()
30   if (b1->a1 () && b1 == b2)
31     b1->a2();
34 struct C
36   C *c0;
39 struct D
41   C *d0;
42   D ();
43   D (const D &c0) {}
44   D &operator++ () {
45     C *x = d0; C *y = x->c0;
46     while (x == y->c0)
47       x = y;
48     d0 = x;
49     return *this;
50   }
53 B foo (const char *x, const B &y);
55 void bar (void)
57   B *y = 0;
58   B z;
59   for (unsigned long l = 0; l < 2147483647L * 2UL + 1; l++)
60     {
61       z = y->b0 (l);
62       *y = foo ("data", z);
63     }
64   D d;
65   ++d;