2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / opt / mmx1.C
blobe433d554aea5966276ff6527af5862f9565dcef3
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-*-*  } }
8 struct A {
9   unsigned a0;
10   bool a1 () { return !--a0; }
11   void a2 ();
14 struct B
16   B ();
17   B (const B &);
18   ~B();
19   B &operator= (const B &);
20   B b0 (unsigned long x, int y = 0, int z = 10) const;
22 private:
23   A *b1;
24   static A *b2;
27 inline B::~B()
29   if (b1->a1 () && b1 == b2)
30     b1->a2();
33 struct C
35   C *c0;
38 struct D
40   C *d0;
41   D ();
42   D (const D &c0) {}
43   D &operator++ () {
44     C *x = d0; C *y = x->c0;
45     while (x == y->c0)
46       x = y;
47     d0 = x;
48     return *this;
49   }
52 B foo (const char *x, const B &y);
54 void bar (void)
56   B *y = 0;
57   B z;
58   for (unsigned long l = 0; l < 2147483647L * 2UL + 1; l++)
59     {
60       z = y->b0 (l);
61       *y = foo ("data", z);
62     }
63   D d;
64   ++d;