c++ - Can massive nested loops cause the linker to run endlessly when compiling in Release-Mode? -
i'm compiling small win32 command-line application in vs2010 release-mode, speed optimizations turned on (not memory optimizations).
this application designed serve single purpose - perform single pre-defined complex mathematical operation find complex solution specific problem. algorithm functional (confirmed) , compiles , runs fine in debug-mode. however, when compile in release-mode (the algorithm large enough make use of optimizations), link.exe appears run endlessly, , code never finishes linking. sits @ 100% cpu usage, no changes in memory usage (43,232 k).
my application contains 2 classes, both of pretty short code files. however, algorithm comprises 20 or nested loops inline function calls within each layer. linker attempting run though every possible path through these loops? , if so, why debug-mode linker not having problems?
this tiny command-line application (2kb exe file), , compiling shouldn't take more couple minutes. i've waited 30 minutes far, no change. i'm thinking letting link overnight, if is trying run through possible code paths in algorithm end linking decades without supercomputer handy.
what need linker out of endless cycle? possible such code create infinite link-loop without getting compiler-error prior link cycle?
edit:
jerry coffin pointed out should kill linker , attempt again. forgot mention in original post, have aborted build, closed , re-opened vs, , attempted build multiple times. issue consistent, haven't changed linker options of yet.
edit2:
neglected mention fact deleted "debug" , "release" folders , re-built scratch. same results.
edit3:
confirmed turning off function inlining causes linker function normally. problem need function inlining, performance-sensitive operataion minimal memory footprint. leads me ask, why inlining cause such problem occur?
edit4:
output displays during unending link cycle:
link: generating code
edit5:
confirmed placing code single cpp file did not resolve issue.
nested loops affect linker in terms of link time code generation. there's tons of options determine how works in detail.
for start suggest disabling ltcg alltogether see if there's other unusual problem.
if links fine in release ltcg disabled can experiment inlining limits, intrinsics , optimization level.
Comments
Post a Comment