https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99693
--- Comment #4 from rafal at bursig dot org --- but using -O2 -funswitch-loops will bring me those problems why this flag is not in default -O2. Which is not a solution. Maybe -O2 may have weaken version of this optimization and will work only if one of if brock is empty. And -O3 will have full version. Example: form: for(...) { if (local_value) { logic; } } To: if (local_value) for(...) { logic; } I know that such code could be fixed by developer but gcc don't generate any diagnostic message about such constructions and for a large project it's difficult to find all of such places