Forcing inline assembly to be unified syntax seems not to work properly E.g. compiling a c file with the following inline assembly using arm-none-eabi-gcc -marm -march=armv7-a -masm-syntax-unified test.c --save-temps asm ( "nop" ); leads to: .syntax divided @ 5 "test.c" 1 nop @ 0 "" 2
Confirmed on all the branches since GCC 6. GCC 5 did the right thing. I think r222995 is to blame
I have observed a similar problem on GCC 5.4.0 on Ubuntu 16.04 package gcc-arm-linux-gnueabihf. The problem only happens if I give both -marm and -masm-syntax-unified, then it seems to ignore -masm-syntax-unified. But without -marm it generates thumb code, which is not what I want. Previously asked at: https://stackoverflow.com/questions/54078112/how-to-write-syntax-unified-ual-armv7-inline-assembly-in-gcc
Author: ktkachov Date: Thu Jan 10 11:36:42 2019 New Revision: 267804 URL: https://gcc.gnu.org/viewcvs?rev=267804&root=gcc&view=rev Log: ARM: fix -masm-syntax-unified (PR88648) This allows to use unified asm syntax when compiling for the ARM instruction. This matches documentation and seems what the initial patch was intended doing when the flag got added. 2019-01-10 Stefan Agner <stefan@agner.ch> PR target/88648 * config/arm/arm.c (arm_option_override_internal): Force opts->x_inline_asm_unified to true only if TARGET_THUMB2_P. * gcc.target/arm/pr88648-asm-syntax-unified.c: Add test to check if -masm-syntax-unified gets applied properly. Added: trunk/gcc/testsuite/gcc.target/arm/pr88648-asm-syntax-unified.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/arm/arm.c trunk/gcc/testsuite/ChangeLog
Fixed on trunk.
Author: ktkachov Date: Mon Feb 11 09:26:31 2019 New Revision: 268764 URL: https://gcc.gnu.org/viewcvs?rev=268764&root=gcc&view=rev Log: ARM: fix -masm-syntax-unified (PR88648) Backport from mainline. 2019-01-10 Stefan Agner <stefan@agner.ch> PR target/88648 * config/arm/arm.c (arm_option_override_internal): Force opts->x_inline_asm_unified to true only if TARGET_THUMB2_P. * gcc.target/arm/pr88648-asm-syntax-unified.c: Add test to check if -masm-syntax-unified gets applied properly. Added: branches/gcc-8-branch/gcc/testsuite/gcc.target/arm/pr88648-asm-syntax-unified.c Modified: branches/gcc-8-branch/gcc/ChangeLog branches/gcc-8-branch/gcc/config/arm/arm.c branches/gcc-8-branch/gcc/testsuite/ChangeLog
Author: ktkachov Date: Mon Feb 11 09:31:13 2019 New Revision: 268765 URL: https://gcc.gnu.org/viewcvs?rev=268765&root=gcc&view=rev Log: ARM: fix -masm-syntax-unified (PR88648) Backport from mainline. 2019-01-10 Stefan Agner <stefan@agner.ch> PR target/88648 * config/arm/arm.c (arm_option_override_internal): Force opts->x_inline_asm_unified to true only if TARGET_THUMB2_P. * gcc.target/arm/pr88648-asm-syntax-unified.c: Add test to check if -masm-syntax-unified gets applied properly. Added: branches/gcc-7-branch/gcc/testsuite/gcc.target/arm/pr88648-asm-syntax-unified.c Modified: branches/gcc-7-branch/gcc/ChangeLog branches/gcc-7-branch/gcc/config/arm/arm.c branches/gcc-7-branch/gcc/testsuite/ChangeLog
Fixed on all active branches.