Binary size difference between gcc9 and gcc10

Discussions and support about ChibiStudio, the free development environment for ARM.
Guillaume227
Posts: 15
Joined: Tue Apr 18, 2017 6:52 pm
Has thanked: 10 times

Binary size difference between gcc9 and gcc10

Postby Guillaume227 » Thu Jul 29, 2021 7:36 pm

I am giving ChibiStudio 2021-07 a spin.
First of all, thanks for the update !

I was checking the demo project RT-STM32F446RE-NUCLEO64 and noticed a significant binary size difference between the two gcc versions.

For gcc9:

Code: Select all

   text      data       bss       dec       hex   filename
  [b]46872      220    130848    177940     2b714   build/ch.elf
Done
20:28:53 Build Finished. 0 errors, 0 warnings. (took 13s.169ms)

For gcc10:

Code: Select all

   text      data       bss       dec       hex   filename
   58860      220    130848    189928     2e5e8   build/ch.elf
Done
20:33:04 Build Finished. 0 errors, 0 warnings. (took 13s.712ms)


That's the exact same project : I am opening the same workspace in two different ChibiStudios using the two gcc shortcuts (I am on Windows 10).

It might not be ChibiStudio related and instead be down to differences in gcc versions but I am still curious: has anyone seen that? Do you have an idea where that non-trivial diff might be coming from?

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Binary size difference between gcc9 and gcc10

Postby Giovanni » Thu Jul 29, 2021 7:49 pm

Hi,

GCC10 is pushing even more for speed using -O2, it is significantly faster. If you want to compare for size then use -Os.

Giovanni

Guillaume227
Posts: 15
Joined: Tue Apr 18, 2017 6:52 pm
Has thanked: 10 times

Re: Binary size difference between gcc9 and gcc10

Postby Guillaume227 » Sat Jul 31, 2021 10:24 am

Thank you Giovanni.
For reference, I recompiled using -Os, here the output that we can compare to the others :

Code: Select all

   text      data       bss       dec       hex   filename
  41740       220    130848    172808     2a308   build/ch.elf

Done
11:17:41 Build Finished. 0 errors, 0 warnings. (took 15s.792ms)


For reference here is a post about relevant gcc10 improvements.
https://community.arm.com/developer/too ... and-faster

I can see how vectorization / loop optimization can play a big role there.


Return to “ChibiStudio”

Who is online

Users browsing this forum: No registered users and 8 guests