From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108405 invoked by alias); 7 Mar 2019 21:20:21 -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 108380 invoked by uid 89); 7 Mar 2019 21:20:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-it1-f193.google.com Received: from mail-it1-f193.google.com (HELO mail-it1-f193.google.com) (209.85.166.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 07 Mar 2019 21:20:18 +0000 Received: by mail-it1-f193.google.com with SMTP id z131so17646389itf.5 for ; Thu, 07 Mar 2019 13:20:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4Jpt8eGR7s6Pdh6jSzXXRkH7cLCBNAbS7T8hKSoscPo=; b=FmikhFRPvBF187Gf8N9t/dk2cmUBh+VVcg+sY0ewRybWhlx/oprkfE+6CZNI28OEZS +D/uT5UXE2F8VIqYFoSnhCOASpJqtg2gl6zcYs9AUmz4tBnGolBSh+xVRzKHSffF0eKp O0gefw3RhD8sBMI28EPyHV4nxGWoCKYS+wiWRH/hTXuwWSrkE0r7IDLstxEeFW4WQtM8 3X6gowMjtyfABxfqvcomVoY3jwc/Dj8/DdtfRE5vTD383+TsMuqtCGGmD2bF6EJ8S8K9 rP/WRIrYWnErueTLTaQk3tQyvuNXiRCjMNCyDPf8LcLJb4eDqdSMmW9uEz7i43MFAlih bR+A== MIME-Version: 1.0 References: <20190307194508.GG7611@tucnak> In-Reply-To: <20190307194508.GG7611@tucnak> From: Uros Bizjak Date: Thu, 07 Mar 2019 21:22:00 -0000 Message-ID: Subject: Re: [PATCH] Diagnostic fixes for config/i386/i386.c (PR target/80003) To: Jakub Jelinek Cc: "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2019-03/txt/msg00335.txt.bz2 On Thu, Mar 7, 2019 at 8:45 PM Jakub Jelinek wrote: > > Hi! > > The following patch fixes a couple of issues in i386.c diagnostics. > > In particular, diagnostics emitted to the user (not in dump files) > should not start with a capital letter unless it is something that > starts with capital letter in a middle of a sentence, and should not end > with a period. The ix86_handle_interrupt_attribute hunk is also something > the translators requested, the wording has been composed in a weird way > from portions of a keyword in the message and portions from (untranslated) > strings, the change surrounds it with quotes and makes the whole type name > come from untranslated string literal. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > 2019-03-07 Jakub Jelinek > > PR target/80003 > * config/i386/i386.c (ix86_set_func_type): Make sure diagnostics > doesn't start with a capital letter and doesn't end with a dot. > (ix86_function_arg_boundary): Make sure diagnostics doesn't start > with a capital letter. > (ix86_mangle_function_version_assembler_name): Likewise. > (ix86_generate_version_dispatcher_body): Likewise. > (fold_builtin_cpu): Likewise. > (get_builtin_code_for_version): Likewise. Remove extraneous space. > (ix86_handle_interrupt_attribute): Make the diagnostics easier for > translators, wrap full type name in %qs. > > * gcc.target/i386/pr68657.c: Adjust expected diagnostics wording. > * gcc.target/i386/interrupt-6.c: Likewise. > * g++.target/i386/pr57362.C: Adjust capitalization in dg-prune-output. LGTM. Thanks, Uros. > --- gcc/config/i386/i386.c.jj 2019-02-28 21:48:51.662326676 +0100 > +++ gcc/config/i386/i386.c 2019-03-07 17:22:43.787842967 +0100 > @@ -5800,8 +5800,8 @@ ix86_set_func_type (tree fndecl) > > /* Only dwarf2out.c can handle -WORD(AP) as a pointer argument. */ > if (write_symbols != NO_DEBUG && write_symbols != DWARF2_DEBUG) > - sorry ("Only DWARF debug format is supported for interrupt " > - "service routine."); > + sorry ("only DWARF debug format is supported for interrupt " > + "service routine"); > } > else > { > @@ -9069,7 +9069,7 @@ ix86_function_arg_boundary (machine_mode > { > warned = true; > inform (input_location, > - "The ABI for passing parameters with %d-byte" > + "the ABI for passing parameters with %d-byte" > " alignment has changed in GCC 4.6", > align / BITS_PER_UNIT); > } > @@ -32116,7 +32116,7 @@ get_builtin_code_for_version (tree decl, > if (predicate_list && arg_str == NULL) > { > error_at (DECL_SOURCE_LOCATION (decl), > - "No dispatcher found for the versioning attributes"); > + "no dispatcher found for the versioning attributes"); > return 0; > } > > @@ -32166,7 +32166,7 @@ get_builtin_code_for_version (tree decl, > if (predicate_list && i == NUM_FEATURES) > { > error_at (DECL_SOURCE_LOCATION (decl), > - "No dispatcher found for %s", token); > + "no dispatcher found for %s", token); > return 0; > } > token = strtok (NULL, ","); > @@ -32176,7 +32176,7 @@ get_builtin_code_for_version (tree decl, > if (predicate_list && predicate_chain == NULL_TREE) > { > error_at (DECL_SOURCE_LOCATION (decl), > - "No dispatcher found for the versioning attributes : %s", > + "no dispatcher found for the versioning attributes: %s", > attrs_str); > return 0; > } > @@ -32338,12 +32338,12 @@ ix86_mangle_function_version_assembler_n > && lookup_attribute ("gnu_inline", > DECL_ATTRIBUTES (decl))) > error_at (DECL_SOURCE_LOCATION (decl), > - "Function versions cannot be marked as gnu_inline," > + "function versions cannot be marked as gnu_inline," > " bodies have to be generated"); > > if (DECL_VIRTUAL_P (decl) > || DECL_VINDEX (decl)) > - sorry ("Virtual function multiversioning not supported"); > + sorry ("virtual function multiversioning not supported"); > > version_attr = lookup_attribute ("target", DECL_ATTRIBUTES (decl)); > > @@ -32619,7 +32619,7 @@ ix86_generate_version_dispatcher_body (v > virtual methods in base classes but are not explicitly marked as > virtual. */ > if (DECL_VINDEX (versn->decl)) > - sorry ("Virtual function multiversioning not supported"); > + sorry ("virtual function multiversioning not supported"); > > fn_ver_vec.safe_push (versn->decl); > } > @@ -32898,7 +32898,7 @@ fold_builtin_cpu (tree fndecl, tree *arg > STRING_CST. */ > if (!EXPR_P (param_string_cst)) > { > - error ("Parameter to builtin must be a string constant or literal"); > + error ("parameter to builtin must be a string constant or literal"); > return integer_zero_node; > } > param_string_cst = TREE_OPERAND (EXPR_CHECK (param_string_cst), 0); > @@ -32923,7 +32923,7 @@ fold_builtin_cpu (tree fndecl, tree *arg > > if (i == NUM_ARCH_NAMES) > { > - error ("Parameter to builtin not valid: %s", > + error ("parameter to builtin not valid: %s", > TREE_STRING_POINTER (param_string_cst)); > return integer_zero_node; > } > @@ -32973,7 +32973,7 @@ fold_builtin_cpu (tree fndecl, tree *arg > > if (i == NUM_ISA_NAMES) > { > - error ("Parameter to builtin not valid: %s", > + error ("parameter to builtin not valid: %s", > TREE_STRING_POINTER (param_string_cst)); > return integer_zero_node; > } > @@ -41417,11 +41417,12 @@ ix86_handle_interrupt_attribute (tree *n > { > if (TREE_CODE (TREE_VALUE (current_arg_type)) != INTEGER_TYPE > || TYPE_MODE (TREE_VALUE (current_arg_type)) != word_mode) > - error ("interrupt service routine should have unsigned %s" > - "int as the second argument", > + error ("interrupt service routine should have %qs " > + "as the second argument", > TARGET_64BIT > - ? (TARGET_X32 ? "long long " : "long ") > - : ""); > + ? (TARGET_X32 ? "unsigned long long int" > + : "unsigned long int") > + : "unsigned int"); > } > nargs++; > current_arg_type = TREE_CHAIN (current_arg_type); > --- gcc/testsuite/gcc.target/i386/pr68657.c.jj 2017-05-05 09:19:48.916719767 +0200 > +++ gcc/testsuite/gcc.target/i386/pr68657.c 2019-03-07 18:35:13.568961336 +0100 > @@ -4,7 +4,7 @@ > typedef int V __attribute__((vector_size (64))); > > void foo (V x, V *y) { /* { dg-error "AVX512F vector argument without AVX512F enabled" } */ > - /* { dg-message "The ABI for passing parameters with 64-byte alignment has changed" "" { target *-*-* } .-1 } */ > + /* { dg-message "the ABI for passing parameters with 64-byte alignment has changed" "" { target *-*-* } .-1 } */ > *y = x; > } > > --- gcc/testsuite/gcc.target/i386/interrupt-6.c.jj 2016-06-03 21:25:13.165722883 +0200 > +++ gcc/testsuite/gcc.target/i386/interrupt-6.c 2019-03-07 18:36:01.519179045 +0100 > @@ -8,7 +8,7 @@ extern int error; > __attribute__((interrupt)) > void > fn1 (void *p, short error_code) > -{ /* { dg-error "interrupt service routine should have unsigned \(long long |long |\)int as the second argument" } */ > +{ /* { dg-error "interrupt service routine should have 'unsigned \(long long |long |\)int' as the second argument" } */ > } > > __attribute__((interrupt)) > --- gcc/testsuite/g++.target/i386/pr57362.C.jj 2018-11-20 21:39:05.211507660 +0100 > +++ gcc/testsuite/g++.target/i386/pr57362.C 2019-03-07 18:37:48.892427289 +0100 > @@ -199,4 +199,4 @@ int foo(void) { return 1; } > /* { dg-prune-output "attribute.* is unknown" } */ > /* { dg-prune-output "missing 'target' attribute*" } */ > /* { dg-prune-output "redefinition of 'int foo" } */ > -/* { dg-prune-output "No dispatcher found for" } */ > +/* { dg-prune-output "no dispatcher found for" } */ > > Jakub