Re: Difference between -Os and -O2

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

 



Chao Hieu,

I don't know if this is possible for your target environment, but if
possible, try running valgrind or similar memory-debugging tool.  If
not, examine your code carefully for possible access of uninitialized
memory, etc.  I have found that very often (but not always), what at
first seems to us to be compiler generating incorrect code is, in fact,
our own bad code.  Code that produces behavior that differs between
optimization options is often the result of access of uninitialized
memory.  Otherwise, as others have suggested, look at the assembly, but
this is likely only helpful if your program is small or you can narrow
the problem down to a particular small portion of the code.

Good luck,
-- David Favro


[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