Can different optimization levels lead to functionally different code?

前端 未结 13 1851
[愿得一人]
[愿得一人] 2020-12-13 12:39

I am curious about the liberties that a compiler has when optimizing. Let\'s limit this question to GCC and C/C++ (any version, any flavour of standard):

Is it possi

13条回答
  •  醉梦人生
    2020-12-13 13:04

    Anything that is Undefined Behavior according to the standard can change its behavior depending on optimization level (or moon-phase, for that matter).

提交回复
热议问题