This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Debug build works but release

Note: This was originally posted on 19th January 2010 at http://forums.arm.com

My code works on debug build ( -Otime -g+ )
But release build can't work (  -Otime -O2 -zo )
the code is the same. the compiler is ADS1.2

Do you guys have any idea or previous experience on such an issue?

Thanks.
Parents
  • Note: This was originally posted on 19th January 2010 at http://forums.arm.com

    what I can find is part of the init code deactivated in release build

    for example, static init code

    0x00003724  EB000464  BL        pwrp_gio(0x000048BC)

    can't be traced into. while execution, the debugger just skip this line directly to next code and seems got no execution

    Yet, for public function call

    0x00003744  EBFFF8B7  BL        HWM_gio_pwrp(0x00001A28)

    is OK for both execution and trace into.


    in debug build, both functions can be executed and traced into.


    BTW, here is a remap operation in my code before pwrp. I copy the image into RAM and run there. Change all RAM memory settings to fit the image.


    When in debug mode the compiler probably turns off some of the more advanced optimizations to make the debug view more sensible. If you code is not compliant to the C standard it may work at low optimization levels, but will then break when the optimizer makes assumptions about the code which should be true but are not. Either that or it is a compiler bug =P

    Can you post information about what actually goes wrong, and what the disassembly looks like for the relevant pieces of code from both version you built?

    Iso
Reply
  • Note: This was originally posted on 19th January 2010 at http://forums.arm.com

    what I can find is part of the init code deactivated in release build

    for example, static init code

    0x00003724  EB000464  BL        pwrp_gio(0x000048BC)

    can't be traced into. while execution, the debugger just skip this line directly to next code and seems got no execution

    Yet, for public function call

    0x00003744  EBFFF8B7  BL        HWM_gio_pwrp(0x00001A28)

    is OK for both execution and trace into.


    in debug build, both functions can be executed and traced into.


    BTW, here is a remap operation in my code before pwrp. I copy the image into RAM and run there. Change all RAM memory settings to fit the image.


    When in debug mode the compiler probably turns off some of the more advanced optimizations to make the debug view more sensible. If you code is not compliant to the C standard it may work at low optimization levels, but will then break when the optimizer makes assumptions about the code which should be true but are not. Either that or it is a compiler bug =P

    Can you post information about what actually goes wrong, and what the disassembly looks like for the relevant pieces of code from both version you built?

    Iso
Children
No data