]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386: Fix up x86_function_profiler -masm=intel support [PR114094]
authorJakub Jelinek <jakub@redhat.com>
Mon, 26 Feb 2024 06:30:05 +0000 (07:30 +0100)
committerJakub Jelinek <jakub@redhat.com>
Mon, 26 Feb 2024 06:30:05 +0000 (07:30 +0100)
In my r14-8214 changes I apparently forgot one \n at the end of an instruction.
The corresponding AT&T line looks like:
"1:\tcall\t*%s@GOTPCREL(%%rip)\n"
but the Intel variant was
"1:\tcall\t[QWORD PTR %s@GOTPCREL[rip]]"

Fixed thusly.

2024-02-26  Jakub Jelinek  <jakub@redhat.com>

PR target/114094
* config/i386/i386.cc (x86_function_profiler): Add missing new-line
to printed instruction.

* gcc.target/i386/pr114094.c: New test.

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

index 4fdab34c91cdb72e02089137dc66e3fa946f82f2..86381b0509484e5f9c99ece2e84f3f7e9f518ecb 100644 (file)
@@ -22909,7 +22909,7 @@ x86_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED)
              if (!ix86_direct_extern_access)
                {
                  if (ASSEMBLER_DIALECT == ASM_INTEL)
-                   fprintf (file, "1:\tcall\t[QWORD PTR %s@GOTPCREL[rip]]",
+                   fprintf (file, "1:\tcall\t[QWORD PTR %s@GOTPCREL[rip]]\n",
                             mcount_name);
                  else
                    fprintf (file, "1:\tcall\t*%s@GOTPCREL(%%rip)\n",
diff --git a/gcc/testsuite/gcc.target/i386/pr114094.c b/gcc/testsuite/gcc.target/i386/pr114094.c
new file mode 100644 (file)
index 0000000..64fe509
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR target/114094 */
+/* { dg-do assemble { target *-*-linux* } } */
+/* { dg-require-effective-target masm_intel } */
+/* { dg-require-effective-target pie } */
+/* { dg-options "-fpie -fprofile -mno-direct-extern-access -masm=intel" } */
+
+void
+foo (void)
+{
+}