[U-Boot-Users] Compiler optimizations and debugging
Wolfgang Denk
wd at denx.de
Thu Mar 20 11:55:19 CET 2003
In message <5.1.1.6.0.20030320104504.00a81840 at dns.struinfo.it> you wrote:
> To make the step-by-step debugging easier with GDB/DDD, I removed the
> optimization flag "-Os" from the config.mk file. In fact, with the
> optimization turned on, the code seems not to be executed sequentially
> inside code window. However, without the -Os flag, the linker is unable to
Well, the _optimized_ code _is_ exectued sequentially. But you cannot
expect that a sequence of lines of C code results in a strictly
sequential sequence of machine instructions. The potimizer will -
ummm - optimize the code.
> Why is the -Os flag absolutely necessary?
Because otherwise inline functions are not expanded. See the
documentation for GCC.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de
Given a choice between two theories, take the one which is funnier.
More information about the U-Boot
mailing list