WLIR bug
Bugzilla Link | 1186 |
Created on | Jan 12, 2017 16:22 |
Version | svn |
OS | All |
Architecture | PC |
Extended Description
anything loop invariant is being lifted out of partitions, even if the partition potentially is empty! This does not only potentially generate more work but it can also affect termination: noinline int forever( int x) { if( _eq_SxS_( x,0)) res = forever(x); else res = x; return res; } noinline int[.] foo( int n) { res = with { ([1] <= iv <[n]) : forever(0); } : genarray([n], 0); return res; } int main() { res = foo( 1); return _sel_VxA_( [0], res); } Here the call to forever is lifted out of the WL inhibiting the optimised program to terminate :-(