c++visual-studio-2010compiler-errorsc1001

If have I encounter an internal compiler error only in release configuration what can I look at to fix this?


I am using Visual Studio 2010. The C1001 error (internal compiler error) only occurs in the release configuration. Debug compiles fine. In this case, what should I be looking at to prevent this from happening in terms of configuration differences?

I know what an internal compiler error is, the question is what is the approach that should be taken if it is only a problem with release. Modifying the code around the line mentioned (in the error message) is not helping so far, the lines just keep changing and I'm wondering also whether that can ever be a red herring? I have tried changing the optimizations already having read some of the answers here to similar questions too.


Solution

  • This was resolved although the 'solution' may appear unfulfilling. The file and line that the internal compiler error mentioned was not my code but from a lib I was using that was compiled in a separate solution and project. I did not realize that immediately. Soon after I commented that my change was having no effect above I tried to compile the lib code without optimizations and then attempted to recompile my code. That did not work either. In the end I just moved two lines of code from line x to line x + 20 (within the same block so it didn't matter where it was) and then built the lib again and then rebuilt my work and it worked. There is no doubt that there was some config difference between release and debug and may be if I had kept pressing I could have figured out what optimization or config was at fault but I am rushed now and just needed to have this running.

    So in the end, to resolve, had something like this.

    {
    blah1
    blah2
    blah3
    blah4 //the line the compiler error mentioned
    blah5
    blah6
    blah7
    blah8 
    }
    

    changed to:

    {
    blah1
    blah2
    blah3
    blah6
    blah7
    blah8
    blah4
    blah5 
    }
    

    I guess any random change like this would have worked, this way just happened to work on the first attempt.

    There are similar resolutions already on StackOverFlow, what threw me off for a while was the debug/release difference and the fact that the code I had to change was from a different solution and project and I had to rebuild two separate solutions.