I'm not aware of any command line switch to make gcc generate unified syntax. The asm code that gcc generated in thumb mode follows the old devided syntax. All documentation by Atmel these days is about the unified syntax. Also, binutils has decided to disassemble to unified syntax by default. A code example and how to reproduce the issue is given below. Command: arm-softfloat-eabi-gcc -mcpu=arm7tdmi -O2 -mthumb -S -o - foo.c Contents of foo.c: int main() { return 0; } Generated Assembly (devided syntax): main: mov r0, #0 bx lr Disassembly (unified syntax): 00000000 <main>: 0: 2000 movs r0, #0 2: 4770 bx lr According to the documentation, mov r0,#0 is not a valid 16bit command. The documentation however assumes the unified syntax. http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489i/Cihcdbca.html It might be argued that the transition from classic to unified syntax is to error-prone or too much work. For me, it causes some trouble. I will have to switch between unified syntax and devided syntax in inline assembly since gcc uses devided and clang uses unified syntax.
It seems, that for targets like -mcpu=cortex-m4 the gcc does generate unified syntax. So is the unified syntax only used for newer targets that use the thumb2 instruction set whereas the divided syntax is used for older thumb1 targets?
Unified syntax is currently only supported for ARM and Thumb2 stated (for the latter it's mandatory). Thumb1, for historical reasons, still uses the old syntax. This is a known issue.
(In reply to Richard Earnshaw from comment #2) > This is a known issue. So what needs to be done? Where do I find the source/configuration/whatever of the code generator for thumb mode?
Thumb1 Fixed for 5.0 with Terry's work - see release notes https://gcc.gnu.org/gcc-5/changes.html ARM state is a bit more involved.
Oh and Kyrylo fixed up vfp.md last year too. So it's only ARM state that remains. I have a few patches in flight that I'm testing.
Fixed in ARM state by https://gcc.gnu.org/ml/gcc-cvs/2015-11/msg00242.html The compiler now emits assembler completely in unified syntax, inline assembler follows divided syntax for legacy reasons but can be moved up.