From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24709 invoked by alias); 22 Jun 2014 11:27:04 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 24655 invoked by uid 48); 22 Jun 2014 11:26:57 -0000 From: "harald at gigawatt dot nl" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/31782] Invalid assembly code on initial dollar signs Date: Sun, 22 Jun 2014 11:27:00 -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.1.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: harald at gigawatt dot nl X-Bugzilla-Status: UNCONFIRMED 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: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-06/txt/msg01743.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31782 --- Comment #7 from Harald van Dijk --- That's good to know. Trying some more, clang does manage to get even weirder symbol names right, because gas does have a form of quoting already, and clang makes use of it. int x __asm__(")"); int main() { return x; } With clang, this works. ... movl ")", %eax ... .type ")",@object # @")" .comm ")",4,4 ... If it's simpler to implement, then instead of parenthesising, $ could alternatively be treated as a symbol that needs quoting, which is a more general solution that will work for any possible symbol name.