From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55612 invoked by alias); 26 Jan 2016 23:38:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 55596 invoked by uid 89); 26 Jan 2016 23:38:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=escaped, H*r:esmtpa, H*RU:esmtpa, Hx-spam-relays-external:esmtpa X-HELO: bosmailout08.eigbox.net Received: from bosmailout08.eigbox.net (HELO bosmailout08.eigbox.net) (66.96.186.8) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 26 Jan 2016 23:38:31 +0000 Received: from bosmailscan07.eigbox.net ([10.20.15.7]) by bosmailout08.eigbox.net with esmtp (Exim) id 1aODBt-0003R4-Jx for gcc-patches@gcc.gnu.org; Tue, 26 Jan 2016 18:38:29 -0500 Received: from [10.115.3.33] (helo=bosimpout13) by bosmailscan07.eigbox.net with esmtp (Exim) id 1aODBt-0008Tj-Ie for gcc-patches@gcc.gnu.org; Tue, 26 Jan 2016 18:38:29 -0500 Received: from bosauthsmtp10.yourhostingaccount.com ([10.20.18.10]) by bosimpout13 with id AneQ1s0070D2CUy01neTPF; Tue, 26 Jan 2016 18:38:29 -0500 X-Authority-Analysis: v=2.1 cv=Wc+CaiRX c=1 sm=1 tr=0 a=Kpo39fPXdbgqDwiI3/AEUA==:117 a=sZx1nW7oDdbgogxTPqu5Xw==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=88b2x-oFWvEA:10 a=N659UExz7-8A:10 a=7aQ_Q-yQQ-AA:10 a=U6IibGSeZAujcwQOK1cA:9 a=pILNOxqGKmIA:10 Received: from [207.118.20.56] (port=50366 helo=[192.168.1.159]) by bosauthsmtp10.eigbox.net with esmtpa (Exim) id 1aODBn-0008Bh-UQ; Tue, 26 Jan 2016 18:38:24 -0500 Subject: Re: Wonly-top-basic-asm To: Segher Boessenkool , Bernd Schmidt References: <56A54EF9.8060006@LimeGreenSocks.com> <20160126002917.GA25851@gate.crashing.org> <56A76278.1090305@redhat.com> <20160126161131.GA17255@gate.crashing.org> Cc: "gcc-patches@gcc.gnu.org" , Richard Henderson , jason@redhat.com, sandra@codesourcery.com, Paul_Koning@Dell.com, Jeff Law , bernds_cb1@t-online.de, Bernd Edlinger , Andrew Haley From: David Wohlferd Message-ID: <56A80355.8000202@LimeGreenSocks.com> Date: Tue, 26 Jan 2016 23:38:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160126161131.GA17255@gate.crashing.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-EN-UserInfo: 97390230d6758ac7ebdf93f8c6197d31:931c98230c6409dcc37fa7e93b490c27 X-EN-AuthUser: dw@limegreensocks.com X-EN-OrigIP: 207.118.20.56 X-EN-OrigHost: unknown X-SW-Source: 2016-01/txt/msg02059.txt.bz2 On 1/26/2016 8:11 AM, Segher Boessenkool wrote: > On Tue, Jan 26, 2016 at 01:11:36PM +0100, Bernd Schmidt wrote: >> On 01/26/2016 01:29 AM, Segher Boessenkool wrote: >> >>> In my opinion we should not warn for any asm that means the same both >>> as basic and as extended asm. The problem then becomes, what *is* the >>> meaning of a basic asm, what does it clobber. >> I think this may be too hard to figure out in general without parsing >> the asm string, which we don't really want to do. > That depends on the semantics of basic asm. With the currently implemented > semantics, it is trivial. Oh? asm("cmp al, '#' # if (c == '#') {"); There's a '{', so it might look like it needs to be escaped, but it doesn't. The '{' is just part of a comment. And how do you know it's a comment? Because of the comment marker (#). And how do you know that it's a comment marker and not a literal? Only by doing more assembler parsing that I'm prepared to write. But more importantly, consider this MIPS statement: asm ("sync"); That is the same for both basic and extended. But I absolutely want the warning to flag this statement. This is exactly the kind of "broken" statement that people need to be able to find/fix right now. And when Jeff makes the changes to basic asm for v7, people may want to be able to find the statements that are affected by that in order to *stop* clobbering so many registers. I'm not clear what people would use this warning for if we made the change you are suggesting. dw