Note that there are some explanatory texts on larger screens.

plurals
  1. POCan massive nested loops cause the linker to run endlessly when compiling in Release-Mode?
    primarykey
    data
    text
    <p>I'm compiling a very small Win32 command-line application in VS2010 Release-Mode, with all speed optimizations turned on (<em>not</em> memory optimizations).</p> <p>This application is designed to serve a single purpose - to perform a single pre-defined complex mathematical operation to find a complex solution to a specific problem. The algorithm is completely functional (confirmed) and it compiles and runs fine in Debug-Mode. However, when I compile in Release-Mode (the algorithm is large enough to make use of the optimizations), Link.exe appears to run endlessly, and the code never finishes linking. It sits at 100% CPU usage, with no changes in memory usage (43,232 K).</p> <p>My application contains only two classes, both of which are pretty short code files. However, the algorithm comprises 20 or so nested loops with inline function calls from within each layer. Is the linker attempting to run though every possible path through these loops? And if so, why is the Debug-Mode linker not having any problems?</p> <p>This is a tiny command-line application (2KB exe file), and compiling shouldn't take more than a couple minutes. I've waited 30 minutes so far, with no change. I'm thinking about letting it link overnight, but if it really <em>is</em> trying to run through all possible code paths in the algorithm it could end up linking for decades without a SuperComputer handy.</p> <p>What do I need to do to get the linker out of this endless cycle? Is it possible for such code to create an infinite link-loop without getting a compiler-error prior to the link cycle?</p> <p><strong>EDIT:</strong><br> Jerry Coffin pointed out that I should kill the linker and attempt again. I forgot to mention this in the original post, but I have aborted the build, closed and re-opened VS, and attempted to build multiple times. The issue is consistent, but I haven't changed any linker options as of yet.<br> <strong>EDIT2:</strong><br> I also neglected to mention the fact that I deleted the "Debug" and "Release" folders and re-built from scratch. Same results.<br> <strong>EDIT3:</strong><br> I just confirmed that turning off function inlining causes the linker to function normally. The problem is I need function inlining, as this is a very performance-sensitive operataion with a minimal memory footprint. This leads me to ask, why would inlining cause such a problem to occur?<br> <strong>EDIT4:</strong><br> The output that displays during the unending link cycle:</p> <pre><code>Link: Generating code </code></pre> <p><strong>EDIT5:</strong><br> I confirmed that placing all the code into a single CPP file did not resolve the issue.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload