aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2019-01-10 12:36:42 +0100
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>2019-01-10 11:36:42 +0000
commitae8792cb3b49225e37d530c8e35f6608c5eb8492 (patch)
tree11b17aff511f99ac81bd1bc19c6171a90b11a5b9 /gcc
parent7c4979b2b2f4d70f9e1ab8ba5fa3daeb0d5ace77 (diff)
downloadgcc-ae8792cb3b49225e37d530c8e35f6608c5eb8492.zip
gcc-ae8792cb3b49225e37d530c8e35f6608c5eb8492.tar.gz
gcc-ae8792cb3b49225e37d530c8e35f6608c5eb8492.tar.bz2
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. From-SVN: r267804
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/arm/arm.c3
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.target/arm/pr88648-asm-syntax-unified.c14
4 files changed, 28 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ee2e8fb..c229d65 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2019-01-10 Jakub Jelinek <jakub@redhat.com>
PR c/88568
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index f473aee..d71ab40 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -3101,7 +3101,8 @@ arm_option_override_internal (struct gcc_options *opts,
/* Thumb2 inline assembly code should always use unified syntax.
This will apply to ARM and Thumb1 eventually. */
- opts->x_inline_asm_unified = TARGET_THUMB2_P (opts->x_target_flags);
+ if (TARGET_THUMB2_P (opts->x_target_flags))
+ opts->x_inline_asm_unified = true;
#ifdef SUBTARGET_OVERRIDE_INTERNAL_OPTIONS
SUBTARGET_OVERRIDE_INTERNAL_OPTIONS;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6408435..3936a8f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2019-01-10 Stefan Agner <stefan@agner.ch>
+
+ PR target/88648
+ * gcc.target/arm/pr88648-asm-syntax-unified.c: Add test to
+ check if -masm-syntax-unified gets applied properly.
+
2019-01-10 Jakub Jelinek <jakub@redhat.com>
PR c/88568
diff --git a/gcc/testsuite/gcc.target/arm/pr88648-asm-syntax-unified.c b/gcc/testsuite/gcc.target/arm/pr88648-asm-syntax-unified.c
new file mode 100644
index 0000000..251b4d5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr88648-asm-syntax-unified.c
@@ -0,0 +1,14 @@
+/* Test for unified syntax assembly generation. */
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_arch_v7a_ok } */
+/* { dg-add-options arm_arch_v7a } */
+/* { dg-options "-marm -march=armv7-a -masm-syntax-unified" } */
+
+void test ()
+{
+ asm("nop");
+}
+
+/* { dg-final { scan-assembler-times {\.syntax\sunified} 3 } } */
+/* { dg-final { scan-assembler-not {\.syntax\sdivided} } } */
+