Why are compilers so stupid?

前端 未结 29 2009
借酒劲吻你
借酒劲吻你 2020-11-29 18:07

I always wonder why compilers can\'t figure out simple things that are obvious to the human eye. They do lots of simple optimizations, but never something even a little bit

29条回答
  •  自闭症患者
    2020-11-29 18:50

    Did you compile to release code? I think a good compiler detects in your second example that the string is never used an removes the entire loop.

提交回复
热议问题