From patchwork Fri Apr 12 07:08:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filip Kastl X-Patchwork-Id: 1922876 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=uE0p7moo; dkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=9HEpANX4; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=uE0p7moo; dkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=9HEpANX4; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VG72g37tRz1yYP for ; Fri, 12 Apr 2024 17:08:42 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D45AB3849AF8 for ; Fri, 12 Apr 2024 07:08:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id 359FF385842C for ; Fri, 12 Apr 2024 07:08:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 359FF385842C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 359FF385842C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712905705; cv=none; b=V8SbIwzxKaTtJlKfNf22VYXUDKpspKhbPKSypFwq8JK7ufN2X9BvBYPDMfft/+tZEA2lTGpYT7li+VIS0iEXejjSfGPWG8YU8RNvOlllfC/tQWqzVSes0M0b13O0qnU2BuOfuTSbxBGkFJ2UdFgTOVDbfQlkkjImJ7vhxkpmM7U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712905705; c=relaxed/simple; bh=WZMZ5IzkFp8aIoFsxJHIwoMApfUVOgWS3zXZZri1804=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:Message-ID:MIME-Version; b=k5nJiAzkSwreNW1OhZ3Q6y68h/qgefRBcMMEhYE2eUs8dOl9eHn68oX9t3P6AqydlgOltODqUaJ42b1io61Nx2ronTxbPJRzOtQ6TBrjMlauJv/C/XReaS8sToAoMgaMjsOqsdmmVM+2gWohEXu+RqNnepKjf+sTk19TDzPu2F4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 91D2F37F92; Fri, 12 Apr 2024 07:08:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1712905701; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sAtUb9zrgA0WD8zGDE1Lcj5wR7uJdXrnL0RSXDYCZLs=; b=uE0p7moosD8or+/AnA/jZcSKGCMKRrSBpVBUvD1NAv4i/rjQIAazNbNlInIh9GQ099gPDU SsW8quHbPQzdYGzyuGBxE/lzkRBUliGnXa9NIxEj9pE0xsvfog+wzGa+rbcCwxDiQ3BaJQ m2tcs5g6gS7PDar5E0aq8NU6AH1rnPQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1712905701; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sAtUb9zrgA0WD8zGDE1Lcj5wR7uJdXrnL0RSXDYCZLs=; b=9HEpANX4sP9ue6RXjar3/cz2cTvd1yNOWUXW2oV3wu0WEjjm4QxIdzVPg9HnFqJtydzRUN jWyQssUOCxDALqAg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1712905701; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sAtUb9zrgA0WD8zGDE1Lcj5wR7uJdXrnL0RSXDYCZLs=; b=uE0p7moosD8or+/AnA/jZcSKGCMKRrSBpVBUvD1NAv4i/rjQIAazNbNlInIh9GQ099gPDU SsW8quHbPQzdYGzyuGBxE/lzkRBUliGnXa9NIxEj9pE0xsvfog+wzGa+rbcCwxDiQ3BaJQ m2tcs5g6gS7PDar5E0aq8NU6AH1rnPQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1712905701; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sAtUb9zrgA0WD8zGDE1Lcj5wR7uJdXrnL0RSXDYCZLs=; b=9HEpANX4sP9ue6RXjar3/cz2cTvd1yNOWUXW2oV3wu0WEjjm4QxIdzVPg9HnFqJtydzRUN jWyQssUOCxDALqAg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 8628313942; Fri, 12 Apr 2024 07:08:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id K+0sIOXdGGYxYwAAD6G6ig (envelope-from ); Fri, 12 Apr 2024 07:08:21 +0000 Date: Fri, 12 Apr 2024 09:08:13 +0200 From: Filip Kastl To: Thomas Schwinge , Martin Jambor Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] contrib/check-params-in-docs.py: Ignore target-specific params Message-ID: References: <87ttkbmwx1.fsf@euler.schwinge.ddns.net> <87le5jenqs.fsf@euler.schwinge.ddns.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87le5jenqs.fsf@euler.schwinge.ddns.net> X-Spam-Score: -4.30 X-Spam-Level: X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.cz:email] X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org On Thu 2024-04-11 20:51:55, Thomas Schwinge wrote: > Hi! > > On 2024-04-11T19:52:51+0200, Martin Jambor wrote: > > contrib/check-params-in-docs.py is a script that checks that all > > options reported with ./gcc/xgcc -Bgcc --help=param are in > > gcc/doc/invoke.texi and vice versa. > > Eh, first time I'm hearing about this one! > > (a) Shouldn't this be running as part of the GCC build process? > > > gcn-preferred-vectorization-factor is in the manual but normally not > > reported by --help, probably because I do not have gcn offload > > configured. > > No, because you've not been building GCC for GCN target. ;-P > > > This patch makes the script silently about this particular > > fact. > > (b) Shouldn't we instead ignore any '--param's with "gcn" prefix, similar > to how that's done for "skip aarch64 params"? > > (c) ..., and shouldn't we likewise skip any "x86" ones? > > (d) ..., or in fact any target specific ones, following after the generic > section? (Easily achieved with a special marker in > 'gcc/doc/invoke.texi', just before: > > The following choices of @var{name} are available on AArch64 targets: > > ..., and adjusting the 'takewhile' in 'contrib/check-params-in-docs.py' > accordingly? Hi, I've made a patch to address (b), (c), (d). I didn't adjust takewhile. I chose to do it differently since target-specific params in both invoke.texi and --help=params have to be ignored. The downside of this patch is that the script won't complain if someone adds a target-specific param and doesn't document it. What do you think? Cheers, Filip -- 8< -- contrib/check-params-in-docs.py is a script that checks that all options reported with gcc --help=params are in gcc/doc/invoke.texi and vice versa. gcc/doc/invoke.texi lists target-specific params but gcc --help=params doesn't. This meant that the script would mistakenly complain about parms missing from --help=params. Previously, the script was just set to ignore aarch64 and gcn params which solved this issue only for x86. This patch sets the script to ignore all target-specific params. contrib/ChangeLog: * check-params-in-docs.py: Ignore target specific params. Signed-off-by: Filip Kastl --- contrib/check-params-in-docs.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/contrib/check-params-in-docs.py b/contrib/check-params-in-docs.py index f7879dd8e08..ccdb8d72169 100755 --- a/contrib/check-params-in-docs.py +++ b/contrib/check-params-in-docs.py @@ -38,6 +38,9 @@ def get_param_tuple(line): description = line[i:].strip() return (name, description) +def target_specific(param): + return param.split('-')[0] in ('aarch64', 'gcn', 'x86') + parser = argparse.ArgumentParser() parser.add_argument('texi_file') @@ -45,13 +48,16 @@ parser.add_argument('params_output') args = parser.parse_args() -ignored = {'logical-op-non-short-circuit', 'gcn-preferred-vectorization-factor'} -params = {} +ignored = {'logical-op-non-short-circuit'} +help_params = {} for line in open(args.params_output).readlines(): if line.startswith(' ' * 2) and not line.startswith(' ' * 8): r = get_param_tuple(line) - params[r[0]] = r[1] + help_params[r[0]] = r[1] + +# Skip target-specific params +help_params = [x for x in help_params.keys() if not target_specific(x)] # Find section in .texi manual with parameters texi = ([x.strip() for x in open(args.texi_file).readlines()]) @@ -66,14 +72,13 @@ for line in texi: texi_params.append(line[len(token):]) break -# skip digits +# Skip digits texi_params = [x for x in texi_params if not x[0].isdigit()] -# skip aarch64 params -texi_params = [x for x in texi_params if not x.startswith('aarch64')] -sorted_params = sorted(texi_params) +# Skip target-specific params +texi_params = [x for x in texi_params if not target_specific(x)] texi_set = set(texi_params) - ignored -params_set = set(params.keys()) - ignored +params_set = set(help_params) - ignored success = True extra = texi_set - params_set