- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My program compiled with ifort 12.1.0 on el6.2, and parameter O3. I traced it with gdb, it seemed run wrong order(It run 10 line, then 8 line, and then 10 line. According code, it will first run 8 line, and then 10 line.). And there are more like this. How can I resolve these porblems step by step?
Any help will be appreciate.
-GHui
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The option -O3 turns on high level optimizations. As a part of the optimization process, the compiler may change the order of execution within your program if it will speed up the program without changing the results.
Optimization is turned off by default if you use the debugging option -g. It can also be turned off by the option -O0. Unless you are debugging an optimization related issue, I would recommend debugging with optimization turned off. Without optimization, the lines will execute in the expected order.
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