Re: Difference between -Os and -O2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hieu Le Trung wrote:
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.

The overwhelming likelihood is that your program is buggy - overwriting array bounds or accessing free'd memory. A small change in the memory or stack layout of your prgoram (from -Os and -O2) can make your bug visible or hide it. Run it through a memory debugger like Valgrind, dmalloc, Electric Fence, etc.

Cheers,
Nicholas Sherlock

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux