1 // PR target/9786 2 // Origin: <nick@ilm.com> 3 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. 7 8 // { dg-do compile } 9 // { dg-options "-O2 -fnon-call-exceptions" } 10 11 struct D1 { 12 float l; GSD113 D1 GS() const {D1 d;float f=.299*l;d.l=f;return d;} GD114 static D1 G() {return D1();} 15 }; 16 17 struct D2 { 18 D1 g; D2D219 D2(const D1& gi) : g(gi) {} GSD220 D2 GS() const {return D2(g.GS());} 21 }; 22 23 class A { 24 public: ~A()25 virtual ~A() {} 26 }; 27 28 class B : public A { 29 public: 30 B(const D2& mi); 31 D2 fm; 32 }; 33 B(const D2 & mi)34B::B(const D2 &mi) : fm(mi.GS()) {} 35