From patchwork Tue Jul 11 13:37:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 786613 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3x6NSj26RXz9s0g for ; Tue, 11 Jul 2017 23:38:12 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="FMRfRWis"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; q=dns; s= default; b=bsSiDeMcJ+70dXf9wClQpRFPmZLV/WTNuQnvTIbwJTKgHzPqGtFLB xRin8ucNtdXBTVEoP+nNBrnN6O9LBBBJJYq/zd9hWXGYl6kBX7R+VHmJ6vgyCN1Y eo1kEQHfWsfKlakShYX8RJHUu0qVPvRMRfroz0WuVv2l/ea573SY8A= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=default; bh=8+yrcpK5S/F4O59eStcsT60WX3M=; b=FMRfRWisnNIkrrUU6lw5aK8JEXk6 eLSUs1RDB/zYGTMRjqrKC62gyRf5d10DUoORuNvju0POk4Jhk7hPAgHPJtenZgEM 7D+1r+wvTMx2eANJPGFtygYmIEgywzxWa2A2gp4EE8JgKluTKyntmr23W4yt24SO bJJZ93T8H6qLrMQ= Received: (qmail 117841 invoked by alias); 11 Jul 2017 13:38:02 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 116253 invoked by uid 89); 11 Jul 2017 13:38:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Jul 2017 13:37:59 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 901CEABD9; Tue, 11 Jul 2017 13:37:57 +0000 (UTC) Subject: Re: [PATCH v2][RFC] Canonize names of attributes. To: Jason Merrill Cc: Joseph Myers , gcc-patches List , Richard Biener References: <1856059e-e9b1-63d2-717f-e20ec171b329@suse.cz> <4cf00ee9-4cd7-1806-481f-966611768a15@suse.cz> <8a0b2ff0-50f9-771d-fb63-01d17cb06b46@suse.cz> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <669c960e-f4a8-eae3-efd2-f8c29477a817@suse.cz> Date: Tue, 11 Jul 2017 15:37:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: X-IsSubscribed: yes On 07/03/2017 11:00 PM, Jason Merrill wrote: > On Mon, Jul 3, 2017 at 5:52 AM, Martin Liška wrote: >> On 06/30/2017 09:34 PM, Jason Merrill wrote: >>> On Fri, Jun 30, 2017 at 5:23 AM, Martin Liška wrote: >>>> This is v2 of the patch, where just names of attributes are canonicalized. >>>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. >>> >>> What is the purpose of the new "strict" parameter to cmp_attribs* ? I >>> don't see any discussion of it. >> >> It's needed for arguments of attribute names, like: >> >> /usr/include/stdio.h:391:62: internal compiler error: in cmp_attribs, at tree.h:5523 >> __THROWNL __attribute__ ((__format__ (__printf__, 3, 4))); >> > > Mm. Although we don't want to automatically canonicalize all > identifier arguments to attributes in the parser, we could still do it > for specific attributes, e.g. in handle_format_attribute or > handle_mode_attribute. Yep, that was done in my previous version of the patch (https://gcc.gnu.org/ml/gcc-patches/2017-06/msg00996.html). Where only attribute that was preserved unchanged was 'cleanup': Does it work for you to do it so? Martin > > Jason > diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 8f638785e0e..08b4db5e5bd 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -24765,7 +24765,8 @@ cp_parser_gnu_attribute_list (cp_parser* parser) tree tv; if (arguments != NULL_TREE && ((tv = TREE_VALUE (arguments)) != NULL_TREE) - && TREE_CODE (tv) == IDENTIFIER_NODE) + && TREE_CODE (tv) == IDENTIFIER_NODE + && !id_equal (TREE_PURPOSE (attribute), "cleanup")) TREE_VALUE (arguments) = canonize_attr_name (tv); release_tree_vector (vec); }