From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122098 invoked by alias); 30 Apr 2019 15:14:03 -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 121685 invoked by uid 89); 30 Apr 2019 15:14:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-4.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=sebor, Sebor, 20190418 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 Apr 2019 15:14:01 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 162F081104; Tue, 30 Apr 2019 15:14:00 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-43.rdu2.redhat.com [10.10.112.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E63C6D09C; Tue, 30 Apr 2019 15:13:58 +0000 (UTC) Subject: Re: [PATCH][stage1] Enhance target and target_clone error messages. To: =?UTF-8?Q?Martin_Li=c5=a1ka?= , Martin Sebor , gcc-patches@gcc.gnu.org References: <12a429b7-422f-7397-49ce-c05ae20efc99@suse.cz> From: Jeff Law Openpgp: preference=signencrypt Message-ID: <16d4966d-1786-6a7d-0869-4db4e2f3bee9@redhat.com> Date: Tue, 30 Apr 2019 15:15:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <12a429b7-422f-7397-49ce-c05ae20efc99@suse.cz> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-04/txt/msg01247.txt.bz2 On 4/23/19 4:06 AM, Martin Liška wrote: > On 4/19/19 2:28 AM, Martin Sebor wrote: >> On 4/18/19 5:09 AM, Martin Liška wrote: >>> Hi. >>> >>> The patch distinguishes among target and target_clone attribute when >>> reporting for an error. I've also reworded the affected error messages >>> a bit. >>> >>> Patch can bootstrap on x86_64-linux-gnu and survives regression tests. >>> >>> Ready to be installed after stage1 opens? >>> Thanks, >>> Martin >>> >>> --- >>>   gcc/cgraphclones.c                         |  2 +- >>>   gcc/config/i386/i386-c.c                   |  5 +- >>>   gcc/config/i386/i386-protos.h              |  4 +- >>>   gcc/config/i386/i386.c                     | 54 +++++++++++++--------- >>>   gcc/testsuite/gcc.target/i386/funcspec-4.c |  2 +- >>>   5 files changed, 39 insertions(+), 28 deletions(-) >> Just a suggestion to also consider making the phrasing in the messages >> consistent by adding "is" below >> >> @@ -5316,7 +5322,7 @@ ix86_valid_target_attribute_inner_p (tree args, char *p_strings[], >> >>    else if (TREE_CODE (args) != STRING_CST) >>      { >> -      error ("attribute % argument not a string"); >> +      error_at (loc, "attribute %qs argument not a string", attr_name); >>        return false; >> >> i.e., "is not a string" and changing the below >> >> @@ -5382,7 +5386,8 @@ ix86_valid_target_attribute_inner_p (tree args, char *p_strings[], >>        /* Process the option.  */ >>        if (opt == N_OPTS) >>      { >> -      error ("attribute(target(\"%s\")) is unknown", orig_p); >> +      error_at (loc, "attribute value %qs is unknown in %qs attribute", >> +            orig_p, attr_name); >> >> to >> >>   error_at (loc, "attribute %qs argument %qs is unknown", >>             attr_name, orig_p); >> >> Martin > Thank you Martin. I'm sending updated patch. > > Martin > > > 0001-Enhance-target-and-target_clone-error-messages.patch > > From 2778f9ab4f1cd091780694e8cc1335d6125d95ec Mon Sep 17 00:00:00 2001 > From: marxin > Date: Wed, 17 Apr 2019 13:59:14 +0200 > Subject: [PATCH] Enhance target and target_clone error messages. > > gcc/ChangeLog: > > 2019-04-18 Martin Liska > > * cgraphclones.c: Call valid_attribute_p with 1 for > target_clone. > * config/i386/i386-c.c (ix86_pragma_target_parse): Use 0 as > it's for target attribute. > * config/i386/i386-protos.h (ix86_valid_target_attribute_tree): > Add new boolean argument. > * config/i386/i386.c (ix86_valid_target_attribute_inner_p): > Likewise. > (ix86_valid_target_attribute_tree): Pass target_clone_attr > to ix86_valid_target_attribute_inner_p. > (ix86_valid_target_attribute_p): Pass flags argument to > ix86_valid_target_attribute_inner_p. > (get_builtin_code_for_version): Use 0 as it's target attribute. > > gcc/testsuite/ChangeLog: > > 2019-04-18 Martin Liska > > * gcc.target/i386/funcspec-4.c: Update scanned pattern. > * g++.target/i386/pr57362.C: Likewise. OK Jeff