From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerry Van Baren Date: Fri, 29 May 2009 11:12:48 -0400 Subject: [U-Boot] Turning optimizations off In-Reply-To: <71DEA556544D7A4F9C6848402D8184340C45D7@usi01.ultsol.local> References: <71DEA556544D7A4F9C6848402D8184340C45D7@usi01.ultsol.local> Message-ID: <4A1FFB70.9010400@ge.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Fahd Abidi wrote: > Hello, > > I am debugging u-boot with a BDI and am running into a case where a > variable gets optimized out. For the sake of debugging I am trying to > turn off optimizations. > I have the following in u-boot-2009.01/config.mk, but GDB still reports > optimizations: > > OPTFLAGS= -Os -fno-schedule-insns -fno-schedule-insns2 > #-fomit-frame-pointer > > (gdb) stepi > > 0x0ff78750 in get_table_entry_name (table=, If you (temporarily) put "volatile" on the variable, the compiler should not optimize it out. Obviously, this is a limited solution, but may get your past your problem. [snip] > Does anyone know how to completely turn optimization off? Using no -O > flag results in u-boot not compiling. Theoretically, you could compile individual files w/o optimization (e.g. if you compile it by hand, make shouldn't re-compile it). I doubt that you want to go there, though... > Fahd Abidi Good luck, gvb