[U-Boot] Turning optimizations off

Wolfgang Denk wd at denx.de
Fri May 29 00:04:33 CEST 2009


Dear "Fahd Abidi",

In message <71DEA556544D7A4F9C6848402D8184340C45D7 at usi01.ultsol.local> you wrote:
>
> 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

Well, "-Os" means "optimize for minimal code size"...

> (gdb) stepi
>
> 0x0ff78750 in get_table_entry_name (table=<value optimized out>,

... so it is only natural that GCC will eliminate unneeded code.

> Does anyone know how to completely turn optimization off? Using no -O
> flag results in u-boot not compiling.

You cannot globally disable optimization. You might get away with
doing this on a per-file level, but there is no guarantee for that.

It is better to arrange to keep optimization turned on - after all,
this is the real code that will later be running.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is your destiny.                                     - Darth Vader


More information about the U-Boot mailing list