- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What 's the optimize option -O2 do?
When i was using icpc to compile my project on linux with -g -O2. I found a segment fault error. While It works when I delete -O2. So how many detail options in -O2 ? How can I fix my problem?
BTW, I used makecontext when I was generating fiber threads.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>...What 's the optimize option -O2 do?
/O2 - optimize for maximum speed (DEFAULT)
>>...So how many detail options in -O2?..
Please take a look at Intel C++ compiler User's and Reference Guide for a complete description of that option ( online or in pdf-format )
>>How can I fix my problem?
>>
>>BTW, I used makecontext when I was generating fiber threads...
A reproducer is needed to help with understanding what is wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Sergey Kostrov
I is hard to post my project as it is too large!
I've tested to add -fno-builtin option in a test project! With this option, I got the same assemble code using gcc and icc in a test code. I will test it in my project. I will post further result if i get some error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I fixed this problems by add -fno-builtin and -fno-inline 。THS

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