GCC: program doesn't work with compilation option -O3

后端 未结 16 1567
感动是毒
感动是毒 2020-12-16 20:12

I\'m writing a C++ program that doesn\'t work (I get a segmentation fault) when I compile it with optimizations (options -O1, -O2, -O3, etc.), but it works just fine when I

16条回答
  •  抹茶落季
    2020-12-16 20:46

    I expect to get some downvotes here after reading some of the comments, but in the console game programming world, it's rather common knowledge that the higher optimization levels can sometimes generate incorrect code in weird edge cases. It might very well be that edge cases can be fixed with subtle changes to the code, though.

提交回复
热议问题