- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello all,
If a piece of code crashes with /O3 on and works fine without the optimization, what could be the possible reasons? Where can I find information about the optimization option?
BTW,the file was set to /Qopenmp initially even though there is no OpenMP directives in it. If I disable /Qopenmp,the code doesn't crash.
Any suggestions on how to debug this? Thanks a lot.
X.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just worked on a customer issue with a similar symptom. The cause was the use of several uninitialized variables of derived type. Without OpenMP they were allocated statically, but with /Qopenmp they were allocated on the stack and had unpredictable values.
Try this - rather than /Qopenmp use /automatic instead and see if you also get the "crash". If so, try to isolate the one (hopefully) source for which this switch makes a difference and look for uninitialized variables.
You can also turn on uninitialized variable detection or use the Static Verifier feature, but these may not find the culprit.
Try this - rather than /Qopenmp use /automatic instead and see if you also get the "crash". If so, try to isolate the one (hopefully) source for which this switch makes a difference and look for uninitialized variables.
You can also turn on uninitialized variable detection or use the Static Verifier feature, but these may not find the culprit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yup. With /Qauto the code crashed at the same spot as with /Qopenmp. Good call!Thanks.
Now I have to find the uninitialzed variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found it. Thank you very much.
X.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page