This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Difference between -Os and -O2
- From: "Hieu Le Trung" <hieult at Cybersoft-VN dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Mon, 27 Apr 2009 12:41:18 +0700
- Subject: Difference between -Os and -O2
Hi,
I'm currently facing an issue with -Os and -O2 optimization level. My
program can be compiled with both case, but it's not stable for -Os
flag. It makes my application crash sometimes.
I wonder what is the different between -Os and -O2 and where can I find
more information relating to this.
I have looked at http://gcc.gnu.org/onlinedocs/gcc/Optimize Options.html
and understand it well but I need deeper information such as how -Os
works and is there any issue recently.
Some information about my program
- It is a shared library
- It is written in C
- The platform is MIPS32
- Toolchain is MIPS and get from buildroot
- GCC version is 3.4.6
Please help me out.
Regards,
-Hieu