]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ARM: fix -masm-syntax-unified (PR88648)
authorStefan Agner <stefan@agner.ch>
Mon, 11 Feb 2019 09:31:13 +0000 (10:31 +0100)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Mon, 11 Feb 2019 09:31:13 +0000 (09:31 +0000)
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.

From-SVN: r268765

gcc/ChangeLog
gcc/config/arm/arm.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/pr88648-asm-syntax-unified.c [new file with mode: 0644]

index 9e73034f085b9a8fd806433fa918181a4e0cc878..55d41b89dfd2ca35038e620da17edb23e9b7a173 100644 (file)
@@ -1,3 +1,12 @@
+2019-02-11  Stefan Agner  <stefan@agner.ch>
+
+       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.
+
 2019-02-09  Alan Modra  <amodra@gmail.com>
 
        PR target/88343
index dd1f91f5efa1c85a908d50caa73173419c832000..c8cd873e96dc44b00e01a051a4180a164e3e63fc 100644 (file)
@@ -3001,7 +3001,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;
index 02f051e6cbd7fe9eef677a91723f31f25d3303a3..9bc5587a4eb95e93c579c43d152c47590ffcf43b 100644 (file)
@@ -1,3 +1,12 @@
+2019-02-11  Stefan Agner  <stefan@agner.ch>
+
+       Backport from mainline
+       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-02-10  Harald Anlauf  <anlauf@gmx.de>
 
        Backport from trunk
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 (file)
index 0000000..251b4d5
--- /dev/null
@@ -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} } } */
+