From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id 080DF3858C2D for ; Tue, 3 Oct 2023 20:22:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 080DF3858C2D Authentication-Results: sourceware.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cloud.com Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40535597f01so13470375e9.3 for ; Tue, 03 Oct 2023 13:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1696364558; x=1696969358; darn=sourceware.org; h=content-transfer-encoding:autocrypt:subject:from:content-language :to:user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=FBFTVq2QghXO/AiCPeeVk9fAX2BtODrb+crmaOO+/VU=; b=WWRukiF7P6t0It9PIEiPjeAPS4/BKKiFuqM1jhDPOWhUZOZkb97pBORtS+e2cypzMT BJm8GFJqKfNMJVNoUXjmXDUq4JcGJgtv2q9lvcM3jknVCeo7H1GAyBSBZ1mAwzrE3xaR nGjDU6yJcg4X6JptSdf0GYD0vaVItowLQbK5Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696364558; x=1696969358; h=content-transfer-encoding:autocrypt:subject:from:content-language :to:user-agent:mime-version:date:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=FBFTVq2QghXO/AiCPeeVk9fAX2BtODrb+crmaOO+/VU=; b=N8eKWWUpmY2XApRfPws93J7CgSTc5i0KwX3A3kP2q04Cd3GlIr6VGi5grOgU9xIFW1 dvuVi8hjPCID2rTcUqPjmFhHrXPRaE4o6FV9SV5gkvkYEr0Mp65VV1GpkWj0tKeRbGpr w6gZS9kGPbwLSgz7nAUjIN7rT43ykczwl04RjWgJuYlQvMLfpmhH4zldzGeNG1h4s+dJ MPI7bq9zWatteSbWnqtiL7YEtqUMsde35nLAyAehy6tzht7eIxaQAu+a8jEjOWT2t9UP Qi5QzNEHlbC3mz+pOdGlfs2QlMiJcFA9H+h12il8ZZhduo1asBcmQbpb/xthiJtIp27p zh7Q== X-Gm-Message-State: AOJu0YwGmINCdCvNI7kngoRmthOmt1iu3CH8DrX4MWqyan2Tnc1h0c6V NxkQEJDZbdtz3iqmohHdSADYt+nQPnxu+2hzlvbTsw== X-Google-Smtp-Source: AGHT+IFLdTjm2/m51YFLuDZv7mLGf3UzdQF5hgGlUsxSWwp4RSu04FRbq5tw0OZU2IbGtrZmQSfZAg== X-Received: by 2002:adf:fc47:0:b0:319:62e0:f2fe with SMTP id e7-20020adffc47000000b0031962e0f2femr259683wrs.36.1696364558450; Tue, 03 Oct 2023 13:22:38 -0700 (PDT) Received: from [10.80.67.28] (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id r3-20020adff703000000b00326b8a0e817sm2298888wrp.84.2023.10.03.13.22.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Oct 2023 13:22:38 -0700 (PDT) Message-ID: <97ff5740-5e46-488f-bd08-2d653dfe09b6@citrix.com> Date: Tue, 3 Oct 2023 21:22:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: binutils@sourceware.org, tdevries@suse.de, "H.J. Lu" , Jan Beulich Content-Language: en-GB From: Andrew Cooper Subject: Regression: operand size mismatch for `push' Autocrypt: addr=andrew.cooper3@citrix.com; keydata= xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn srM1oPXWRic8BIAdYOKOlo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VQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs 6+ahAA== Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello, I think this is related to https://sourceware.org/bugzilla/show_bug.cgi?id=30928 but I can't bisect myself.  It did regress between 2.39 and 2.41 $ /local/bin/bin-2.39/bin/as push.S -o push.o $ /local/bin/bin-2.41/bin/as push.S -o push.o push.S: Assembler messages: push.S:5: Error: operand size mismatch for `push' $ cat push.S         .text         .code64 code64:         push $0         push $1f 1:         .code32 code32:         push $0         push $1f 1: Using `push` without an explicit suffix is important for writing bitness-agnostic assembly.  Right now, 2.41's complains are asymmetric, insisting on a q suffix in 64bit code while not insisting on an l suffix in 32bit code. For stack operations, there is always a default operand size (from the operating mode), which is always the one the programmer wants, given no indication to the contrary. The push $imm forms are a little weird.  Stack operations in x86 have an operand size from 16, 32 or 64 (with 64 and 32 un-encodable in each others mode). The 6a (push $imm8) and 68 (push $imm) encodings look like a byte/non-byte pair, but do not follow the normal operand size rules.  As such, the use of the wlq suffixes go wrong. The only way of encoding the $imm16 form is via the 66 prefix or w suffix, which changes the operand size to 16 and also misaligns the stack pointer.  The l or q suffixes (which result in no prefix) retain the default operand size, and apply equally to the byte and non-byte forms. Despite experimenting, I can't find a way of spelling `push $0` that results in the 68 00 00 00 00 form.  push.d32 does silence the suffix warning, but neither .d32 nor .d8 force the 1 or 4 byte immediate forms.  The form chosen is always based on range, unless there's a relocation in which case the $imm32 form is used. This is clearly a tangled part of parsing, but insisting on a q suffix when the operand size is unambiguous does adversely impact existing code, and the fact that an l suffix is not insisted upon suggests that this was an oversight rather than an intentional change in behaviour. Thanks, ~Andrew