[U-Boot-Users] Compiler optimizations and debugging
    Vladimir Gurevich 
    vag at paulidav.org
       
    Thu Mar 20 18:34:25 CET 2003
    
    
  
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
    
    
More information about the U-Boot
mailing list