[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gas/32391] New: \@ incorrectly handled in nested macros
From: |
regis.duchesne at broadcom dot com |
Subject: |
[Bug gas/32391] New: \@ incorrectly handled in nested macros |
Date: |
Tue, 26 Nov 2024 09:37:54 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=32391
Bug ID: 32391
Summary: \@ incorrectly handled in nested macros
Product: binutils
Version: 2.38
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: gas
Assignee: unassigned at sourceware dot org
Reporter: regis.duchesne at broadcom dot com
Target Milestone: ---
Compiling this code
===
.macro outer
before_inner_\@:
nop
.macro inner
inside_inner_\@:
nop
.endm
inner
inner
after_inner_\@:
nop
.end
outer
===
errors out with
===
Error: symbol `inside_inner_0' is already defined
===
This occurs because \@ in the inner macro evaluates to the same value as \@ in
the outer macro (in this case 0), and since the inner macro is executed twice
the inside_inner_0 label is output twice, i.e. redefined.
However, the sole purpose of the \@ pseudo-variable is to generate unique names
inside macros, so this behavior is highly unexpected and in my opinion a bug.
What is expected is that this code should compile without errors, and produce
this output
===
before_inner_0:
nop
inside_inner_1:
nop
inside_inner_2:
nop
after_inner_0:
nop
===
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gas/32391] New: \@ incorrectly handled in nested macros,
regis.duchesne at broadcom dot com <=