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 5E4553858C50 for ; Mon, 22 Jan 2024 08:39:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5E4553858C50 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 5E4553858C50 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=Kg+AlX9NQeqXeztVUpExZlOfXVLdvD2NPptq+E6hSHwVH6L//H8L3QvHAF1YEzeMIfrbVv8H/Y8gA0CrydAqW7Hyo15LR/voRSYb8EpnbEYoN0Uwi+tqXDAZ7RS0kMkEG0T/ej93IC7f9ak1dyxFt/JY6WRX/IdTKGCTi6DLvwg= 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=RDmVIL1lCaTcqtPSHWRISu3mjGmCAte86IwlfIS5BaVTYjqK0mDzjzB610RREi7FmfvdZPmmGBBt+pixBX1Ulgwodh4NRQMSBnbsEjxuPV/UzEgGqqSdgvNRG8DpVw/6p6noLTkcRkjJIbKraCumWcdvUKqdbe5ogDokxrbXjBQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2cdeb808889so30575681fa.3 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=gcc.gnu.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=f2EgyYJxdt0yWAEgw9bvH6ObtoTqxW+cZJZw64FwonOEEm7fpQvBtg8aUWUI58hJ9j qjABoCtc5VbI2JRK8LpRSUEhm1xe4omh9uKpZsfQ/uXk8Ui/QGlPqvspD+fHNkrNkQJa oPoaKVrYWsbaSioZveMf6c50T43gIiUYgd/kTwkzMWQvYoaWePQjkVUC7rYu4wXsSqou IiVYUqARLhLYP0PMY6qWzJVbD/cVvIPsHKqwIPHSfqxF1dV3JLQvmlx1atnWsIHe7KOB uJ5rsZZ6gE+fkjLUXM0hI9r9w1JBHvQ3o6j4tjqnZoVfD9AMHnubyZpMesgXE6n2xX/1 rQfg== 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=Nv4JGGlX6GxxXTsXzgbt+GlsjhIJQ/OCHIRfUVgBpxgcYKs/Y41hmdrKfbr83BC5CZ c2UAD/QsCyfZjRGKSzXMwFpAGGS0mypWXNHC+l/zi7HHGq7G3L67G+E9G0F+NMf20/vv mn2TdhhO2smNdNIKtNo/jKt/X02Ai/RT/tUC6GsQnqwSfccoRbKYFPIhaQFvJ/7tbCG8 mxoSYQcsLd2wtzBfZJ1k+Is4+Kgj/WafiHswMofhTcJd+1mmqwDl6AM4vCviAptSLXek ymtTIk7/vw0nvxgDvA56S6DS5DP+ale1x+4Y8JTll5nep0JHmSv+zXbo8HzhOMk9KIwi tiPg== X-Gm-Message-State: AOJu0YxXR0lyPL/0CdOJJBvqrXC/HWWRvJsh85VIYPv0ky4hYf9Y5ZAa ecTEC095yDX9x8s8wKcxewGq56ip+oEmAbL2HYfIqqfKaSDWLxYi54pdFJTxMQ== 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 /0tbFCzD2h20ahe8rC1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qTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/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