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

Code size variation in compiler 5 versions

Hi,

When compiling my code in Keil5, I get different code sizes when using compiler V5.03 and V5.06.

Using V5.03 - default compiler used in Keil4- my code size is:  Total RW  Size (RW Data + ZI Data)             30240 (  29.53kB)

Using V5.06 - default compiler used in Keil5- my code size is: Total RW  Size (RW Data + ZI Data)             49096 (  47.95kB)

A difference of 18.42KB. My target device is TM4C123FH6PM, and is has only 32KB of RAM, so this difference is huge!

With both compilers no optimization was used (level 0).

Why is the code size that different with the different compilers?

TIA,

Parents
  • Use the "nm" tool or check out the linker map to see which objects are particularly large.

    arm-none-eabi-nm -SC --size-sort /tmp/Arduino1.8.13Build/*.elf | grep " [bBdD] "
       :
    20000000 000000b2 D desc_ms_os_20
    20000fd4 000000c0 B _usbd_qdef_buf
    20000a0c 00000100 b sram_registers
    20000840 0000012c b _vendord_itf
    2000012c 00000184 B TinyUSBDevice
    20000e1c 000001b8 B _midid_itf
    20000600 00000200 b _mscd_buf
    200002bc 000002b8 b _cdcd_itf

    > With both compilers no optimization was used (level 0).

    You should really turn on some optimization!

Reply
  • Use the "nm" tool or check out the linker map to see which objects are particularly large.

    arm-none-eabi-nm -SC --size-sort /tmp/Arduino1.8.13Build/*.elf | grep " [bBdD] "
       :
    20000000 000000b2 D desc_ms_os_20
    20000fd4 000000c0 B _usbd_qdef_buf
    20000a0c 00000100 b sram_registers
    20000840 0000012c b _vendord_itf
    2000012c 00000184 B TinyUSBDevice
    20000e1c 000001b8 B _midid_itf
    20000600 00000200 b _mscd_buf
    200002bc 000002b8 b _cdcd_itf

    > With both compilers no optimization was used (level 0).

    You should really turn on some optimization!

Children
No data