]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix various issues with constant condition elimination
authorMikko Rasa <tdb@tdb.fi>
Sat, 25 May 2019 21:00:54 +0000 (00:00 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 25 May 2019 21:20:54 +0000 (00:20 +0300)
It used to optimize based on the initial values of variables, ignoring
the fact that they may change between loop iterations.  A stop-gap fix
was implemented in 8e14c29, but it prevented optimizations of some
conditionals that could safely have been removed.  It also caused the
optimizer to ignore any assignments made to any variables after
declaration when evaluating the loop condition, potentially causing
entire loops to be erroneously removed.  Finally, unary expressions were
not being handled so ++ and -- operators did not mark the variable as
modified.


No differences found