cancel
Showing results for 
Search instead for 
Did you mean: 

SDCC 4.4.0 and a comparison of current STM8 C compilers

Philipp Krause
Senior II

Two days ago, SDCC 4.4.0, a C compiler targeting various 8-bit architectures, including STM8, was released.

 

IMO, for the ST8, the main two improvements over SDCC 4.3.0 are:

  • New optimizations, in particular generalized constant propagation and the rotation optimizations, make quite a difference incode size and speed for some programs.
  • Good ISO C23 support - many ISO C23 features were introduced in 4.3.0, but there were bugs in some corner cases, which have since been found and fixed.

 

For those who wonder how current C compilers for the STM8 compare, I've done a quick comparison:

http://www.colecovision.eu/stm8/compilers.shtml

Summary: SDCC is doing great, Cosmic is doing okay, the others not so much apart from very specific use cases (no surprise here - by now, IAR and Raisonance compilers haven't seen an update for years).

 

The official release for SDCC 4.4.0 is available in the SourceForge File release system:
https://sourceforge.net/projects/sdcc/files/

In addition to the source package, binaries are available for Windows, macOS, and GNU/Linux.

In addition to various bug fixes, notable features added since the 4.3.0 release are:

  • Optimizations for rotations.
  • struct / union parameters for hc08, s08 and mos6502.
  • Many bug fixes for -ms08 --stack-auto.
  • struct / union return support for hc08 and s08 (caller side only).
  • Generalized constant propagation.
  • New command line option --syntax-only to only parse the input.
  • Added C99 header inttypes.h
  • Added library functions imaxabs, imaxdiv, llabs, strtoimax, strtoll, strtoull, strtoumax, wcsncmp, wcstoimax, wcstol, wcstoll, wcstoul, wcstoull, wcstoumax
  • New r800 port to better support the ASCII Corp R800 and Zilog Z280.
  • Changed the default calling convention for r2k, r2ka, r3ka, tlcs90, ez80-z80 from version 0 to 1 (this is an ABI break, and will require changes to user-written asm functions or their declarations).
  • Improved optimizations for code speed for stm8, pdk, z80 (and related).
  • New mos65c02 port to better support the WDC 65C02.

A full list of changes can be found in the ChangeLog:
https://sourceforge.net/p/sdcc/code/HEAD/tree/tags/sdcc-4.4.0/sdcc/ChangeLog

3 REPLIES 3
Andrew Neil
Evangelist III

AIUI, the entire STM8 range is now NRND (Not Recommended for New Designs) ?

The 10-year "longevity" clock has already been ticking for a couple of years

It is also my understanding that the entire STM8 range is now NRND. IMO, that is very unfortunate - the STM8 makes a quite good target architecture for C compilers, and it was able to compete on price with many far less nice 8-bit architectures. AFAIK, the STM8 was also always cheap enough that no one even tried to fake them.

 

But ST apparently decided that being able to move some STM8 customers to STM32 was worth losing the rest of them.

 

SDCC is mostly a volunteer effort; as long as there are developers willing to maintain the stm8 port, SDCC will support the STM8. My guess it that we'll see at least another two decades of SDCC STM8 support.

 

Philipp Krause
Senior II

Looks like STM8S, STM8L, STNRG, STLUX and STM8SPLNB are now "active", while STM8AF, STM8AL and STM8TL are still "NRND".