2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / opt / reg-stack2.C
blob08cd590b47169793e32c293f2022fcfb378bbe76
1 // PR target/9786
2 // Origin: <nick@ilm.com>
4 // This used to fail on x86 because the reg-stack pass deleted
5 // an insn that could seemingly trap (but actually doesn't)
6 // without updating the CFG.
8 // { dg-do compile }
9 // { dg-options "-O2 -fnon-call-exceptions" }
11 struct D1 {
12     float l;
13     D1 GS() const {D1 d;float f=.299*l;d.l=f;return d;}
14     static D1 G() {return D1();}
17 struct D2 {
18     D1 g;
19     D2(const D1& gi) : g(gi) {}
20     D2 GS() const {return D2(g.GS());}
23 class A {
24   public:
25     virtual ~A() {}
28 class B : public A {
29   public:
30     B(const D2& mi);
31     D2 fm;
34 B::B(const D2 &mi) : fm(mi.GS()) {}