Optimise for fastest speed causes crash (VS6)

Started by
0 comments, last by DadleFish 18 years, 6 months ago
One of the library projects I build to use for my game has a strange problem which has only just appeared. If I build it with optimisation set to "fastest speed" I get an exception thrown and the program crashes when calling D3DXLoadMeshFromXFile (or similar). For other optimisation settings it works fine, and all the other projects in the workspace are building with this optimisation without issue. It only started doing it recently which makes me think it's some new data highlighting the problem. But is this something I can track down, or must I just be happy to use "Smallest Size" or "Default"? What does the Default setting mean anyway - it's not 'off' since there is another setting for that... Thanks.
Advertisement
VS has a set of optimization features. Some of them will make your code smaller, some of them will make your code faster. Some of them collide - for example, inlining will (in some cases) make your code run faster, while enlarging it.

"Default" means that the optimizations are balanced somewhere between fastest code and smallest code - according to the knowledge and preference of the VS team.

Regarding your main problem - usually when optimization causes problems, the reason is that you do have a bug, but it's only exposed under optimizations circumstances. The most infamous of these bugs is an uninitialized boolean, for example, that will be "false" if initialized (0) and "true" otherwise (garbage).

I'd do my best to track it down because odds are that you do have a bug. I recommend this roadmap -

1. Set the warning level to 4 and inspect and remove all warnings (except really uninteresting ones such as symbol name truncation for example).
2. Have log messages around the crash spot and check whichever way you can all the paramters of the function and everything leading to them.
3. As a final resort, turn on assembly listing and dive in.

Of course you might have stumbled into a bug in D3DX. Check out their KB to see if anyone has the same problem.

Good luck :-)
Dubito, Cogito ergo sum.

This topic is closed to new replies.

Advertisement