From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Gurevich Date: Thu, 20 Mar 2003 09:34:25 -0800 Subject: [U-Boot-Users] Compiler optimizations and debugging References: <5.1.1.6.0.20030320104504.00a81840@dns.struinfo.it> Message-ID: <3E79FBA1.2090707@paulidav.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello llandre, llandre 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 complete the build: > > Why is the -Os flag absolutely necessary? Because the functions you are missing now (like out_8, in_32, etc.) are, in fact, inline functions. You need -O{something} to enable them. As far as "non-sequential" code execution in the debugger, you can try to ADD the following flags to gcc command line: -fno-schedule-insns -fno-schedule-insns2 This should disable instruction reordering (as well as slow down the execution quite noticeably since your pipeline will be stalled too often). Oh, and in any case (with or without -fno-schedule-insns) your code is executed correctly. Best regards, Vladimir