From: LIU Hao <lh_mouse@126.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: binutils@sourceware.org, GCC Development <gcc@gcc.gnu.org>
Subject: Re: RFC: Formalization of the Intel assembly syntax (PR53929)
Date: Sat, 20 Jan 2024 20:40:34 +0800 [thread overview]
Message-ID: <b25d869e-c3a9-4a99-8c21-3fc181b33d89@126.com> (raw)
In-Reply-To: <112d6607-3f35-4679-9ba8-d9257d2d20c7@suse.com>
[-- Attachment #1.1: Type: text/plain, Size: 1868 bytes --]
在 2024-01-19 17:13, Jan Beulich 写道:
> But I see a severe issue with your aim at confining strict mode to
> compiler generated code only: In inline assembly (see your mentioning of
> APP / NO_APP above) you still potentially reference C symbols. So the
> ambiguities don't disappear in APP / NO_APP regions.
My suggestion is that people who write inline assembly should have been aware of the existence of
bad names, and should have been careful to avoid them.
> And an array happening to be indexed by rcx would then result in
>
> mov eax, DWORD PTR rcx[rcx] # `movl rcx(%rcx), %eax`
>
> ? That's going to be confusing at best.
This is always confusing, no matter how it is written.
> I think this whole issue needs
> taking care of differently, and iirc I did already suggest an alternative
> in one of the bugzilla entries involved: Potentially ambiguous names
> (which to a compiler may mean: all symbol names) ought to simply be
> quoted, and it ought to be specified that quoted symbols are never
> registers. Iirc this will require gas changes, yes, but it'll address all
> ambiguities afaict.
The OP of GCC PR53929 said that 'the problem does _not_ go away even if I quote the symbol name by
hand in the assembly output' which was 12 years ago. I tried my local installation and quoting the
symbol turned out to avoid the issue:
> as --version
GNU assembler (GNU Binutils) 2.41.0.20240108
> cat test.s
.intel_syntax noprefix
lea rax, "bx"[rip]
> as test.s -o test.o
> objdump -d test.o
test.o: file format pe-x86-64
(...)
0: 48 8d 05 00 00 00 00 lea rax,[rip+0x0] # 7 <.text+0x7>
7: 90 nop
So I think I had better try my patch in the next few days.
--
Best regards,
LIU Hao
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
next prev parent reply other threads:[~2024-01-20 12:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-18 5:34 LIU Hao
2024-01-18 9:02 ` Fangrui Song
2024-01-18 12:54 ` Jan Beulich
2024-01-18 16:40 ` LIU Hao
2024-01-19 9:13 ` Jan Beulich
2024-01-20 12:40 ` LIU Hao [this message]
2024-01-22 8:39 ` Jan Beulich
2024-01-23 1:27 ` LIU Hao
2024-01-23 8:38 ` Jan Beulich
2024-01-23 9:00 ` LIU Hao
2024-01-23 9:03 ` Jan Beulich
2024-01-23 9:21 ` LIU Hao
2024-01-23 9:37 ` Jan Beulich
2024-01-30 4:22 ` Hans-Peter Nilsson
2024-01-31 10:11 ` LIU Hao
[not found] ` <DS7PR12MB5765DBF9500DE323DB4A8E29CB712@DS7PR12MB5765.namprd12.prod.outlook.com>
2024-01-19 1:42 ` LIU Hao
2024-01-19 7:41 ` Jan Beulich
2024-01-19 8:19 ` Fangrui Song
[not found] ` <DS7PR12MB5765654642BE3AD4C7F54E05CB702@DS7PR12MB5765.namprd12.prod.outlook.com>
2024-01-20 12:32 ` LIU Hao
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=b25d869e-c3a9-4a99-8c21-3fc181b33d89@126.com \
--to=lh_mouse@126.com \
--cc=binutils@sourceware.org \
--cc=gcc@gcc.gnu.org \
--cc=jbeulich@suse.com \
/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).