public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-9172] i386: Fix up x86_function_profiler -masm=intel support [PR114094]
Date: Mon, 26 Feb 2024 06:32:30 +0000 (GMT)	[thread overview]
Message-ID: <20240226063230.935353858D3C@sourceware.org> (raw)

https://gcc.gnu.org/g:6987f16742bd4fc6bb8118b9efde52fb9169b327

commit r14-9172-g6987f16742bd4fc6bb8118b9efde52fb9169b327
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Feb 26 07:30:05 2024 +0100

    i386: Fix up x86_function_profiler -masm=intel support [PR114094]
    
    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.

Diff:
---
 gcc/config/i386/i386.cc                  |  2 +-
 gcc/testsuite/gcc.target/i386/pr114094.c | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index 4fdab34c91cd..86381b050948 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -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
index 000000000000..64fe50925923
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr114094.c
@@ -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)
+{
+}

                 reply	other threads:[~2024-02-26  6:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240226063230.935353858D3C@sourceware.org \
    --to=jakub@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).