[Bug c/94392] [10 Regression] Infinite loops are optimized away for C99

joseph at codesourcery dot com gcc-bugzilla@gcc.gnu.org
Mon Mar 30 23:36:34 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94392

--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
I'm not sure the existing infinite loop removal is valid for any C 
standard version.  The C (C11 and later) rule against infinite loops only 
applies when the loop is written as an iteration statement whose 
controlling expression is not constant (not if it's written with goto, or 
has a constant controlling expression); it's not the more general rule 
about forward progress that C++ has.


More information about the Gcc-bugs mailing list