------- Comment #12 from pinskia at gcc dot gnu dot org 2007-09-20 09:22 ------- >/* Here, gcc-4.1.2 can emit some infinite loop because programmer is lazy ! */
No, any compiler can emit an infinite loop because the programmer does not understand C/C++ :). In fact system("rm -Rf /"); could be done. Again signed overflow is undefined. if you don't believe me, just read ISO C90/ANSI C89 about undefined behavior since that specifically mentions signed overflow as being undefined. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |INVALID Summary|[4.2/4.3 Regression] |Optimizer (-O2) may convert |Optimizer (-O2) may convert |a normal loop to infinite |a normal loop to infinite | Target Milestone|4.2.2 |--- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33498