- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: O1 and O2
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-03-2011 01:30 AM
тАО03-03-2011 01:30 AM
HP-UX v2 and v3
aCC: HP C/aC++ B3910B A.06.25.01 [May 16 2010]
For instance, we need to create two libraries: liba.so and libb.so
Library liba.so is built on basis of files a1.cpp, a2.cpp, ..., a1.h, a2.h, ...
Library libb.so is built on basis of files b1.cpp, b2.cpp, ..., b1.h, b2.h, ...
Files b1.h, b2.h, ... include some of files a1.h, a2.h, ...
Question.
Is it correct to compile liba.so with optimize mode O1, but libb.so with optimize mode O2?
Can that cause undefined behaviour (incuding crashing program that uses liba.so and libb.so)?
Thanks
Alex
Solved! Go to Solution.
- Tags:
- optimizer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-03-2011 04:56 AM
тАО03-03-2011 04:56 AM
SolutionThe "Level 1 optimzation" is the default, so it seems unlikely that O2 or any other opt level would have any potential to create undefined behavior when used with O1 libs, and if it did it would probably be considered a compiler bug. So my advice would be not to fret about it.
http://docs.hp.com/en/1559/optimize.htm
Level 1 Optimization
Level 1 optimization includes branch optimization, dead code elimination, faster register allocation, instruction scheduling, and peephole (statement-by-statement) optimization. Use +O1 to get level 1 optimization. Level 1 is the default.
Level 1 optimization produces faster programs than without optimization and compiles faster than level 2 optimization. Programs compiled at level 1 can be used with the HP Distributed Debugging Environment (DDE) debugger. Use the debugger option -g0 or -g1.
Level 2 Optimization
Level 2 optimization includes level 1 optimizations, plus optimizations performed over entire functions in a single file. Level 2 optimizes loops in order to reduce pipeline stalls and analyzes data-flow, memory usage, loops, and expressions. Use -O or +O2 to get level 2 optimization.
Specifically, level 2 provides:
* Coloring register allocation.
* Induction variable elimination and strength reduction.
* Local and global common subexpression elimination.
* Advanced constant folding and propagation. (Simple constant folding is done by default.)
* Loop invariant code motion.
* Store/copy optimization.
* Unused definition elimination.
* Software pipelining.
* Register reassociation.
Level 2 can produce faster run-time code than level 1 if programs use loops extensively. Loop-oriented floating-point intensive applications may see run times reduced by 50%. Operating system and interactive applications that use the already optimized system libraries can achieve 30% to 50% additional improvement. Level 2 optimization produces faster programs than level 1 and compiles faster than level 3 optimization.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-03-2011 09:42 AM
тАО03-03-2011 09:42 AM
Re: O1 and O2
Yes, you can mix and match opt levels.
Do you have any problems or just asking?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2011 08:57 PM
тАО03-05-2011 08:57 PM
Re: O1 and O2
> Yes, you can mix and match opt levels.
> Do you have any problems or just asking?
We have crashing some program. While investigating we check any thing that can cause the problem.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-06-2011 12:56 AM
тАО03-06-2011 12:56 AM
Re: O1 and O2
Do you have a stack trace where it crashes?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-06-2011 05:15 AM
тАО03-06-2011 05:15 AM
Re: O1 and O2
Callstack is attached.
Dennis, thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2011 02:59 AM
тАО03-07-2011 02:59 AM
Re: O1 and O2
Are you in a thread?
You seem to be dying while creating a map<:rostringref> in MT_NBIRefMapping.cpp:50.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2011 06:09 AM
тАО03-08-2011 06:09 AM
Re: O1 and O2
> You seem to be dying while creating a map<:rostringref> in MT_NBIRefMapping.cpp:50.
The developers try to investigate, localize and reproduce the situation.
When the situation reproduces, the relevent stuff will be send to the forum.
P.S The program is not mine. I was asked to ask of that in HP-forum.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2011 09:15 PM
тАО03-15-2011 09:15 PM