Are compilers allowed to remove infinite loops like Intel C++ Compiler with -O2 does?

后端 未结 7 1084
[愿得一人]
[愿得一人] 2021-01-04 12:31

The following testing code does correctly in VS either with debug or release, and also in GCC. It also does correctly for ICC with debug, but not when optimization enabled (

7条回答
  •  时光取名叫无心
    2021-01-04 13:03

    I think it may have been your version of gcc. I compiled your prog under 4.4.2 and it worked exactly as it should have.

提交回复
热议问题