conditionals are sometimes over-optimised
Bugzilla Link | 1187 |
Created on | Jan 12, 2017 16:27 |
Version | svn |
OS | All |
Architecture | PC |
Attachments | sacprelude_d.sacbugreport |
Extended Description
noinline int forever( int x) { if( _eq_SxS_( x,0)) res = forever(x); else res = 42; return res; } int main() { return forever( 0); } after optimisation yields 42 :-( What happens is that the type of the function forever is computed as int{42}. The constant folder reacts and throws the conditional away.....