From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121841 invoked by alias); 30 Nov 2018 00:03:35 -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 121829 invoked by uid 89); 30 Nov 2018 00:03:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Nov 2018 00:03:33 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id wAU03942029125; Thu, 29 Nov 2018 18:03:17 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id wATNdsOG027426; Thu, 29 Nov 2018 17:39:54 -0600 Date: Fri, 30 Nov 2018 00:03:00 -0000 From: Segher Boessenkool To: Joseph Myers Cc: gcc-patches@gcc.gnu.org, jakub@redhat.com, polacek@redhat.com, jason@redhat.com, nathan@acm.org Subject: Re: [PATCH 1/2] asm qualifiers (PR55681) Message-ID: <20181129233952.GP23873@gate.crashing.org> References: <20181129133505.GZ23873@gate.crashing.org> <20181129222221.GM23873@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg02519.txt.bz2 On Thu, Nov 29, 2018 at 11:14:45PM +0000, Joseph Myers wrote: > On Thu, 29 Nov 2018, Segher Boessenkool wrote: > > > > What's the basis for allowing duplicates for C but not for C++? > > > > It is the status quo. It would make sense to allow duplicates for C++ as > > well, sure. If that is preferred I can make a patch for it? > > Duplicate qualifiers are allowed *in declarations* for C (as per C99). And I used type-qualifier-list[opt] there, to start with. > They aren't allowed in asm. I'd think the most obvious thing would be not > to allow duplicate qualifiers in asm at all (but still allow any ordering > of volatile, goto and inline). Essentially, the use in asm is just > reusing a keyword in a different context, so I don't think duplicates > being allowed in declarations is relevant to allowing them in asm (any > more than it indicates that __attribute__ ((const const const)) should be > allowed just because const is a valid attribute). So "asm const restrict" is allowed, but "asm const const restrict" isn't. Hrm. That means we'll have to keep track of the ignored qualifiers. (There aren't any ignored asm qualifiers in C++ so no such issue there). What do you want done with const and restrict (and _Atomic, which is allowed by the current grammar)? Segher