Looks like something is not removing the EH edges. Anyways here is a simple testcase: file 1): void Stop_Profile( void ); struct CProfileSample { ~CProfileSample( void ) { Stop_Profile(); } }; void integrateVelocities(int); void predictUnconstraintMotion(int size) { CProfileSample __profile; for ( int i=0;i<size;i++) integrateVelocities(1); } --- CUT --- File 2: void integrateVelocities(int) { } void Stop_Profile( void ) { } --- CUT ---
Confirmed. There is a crude fixup pass, but this should be handled by IPA nothrow (which doesn't exist).
ipa nothrow is hidden in ipa-pure-const (that should be renamed eventually). However issue here is that at IPA stage we should not touch function bodies, so we should not do these updates. This is why fixup pass exists to resolve these cases after we get into local compilation. This however seems like LTO is getting something wrong, we do make throw flags to disappear at IPA for quite some time.
Seems to work for me, even with the 4.5.0 release.
Subject: Re: ICE with -flto -O3 (BB N can not throw but has an EH edge) > Seems to work for me, even with the 4.5.0 release. Note that on mainline the code removing wpa fixup should help here too. There clearly was bugs. Honza