Something else I don't see mentioned: Some applications will require a high level of functional safety that IAR meets (IEC 61508). If you aren't flying to the moon or running pacemakers then I would never deal with IAR. Even in some safety critical applications you can use GCC its just a lot more work validating the compiler. As for execution size, I have never been in a situation where the space saved is worth the hassle of proprietary compiler. Answer from jakobnator on reddit.com
🌐
Quora
quora.com › What-is-the-difference-between-GCC-and-ARM-compilers
What is the difference between GCC and ARM compilers? - Quora
Answer (1 of 3): GCC is short for GNU Compiler Collection. It’s a standardized intermediate representation together with many front-ends (that convert C, C++, Objective C, ADA, and quite a few other languages to the GCC intermediate representation) and back-ends (which convert the intermediate re...
🌐
Reddit
reddit.com › r/embedded › what is the value of using a proprietary compiler instead of using gcc?
r/embedded on Reddit: What is the value of using a proprietary compiler instead of using GCC?
May 22, 2023 -

I work for a company that develops products that contains ARM Cortex-M chips that are relatively high volume. We recently hired new firmware developers who are not fans at all or using IAR or Keil. They ported the code almost completely to GCC and we’ve been using it for a few weeks now on a new project. I haven’t seen any red flags so far. With all the GCC optimizations enabled, the code size is slightly bigger than the code size with IAR. Nothing too worrying. What exactly are we losing by switching to GCC that we possibly haven’t thought about?

Discussions

ARM compiler vs GCC compiler
Hi Does anybody know what is the difference between code generated by ARM compiler and code generated by GCC compiler? For example, is there any principle difference between binary filesize or speed of execution or resource (memory) allocation? Is there any restrictions of using GCC compiler? More on forum.sierrawireless.com
🌐 forum.sierrawireless.com
0
0
October 17, 2005
arm-linux-gnu-gcc Vs arm-linux-gcc - Unix & Linux Stack Exchange
What is the difference between arm-linux-gnu-gcc and arm-linux-gcc Which should be used for cross compiling a C program for ARM ? More on unix.stackexchange.com
🌐 unix.stackexchange.com
Practical comparison of ARM compilers
We're also very successfully using CMake as our build system, as opposed to Make itself. It lets you organise your build system & support different configurations & dependencies in a much easier way than e.g. Makefiles & Git submodules, which we've tried in the past. More on news.ycombinator.com
🌐 news.ycombinator.com
16
108
July 27, 2023
Standards Support in Arm C/C++ Compiler (arm-gnu-eabi-g++)
Just use upstream gcc or clang. There's rarely a reason to use the vendor downstreams More on reddit.com
🌐 r/cpp
9
4
January 4, 2025
Top answer
1 of 3
6

benchmarking is an artform in and of itself, usually easy to manipulate the results to show whatever you want. I would not expect the compilers to generate the same results except for very small test cases, and sometimes in those small test cases their results are either identical or sometimes vastly different as your test has exposed an optimization that one compiler knows/uses and one the other doesnt.

I used to keep track of such things (compiler performance numbers) with dhrystone for example, but in the case of known benchmarks (not that dhrystone means much anymore, but others) you may find that some compilers are tuning themselves to look good under benchmarks perhaps at the expense of something else.

There is no right answer, there is no universal "best", it is all in the eye of the beholder, you. Which tool is easier for you to use, which do you like better be it for the gui or pretty colors or sound card sounds or whatever. And go from there.

The gnu compiler generally for applications I have tested does not produce code as "fast" which is my benchmark, compared to the others, but there are way more people using the free gnu tools so the support for it is considerably wider due to the number of web pages and forums and examples. gnu wont have a size restriction either, but it may require more learning or whatever to get up and running...

The cortex-ms are split into the armv6m and armv7m families, the v6m (cortex-m0) only have a small number of thumb2 extensions, the armv7m have about 150 thumbv2 extensions to thumb, so you need to know what your tools support and not use the wrong stuff on the wrong chip. Then the compilers if they know all of this may and will produce different instruction mixes from the same source code. Further within the same compiler or family using different command line options you can/will get vastly different code. And then beyond that with a cortex-m4 with cache on if you have one with such a thing, depending on how the code lies in the cache lines you may get vastly different performance, so benchmarking is a research project in itself for each blob of C code you want to benchmark. The performance range within a single compiler may shadow another compiler or the overlap may be enough to not matter.

If you have access to the tools you add value to yourself professionally by learning to use the competing tools and being able to walk into a job and or within your job choose what you see as the right tool for the job or walk into a Kiel house and be able to work right away or a gnu house and work right away. Where you might lose a job if you are gnu only and the job is for a Kiel house.

2 of 3
5

We have done some comparisons; IAR and Keil typically outperform GCC with default settings. But with some compiler flags you can make GCC come pretty close to the result of IAR and Keil.

Some of the compilers you mention are integrated development environments. Others are just plain compilers. Some people prefer a integrated environment with compiler, editor and debugger nicely packaged for you. Others prefer to set up their own environment. It is a matter of taste.

In addition to Yagarto, there is also the "Code Sourcery" distribution of GCC for ARM.

🌐
M0agx
m0agx.eu › practical-comparison-of-ARM-compilers.html
M0AGX / LB9MG - Practical comparison of ARM compilers
If you pick the stock Arm GNU toolchain toolchain (formerly called GNU Arm Embedded) you will only get the GCC compiler, GNU binutils (eg. ld linker), gdb, C runtime init code (crt0), newlib C standard library. You will have to get the device headers, startup code and linker script from the silicon vendor yourself.
🌐
GNU
gcc.gnu.org › onlinedocs › gcc › ARM-Options.html
ARM Options (Using the GNU Compiler Collection (GCC))
Generate code for a processor running in big-endian mode; the default is to compile code for a little-endian processor. ... When linking a big-endian image select between BE8 and BE32 formats. The option has no effect for little-endian images and is ignored. The default is dependent on the selected target architecture. For ARMv6 and later architectures the default is BE8, for older architectures the default is BE32. BE32 format has been deprecated by ARM. ... This specifies the name of the target ARM architecture. GCC uses this name to determine what kind of instructions it can emit when generating assembly code.
🌐
Sierra Wireless Forum
forum.sierrawireless.com › forum announcements, ideas and feedback › documentation feedback
ARM compiler vs GCC compiler - Documentation feedback - Sierra Wireless Forum
October 17, 2005 - Hi Does anybody know what is the difference between code generated by ARM compiler and code generated by GCC compiler? For example, is there any principle difference between binary filesize or speed of execution or r…
🌐
Arm Community
community.arm.com › support-forums › f › compilers-and-libraries-forum › 52317 › what-s-difference-between-gnu-arm-toolchain-and-gccgnu
What's difference between gnu arm toolchain and gccgnu ?
Have a question about working on Arm technology? Browse our support forums for solutions to your questions, answer questions from fellow community members and get help from Arm experts.
Find elsewhere
🌐
Arm Community
community.arm.com › support-forums › f › compilers-and-libraries-forum › 49514 › armcc-or-armclang-versus-gcc
armcc or armclang versus gcc - Compilers and Libraries ...
June 9, 2021 - Have a question about working on Arm technology? Browse our support forums for solutions to your questions, answer questions from fellow community members and get help from Arm experts.
Top answer
1 of 1
1

If you only want to compile programs that run on their own on a processor (“bare metal” system), then all that matters is to have a compiler that produces instructions for that particular processor. “For ARM” is almost enough information, but not quite: you would also need to specify the version of the instruction set. Most ARM processors today are based on the same version (ARMv7) but even inside that there are many complications — some features (e.g. floating point, vector instructions) are optional and you need to specify whether to use them, and ARMv7 has in fact two instruction sets (“normal” ARM, and Thumb). Most distributions of GCC for ARM target ARMv7 with optional features and Thumb enabled by options.

If you want to compile programs that interact with other programs, then all the programs involved need to be able to communicate. Making system calls and, even more so, making library calls requires that the caller and the callee agree on the binary representation of data (e.g. endianness) and on how to pass data around (which registers to use for function arguments, how function calls affect the stack, etc.). The specification of how this works is called an ABI (application binary interface).

The general naming convention for GCC cross-compilers is CPU-VENDOR-SYSTEM-gcc (where the part before -gcc matches the system type of configure), but there is some fuzz about the VENDOR-SYSTEM part. Cross-compilers for ARM are usually called arm-VENDOR-OS-LIBC-ABI-gcc with some of the parts omitted. For example, arm-acme-linux-gnu-gnueabi-gcc would be GCC for ARM (v7 by default), for ACME's distribution of Linux, set to link against Glibc, using the gnueabi ABI. arm-linux-gnu-gcc indicates a compiler set to link against Glibc on Linux, with an unspecified ABI. arm-linux-gcc doesn't specify which libc is targeted.

🌐
Hacker News
news.ycombinator.com › item
Practical comparison of ARM compilers | Hacker News
July 27, 2023 - We're also very successfully using CMake as our build system, as opposed to Make itself. It lets you organise your build system & support different configurations & dependencies in a much easier way than e.g. Makefiles & Git submodules, which we've tried in the past.
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › bare metal, assembly language
My 6000 line ARM C compiler sometimes beats gcc -O3 - Raspberry Pi Forums
Ok I fixed the problem by removing the libsquint.so library and include squint.o into mc-so. Now mc-so compile with gcc10.2.1 modification on Makefile ... $(BIN)-so: $(BIN).c $(PEEP).c $(VECHO) " CC+LD\t\t$@\n" $(Q)$(ARM_CC) -DSQUINT_SO $(CFLAGS) -c -fpic $(PEEP).c $(Q)$(ARM_CC) -DSQUINT_SO -g $(CFLAGS) $(PEEP).o -o $@ $< -ldl
🌐
MathWorks
mathworks.com › products › connections › product_detail › arm-compiler.html
Arm Compiler - The reference C/C++ toolchain for Arm processors - Third-Party Products & Services - MATLAB & Simulink
Specifically designed to target Arm architectures · Faster code execution across a wide range of workloads · Reduced code size through targeted optimizations · Safety qualified in a variety of industries · Source code compatibility with code written for GNU Compiler Collection (gcc) Integration with Embedded Coder simplifies generation of optimized code from Simulink models ·
🌐
Reddit
reddit.com › r/cpp › standards support in arm c/c++ compiler (arm-gnu-eabi-g++)
r/cpp on Reddit: Standards Support in Arm C/C++ Compiler (arm-gnu-eabi-g++)
January 4, 2025 -

Hello! I’ve been reviewing the Arm documentation, and it appears that C++17 is the last fully supported standard in the Arm C++ Compiler (arm-gnu-eabi-g++). While this is clear to me, I would like to dig deeper into the level of support for C++20 and C++23.

Are these newer standards supported at all? If they are, is the support extensive, or are there only minor gaps? I would also like to hear about experiences with these standards in embedded development - which one do you recommend using, especially considering compatibility, stability, and available features?

Thank you.

🌐
Embedded Related
embeddedrelated.com › home › comp.arch.embedded › arm cortex m3 compilers - gcc vs arm-cc ?
ARM Cortex M3 compilers - gcc vs arm-cc ?
June 27, 2012 - >> Don't know about arm-cc, but it is definitely true for gcc vs IAR. IAR >> has a free download (limited to 32 kbytes codesize), so you could just >> try both. >> So, which do you feel is better? > > IAR produces 10-20% smaller code than gcc (Sourcey CodeBench Lite). We > use both. I wonder how much is the compiler and how much is the library.
🌐
Arm Community
community.arm.com › support-forums › f › compilers-and-libraries-forum › 12894 › armcc-vs-gcc---which-is-better-compiler
Armcc vs gcc - which is better compiler - Compilers and Libraries forum - Support forums - Arm Community
April 2, 2019 - Hello All, we use gnu gcc compiler with optimize option for our build. But optimize option inline everything and hard to debug, can't see local variables & symbols
🌐
Mbed
os.mbed.com › forum › helloworld › post › 51848
What are the differences between ARMCC(Online Compiler) and GCC ARM? | Mbed
January 9, 2017 - Hello, the differences would most probably lie in the libraries provided by each of these Toolchains. ARMCC is the C-Compiler which is provided by ARM for compiling Code for their Cores. GCC is the Compiler which origins in the GNU Project.
Top answer
1 of 3
1

arm-none-eabi-gcc is a cross-compiler for bare-metal ARM. ARM is the target, the host is the machine you run the compiler on - the development host.

In most cases you would use such a compiler for developing for bare-metal (i.e. no fully featured OS) embedded systems, but equally you could be using it to develop bootstrap code for a desktop system, or developing an operating system (though less likely).

In any event, it is not the compiler that determines if the system is embedded. An embedded system is simply a system running software that is not a general-purpose computer. For example many network routers run on embedded Linux such as OpenWRT and in that case you might use arm-linux-eabi-gcc. What distinguishes it is that it is still a cross-compiler; the host on which you build the code, is not the same machine architecture or OS as that which will run it.

Neither does being a cross-compiler make it "embedded" - it is entirely possible to cross compile Linux executables on Windows or vice versa with neither target being embedded.

The point is, there is no "Embedded C" language, it is all "Regular C". What makes it embedded is the intended target. So don't get hung-up on classification of the toolchain. If you are using it to generate code for embedded systems it is embedded, simple as that. Many years ago I worked on a project that used Microsoft C V6 (normally for MS-DOS) in an embedded system with code on ROM and running VRTX RTOS. Microsoft C was by no definition an embedded systems compiler; the "magic" was done by replacing Microsoft's linker to "retarget" it to produce ROM images rather than a .exe.

There are of course some targets that are invariably "embedded", such as 8051, and a cross-compiler for such a target could be said to be exclusively "embedded" I guess, but it is a distinction that serves little purpose.

2 of 3
1

There are many versions of arm gcc toolchains. The established naming convention for cross compilers is,

  • arm-linux-xxx - this is a 'Regular C', where the library is supported by the Linux OS. The 'xxx' is an ABI format.
  • arm-none-xxx - this is the 'embedded C'. The 'xxx' again indicates an ABI. It is generally 'newlib' based. Newlib can be hosted by an RTOS and then it will be almost 'Regular C'. If it is 'baremetal' and the newlib features are defaulted to error this is most likely termed 'embedded C'.

Embedded 'C++' was a term that was common sometime ago, but has generally been abandoned as a technology. As stated, the compiler itself is independant. However, the library/OS is typically what defines the 'spirit' of what you asked.


The ABI can be something like 'gnueabhf' for hard floating point, etc. It is a calling convention between routines and often depends on whether there is an FPU on the system or not. It may also depend on ISA, PIC, etc.

🌐
Higaski
higaski.at › gcc-vs-clang-cortex-m4-benchmarks
GCC vs Clang Cortex-M4 benchmarks – 東 Higaski
We can console us with the fact that neither IAR Systems nor Keil seem to have the manpower to keep up with the rapidly evolving language so both compilers don’t have full C++17 support yet. If you like to play with the latest language and library additions like I do you’re better off with GCC or Clang anyway.
🌐
Website Files
cdn.prod.website-files.com › 65ffeb142a7ab8b82264f150 › 67245c60e0286d1ee29d5d88_1455709079.pdf pdf
Arm compiler vs gcc performance
The proprietary optimizations and back-end designed solely for ARM give IAR an edge. The GNU Compiler Collection includes leading open source compilers like GCC and G++. The code quality is generally very good, but GCC wasn't originally designed just for ARM so