]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/70027 (invalid assembly syntax generated with -fno-plt -masm=intel)
authorUros Bizjak <uros@gcc.gnu.org>
Tue, 1 Mar 2016 20:11:19 +0000 (21:11 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Tue, 1 Mar 2016 20:11:19 +0000 (21:11 +0100)
PR target/70027
* config/i386/i386.c (ix86_output_call_insn): Add -masm=intel
asm dialect alternatives to explicit GOTPCREL calls.

testsuite/ChangeLog:

PR target/70027
* gcc.target/i386/pr70027.c: New test.

From-SVN: r233864

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr70027.c [new file with mode: 0644]

index ef319be33b647426f934cf0cf215f4f25cb9c0ad..b758d42656005ccfe691911b532b9d6c80494286 100644 (file)
@@ -1,3 +1,9 @@
+2016-03-01  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/70027
+       * config/i386/i386.c (ix86_output_call_insn): Add -masm=intel
+       asm dialect alternatives to explicit GOTPCREL calls.
+
 2016-03-01  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR ada/70017
@@ -20,7 +26,8 @@
        2016-03-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
 
        * config/s390/constraints.md ("jm8"): New constraint.
-       * config/s390/predicates.md ("const_int_8bitset_operand"): New predicate.
+       * config/s390/predicates.md ("const_int_8bitset_operand"): New
+       predicate.
        * config/s390/s390.md ("*setmem_long", "*setmem_long_and"): Merge
        into ...
        ("*setmem_long<setmem_and>"): New pattern.
 2016-03-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
 
        * config/s390/predicates.md (const_int_6bitset_operand): New
-        predicates.
+       predicate.
        * config/s390/s390.md: Include subst.md.
        ("rotl<mode>3"): New expander.
        ("rotl<mode>3", "*rotl<mode>3_and"): Merge insn definitions into
 
 2016-02-23  Evandro Menezes  <e.menezes@samsung.com>
 
-        * config/aarch64/aarch64.c (exynosm1_tunings): Enable the Newton
-        series for reciprocal square root in Exynos M1.
+       * config/aarch64/aarch64.c (exynosm1_tunings): Enable the Newton
+       series for reciprocal square root in Exynos M1.
 
 2016-02-23  Martin Sebor  <msebor@redhat.com>
 
index d8a2909b75f1c7ee27f333fca1bdcf40ce62d907..7e2a85cd7e9abf58756929f582f7d5d5a70ccbe0 100644 (file)
@@ -27293,14 +27293,17 @@ ix86_output_call_insn (rtx_insn *insn, rtx call_op)
 
   if (SIBLING_CALL_P (insn))
     {
-      if (direct_p && ix86_nopic_noplt_attribute_p (call_op))
-       xasm = "%!jmp\t*%p0@GOTPCREL(%%rip)";
-      else if (direct_p)
-       xasm = "%!jmp\t%P0";
+      if (direct_p)
+       {
+         if (ix86_nopic_noplt_attribute_p (call_op))
+           xasm = "%!jmp\t{*%p0@GOTPCREL(%%rip)|[QWORD PTR %p0@GOTPCREL[rip]]}";
+         else
+           xasm = "%!jmp\t%P0";
+       }
       /* SEH epilogue detection requires the indirect branch case
         to include REX.W.  */
       else if (TARGET_SEH)
-       xasm = "%!rex.W jmp %A0";
+       xasm = "%!rex.W jmp\t%A0";
       else
        xasm = "%!jmp\t%A0";
 
@@ -27338,10 +27341,13 @@ ix86_output_call_insn (rtx_insn *insn, rtx call_op)
        seh_nop_p = true;
     }
 
-  if (direct_p && ix86_nopic_noplt_attribute_p (call_op))
-    xasm = "%!call\t*%p0@GOTPCREL(%%rip)";
-  else if (direct_p)
-    xasm = "%!call\t%P0";
+  if (direct_p)
+    {
+      if (ix86_nopic_noplt_attribute_p (call_op))
+       xasm = "%!call\t{*%p0@GOTPCREL(%%rip)|[QWORD PTR %p0@GOTPCREL[rip]]}";
+      else
+       xasm = "%!call\t%P0";
+    }
   else
     xasm = "%!call\t%A0";
 
index bf76ea7b07584f24c31cdd9b4a90a093bae83db1..033a0d3f35fd88fd8e87ea1c5313e09ee5b625ee 100644 (file)
@@ -1,3 +1,8 @@
+2016-03-01  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/70027
+       * gcc.target/i386/pr70027.c: New test.
+
 2016-03-01  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc.dg/pr70017.c: New test.
diff --git a/gcc/testsuite/gcc.target/i386/pr70027.c b/gcc/testsuite/gcc.target/i386/pr70027.c
new file mode 100644 (file)
index 0000000..b4b4830
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do assemble } */
+/* { dg-options "-fno-plt -masm=intel" } */
+/* { dg-require-effective-target masm_intel } */
+
+extern void bar (int);
+
+void
+foo (void)
+{
+  bar (123);
+}