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

后端 未结 7 1029
[愿得一人]
[愿得一人] 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:16

    Your best bet is to take the resulting binary step into it and dis-assemble the main function and see what assembly was generated. Not saying you will be able to see a bug, but you can see if something was optimized out.

    0 讨论(0)
提交回复
热议问题