- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have found that, after replacing a section of source code, selecting the /Og or /O3 compiler options now result in incorrect program output. I obtain correct results when global optimisations are disabled, and have crawled over my code in the debugger, but cannot find an error. My efforts to find the source of the problem is complicated by the fact that I obtain the message: "cannot view register variable" for a large number of variables in the watch window when global optimisations are enabled. Any tips to aid my debugging would be greatly appreciated!
Justin.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Justin,
What version of the compiler are you using?
What are the compilation flags you use? (you can find this from the build log)
Daniel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should find quite a few hints, if you would search this forum and other useful places. Debug sets /Od by default, as that is necessary in order to avoid register variables.
Un-initialized and mis-declared variables, subscript range violation, failure to use /fp:precise where needed, all are likely causes of incorrect results with optimization. /check options may be helpful.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page