From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id 348DE3858412 for ; Mon, 22 Jan 2024 08:39:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 348DE3858412 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 348DE3858412 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::232 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705912765; cv=none; b=D0H0IXAKWrpxbdGtPFc+tj56v/zMRIrp+pCQWkXTbPNjZTVF2X7ZuIAzy63XTSa8FB+94gaVpnkkOXYNA1OpafJPWxZspDcAGnn/DXlojqtu7f0odMNnYVsgk2jlpGzOMbgLb/5cnBS9OO6v2ilaO+/HINylBYj8lSaoD2Ef934= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705912765; c=relaxed/simple; bh=t/w9wHQJIVDeAJcPUNbWBDQ2PSokynzjB8vGvjxvnQo=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=AvEx9V338oMCfOmJVZmLDyoOAi0qh2guVVkh7qMdN5eK/mUQ4/vFRJHE9CctCESFbdKBUg8/WepLdmwzAmpYaJjBWfnsf1t/DNfFFux3DIsIvh/XQVZfo8YnOmIJaoOskwiYGrgq5QEPVgV+TkHra1VPQVzRKH1cUubBsNGnkyI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2cdb50d8982so31183401fa.2 for ; Mon, 22 Jan 2024 00:39:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1705912745; x=1706517545; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=BhCrpXwZCRDA6zz9uoie57HxIlR44xab4T47MHAIC/Y=; b=PCg/8lKi3zhzn5vxHks+AN6lm8ZqFv0FObUJfAumOkZpFIHeQ6mmdZN/S668SC5VcN m2fuolQLbRJKX54f73K2VQ4F6/sEYS3weXIgaZbk+O+xv2a2nKN7crxL96SvOZ+uS5H0 /NZMpMN/+o6oWmkqSLQhXUwHuD7JkR9nuZ+npsT29zqTHUNFvNAxO8Xt3ifSmkw7PAPm y3DKwvqh7+V5Ca5c6BUjh2JOF33ZbLG6f8D9XIhCdKYyTlSTISVhceTeJaDHMpx/gJRA WBisNnEWwyFMxTNsDXVifSyf3vvcm5s0TjPby99YSj2FtQT3cAAhM9rWQByvNJlkzM5l NJXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705912745; x=1706517545; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BhCrpXwZCRDA6zz9uoie57HxIlR44xab4T47MHAIC/Y=; b=awh9bMW+UUpgx+AZNb4b8cLNozEQpfT5hdKZfF868rJY6b/BjJmAeuv9kCQYLXzl9p 914VOfawVPfzSKoqulqlb4vOzaXwahVEKo0uktBJIRJyuEoijGgbv+vgftpCvXLNH0+E jPumqMpz+3pEUni82eVzESAXIlXaIcah53dDvRWg4yV1Zp9NsQc8CNT6dg0h+BTUtC7I 6jCo0+b5lfMECuPZNbLh+YcZougMzmx29bCG1hRLOSLoWoulg/fIlnIY1kukhbB0yeK3 yqkI8OnLl05xKdIU4hTSU7E+0CXFkth6bNqgRvjkWpgVtVbcM2c2KW+L1LHfccV0Ef8y phkw== X-Gm-Message-State: AOJu0YxU+htQ4g5r2gMBXB3XHze8BVq9Tc2gNLNnNlV/u+s2JOztsOu7 EfSjm5GqlfpDZvQLoPixQW7M52nFQm3gXVD8o6PxVOnLO9PisgpUi6esGdx5Aw== X-Google-Smtp-Source: AGHT+IGjnQGO88l6gkBzQnQ3eOzb3k8+0lwzeUKfXDEsiH688KfzwysNs6s3OC9eEqPdXxfpWNhcFA== X-Received: by 2002:a2e:a713:0:b0:2cc:c7fb:ce0d with SMTP id s19-20020a2ea713000000b002ccc7fbce0dmr1233409lje.93.1705912744634; Mon, 22 Jan 2024 00:39:04 -0800 (PST) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id f11-20020a02a80b000000b0046e3e31bae8sm2959827jaj.101.2024.01.22.00.39.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Jan 2024 00:39:04 -0800 (PST) Message-ID: <1999d6bb-757f-41f4-ad8c-e2d54d14ee4b@suse.com> Date: Mon, 22 Jan 2024 09:39:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: RFC: Formalization of the Intel assembly syntax (PR53929) Content-Language: en-US To: LIU Hao Cc: binutils@sourceware.org, GCC Development References: <95e373fb-24f3-4b10-9ad1-948597ed9d67@suse.com> <40ae7cb2-c094-4594-859d-470e7a7fce49@126.com> <112d6607-3f35-4679-9ba8-d9257d2d20c7@suse.com> From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0Nymi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D12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3025.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 20.01.2024 13:40, LIU Hao wrote: > 在 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 Right, I did some work in that direction a while ago. But iirc there are still cases left to be addressed. Jan