https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67998
Marc Glisse <glisse at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-10-17
Ever confirmed|0 |1
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
Indeed. We might want to be careful about the case:
unsigned b = long_computation_without_side_effects();
if(!a || b>=a) ...
where it might be better to sink the computation if a is often 0:
if(!a) ...
else {
unsigned b = long_computation_without_side_effects();
if(b>=a) ...
}
(or maybe we can just ignore it)