x86: Correct ASM_OUTPUT_SYMBOL_REF

Message ID CAMe9rOqwbXymJCte=G7pUbDVZbwatqW-TCisHqSuxJRn_RkhDg@mail.gmail.com
State New
Headers
Series x86: Correct ASM_OUTPUT_SYMBOL_REF |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_simplebootstrap_build--master-arm-bootstrap success Build passed
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_simplebootstrap_build--master-aarch64-bootstrap success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 fail Patch failed to apply

Commit Message

H.J. Lu Feb. 11, 2025, 6:12 a.m. UTC
  x is not a macro argument.  It just happens to work as final.cc passes
x for 2nd argument:

final.cc:      ASM_OUTPUT_SYMBOL_REF (file, x);

PR target/118825
* config/i386/i386.h (ASM_OUTPUT_SYMBOL_REF): Replace x with
SYM.
  

Comments

Uros Bizjak Feb. 11, 2025, 7:11 a.m. UTC | #1
On Tue, Feb 11, 2025 at 7:13 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> x is not a macro argument.  It just happens to work as final.cc passes
> x for 2nd argument:
>
> final.cc:      ASM_OUTPUT_SYMBOL_REF (file, x);
>
> PR target/118825
> * config/i386/i386.h (ASM_OUTPUT_SYMBOL_REF): Replace x with
> SYM.

> -      = assemble_name_resolve (XSTR (x, 0)); \
> +      = assemble_name_resolve (XSTR ((SYM), 0)); \

No need for parenthesis when macro argument is used in a function call.

OK with the above change.

Thanks,
Uros.

> --
> H.J.
  
H.J. Lu Feb. 11, 2025, 10:29 a.m. UTC | #2
On Tue, Feb 11, 2025 at 3:12 PM Uros Bizjak <ubizjak@gmail.com> wrote:
>
> On Tue, Feb 11, 2025 at 7:13 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > x is not a macro argument.  It just happens to work as final.cc passes
> > x for 2nd argument:
> >
> > final.cc:      ASM_OUTPUT_SYMBOL_REF (file, x);
> >
> > PR target/118825
> > * config/i386/i386.h (ASM_OUTPUT_SYMBOL_REF): Replace x with
> > SYM.
>
> > -      = assemble_name_resolve (XSTR (x, 0)); \
> > +      = assemble_name_resolve (XSTR ((SYM), 0)); \
>
> No need for parenthesis when macro argument is used in a function call.
>
> OK with the above change.

Fixed.  Pushed.  Will backport it to release branches later.

Thanks.
  

Patch

From d4cba6c43d7cf3bb7de4e751044a09ce3146a22b Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 11 Feb 2025 13:47:54 +0800
Subject: [PATCH] x86: Correct ASM_OUTPUT_SYMBOL_REF

x is not a macro argument.  It just happens to work as final.cc passes
x for 2nd argument:

final.cc:      ASM_OUTPUT_SYMBOL_REF (file, x);

	PR target/118825
	* config/i386/i386.h (ASM_OUTPUT_SYMBOL_REF): Replace x with
	SYM.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
---
 gcc/config/i386/i386.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index e8e528c7811..28bed2b5e64 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -2235,7 +2235,7 @@  extern unsigned int const svr4_debugger_register_map[FIRST_PSEUDO_REGISTER];
 #define ASM_OUTPUT_SYMBOL_REF(FILE, SYM) \
   do {							\
     const char *name					\
-      = assemble_name_resolve (XSTR (x, 0));		\
+      = assemble_name_resolve (XSTR ((SYM), 0));	\
     /* In -masm=att wrap identifiers that start with $	\
        into parens.  */					\
     if (ASSEMBLER_DIALECT == ASM_ATT			\
-- 
2.48.1