From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 351C7385B50D; Thu, 4 May 2023 07:24:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 351C7385B50D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683185053; bh=NLDEAwh6fTM5o9/s9HnR2++7pXTWJ2gdNoIkgn4lUag=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bCfMlRBLQaBma60BToi2dlg38lLibDPAq3vUX8QmjbmsghV+jW+7uLDnxUrwnhiWY mh1MQFrgADrn7qCco7FxyMOMaZiScnw5qQ63qpe4Ncu9Ox2UPaaVkqP32OlPnj91Kp caosdr9+2cR+E3fl5HmyHouZ7af3YqWkA98L0CxY= From: "lh_mouse at 126 dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/53929] [meta-bug] -masm=intel with global symbol Date: Thu, 04 May 2023 07:24:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.6.3 X-Bugzilla-Keywords: assemble-failure, wrong-code X-Bugzilla-Severity: minor X-Bugzilla-Who: lh_mouse at 126 dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D53929 --- Comment #17 from LIU Hao --- Yeah. It looks to me like the Microsoft compiler doesn't actually uses the assembler (like LLVM). Given the C source: ``` extern int rax; int main() { return rax; } ``` which compiled without errors: ``` > cl /O2 /c test.c /Fatest.asm Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30148 for x64 Copyright (C) Microsoft Corporation. All rights reserved. test.c ``` and produced this assembly file ``` include listing.inc INCLUDELIB LIBCMT INCLUDELIB OLDNAMES PUBLIC main EXTRN rax:DWORD _TEXT SEGMENT main PROC ; COMDAT mov eax, DWORD PTR rax ret 0 main ENDP _TEXT ENDS END ``` which can't be assembled ``` > ml64 /c test.asm Microsoft (R) Macro Assembler (x64) Version 14.29.30148.0 Copyright (C) Microsoft Corporation. All rights reserved. Assembling: test.asm test.asm(9) : error A2008:syntax error : rax test.asm(16) : error A2032:invalid use of register ```=