Can massive nested loops cause the linker to run endlessly when compiling in Release-Mode?

后端 未结 6 1055
悲&欢浪女
悲&欢浪女 2020-12-30 05:59

I\'m compiling a very small Win32 command-line application in VS2010 Release-Mode, with all speed optimizations turned on (not memory optimizations).

This a

6条回答
  •  囚心锁ツ
    2020-12-30 06:17

    Some selected answers:

    Debug builds don't inline. Not at all. This makes it possible to put breakpoints in all functions. It wou

    It doesn't really matter whether the linker truly runs an infinite loop, or whether it is evaluating 2^20 different combinations of inline/don't inline. The latter still could take 2^20 seconds. (We know the linker is inlining from the "Generating code" message).

    Why are you using LTCG anyway? For such a small project, it's entirely feasible to put everything in one .cpp file. Currently, the compiler is just parsing C++, and not generating any code. That also explains why it doesn't have any problem: there's only a single loop in the compiler, over all lines of source code.

提交回复
热议问题