From patchwork Wed Nov 9 13:41:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 17546 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp339436wru; Wed, 9 Nov 2022 05:42:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf5tg1eqbxFOGjBHNRjHaFr+EY2b0t0CdhVzHARiDbcsvfIcQSoP6q9SpmC/geFINk13uyRE X-Received: by 2002:a17:907:78b:b0:741:3d29:33d2 with SMTP id xd11-20020a170907078b00b007413d2933d2mr3104041ejb.103.1668001323727; Wed, 09 Nov 2022 05:42:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668001323; cv=none; d=google.com; s=arc-20160816; b=pkIXpTJLsXO1/OVdiEmofHCWt4/iWKfk7Z07CYqwxUENByKLH3YZEXtZLd1DL49rEa qUGaJgd9NSetFHUQTXBIjGr1OhzvrsUX9l/RtCVJ/2OL7aCL7HfxUcmU48RRgaQ350C1 Cqeq6414DYhMSCdh1/YUV4NndbacYBAARQMsQpA+v171/cDWMh+Www7+QZc5H7/ezEuN gUF9qnHxSAN+/VJTC9Vc4hqzQlNbc8shNRoQIvtjbeGvSb7bVRK6jnO9f03W9ahRy33y 0d3EphpGfLiyQZJgstv/Gx4i+g9GDI8tKLoopG5eVc+pXgUV6hNUweKe/yG80bijCClm Rmaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding:cc :content-language:to:subject:from:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature:dmarc-filter:delivered-to; bh=u6gALJdQsklfezqH8HkgCgYcgVQhj8OkprBnV3T5VyA=; b=TRQBshmB59g1qFtpzUSvRTvA7DXVacqATEFfvAUQ6vcQVJo4h4VXCysrZYl8TDq/94 vyIEucCcGvfcOj3j0EbluvCfb/gslfD+JDZfxnQ6I6Dj/zQ0YFJu91MTDmYQTKLAYM8W JytRzFO8uYtCkAzml6xC3E39Ct8tM1VoUfkJfSJUP6RVSLzVDHbMZTUk55fY6uz4vXXm 9v6d8Eeuy3HEFTyXZEw9eKq37VVRCZeM0crxBK8fNg2SxPchwBtV1OGiLw6xoKU90K6z lLH1wLoOLdP6SE6xaawEx06T34FGuFgE4HM/ozuvju6J1eMpB1mcjJHr+eMRqI4INGXD JE+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Ztlseqhz; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=Qj9ZHC+4; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q17-20020aa7da91000000b0046187ab5c1bsi13267709eds.512.2022.11.09.05.42.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 05:42:03 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Ztlseqhz; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=Qj9ZHC+4; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 582A83853573 for ; Wed, 9 Nov 2022 13:41:56 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id C42343858D35 for ; Wed, 9 Nov 2022 13:41:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C42343858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B77F31FA23; Wed, 9 Nov 2022 13:41:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1668001289; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u6gALJdQsklfezqH8HkgCgYcgVQhj8OkprBnV3T5VyA=; b=ZtlseqhzsTYgqi0vD22Kfi0pTlOgrCg7wK7jLaKvPcpR/ckxxrBz5piLt9AOWozdxxEnd7 azc4Dmqvj6zV0hIAZAF7Acw+FOxiokkkfxnhul70cNeXi9p8zu/EBdriL/5SlKnYA/uanv 4m0s8arcOgNf4LdMkOxTvh4CWuZSs7s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1668001289; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u6gALJdQsklfezqH8HkgCgYcgVQhj8OkprBnV3T5VyA=; b=Qj9ZHC+4eobrV6vIzKsz7n8SCpTtduAGeqN0RYxPraji5dgne8nhcE7oEwf4fBS5MQdlip QgE4C6EmPoPt3UBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 948EB1331F; Wed, 9 Nov 2022 13:41:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id x6VRIAmua2MmDgAAMHmgww (envelope-from ); Wed, 09 Nov 2022 13:41:29 +0000 Message-ID: Date: Wed, 9 Nov 2022 14:41:27 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] changelog: check for space after tab To: gcc-patches@gcc.gnu.org Content-Language: en-US Cc: Jakub Jelinek X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_SOFTFAIL, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749026155963674593?= X-GMAIL-MSGID: =?utf-8?q?1749026155963674593?= Will install if there are not comments. Martin contrib/ChangeLog: * gcc-changelog/git_commit.py: Check for a space after leading tab. * gcc-changelog/test_email.py: Likewise. * gcc-changelog/test_patches.txt: Likewise. --- contrib/gcc-changelog/git_commit.py | 8 ++++++ contrib/gcc-changelog/test_email.py | 4 +++ contrib/gcc-changelog/test_patches.txt | 39 ++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py index 1f6e1920829..3bd671011f2 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -365,6 +365,7 @@ class GitCommit: self.check_for_broken_parentheses() self.deduce_changelog_locations() self.check_file_patterns() + self.check_line_start() if not self.errors: self.check_mentioned_files() self.check_for_correct_changelog() @@ -613,6 +614,13 @@ class GitCommit: msg = 'bad parentheses wrapping' self.errors.append(Error(msg, entry.parentheses_stack[-1])) + def check_line_start(self): + for entry in self.changelog_entries: + for line in entry.lines: + if line.startswith('\t '): + msg = 'extra space after tab' + self.errors.append(Error(msg, line)) + def get_file_changelog_location(self, changelog_file): for file in self.info.modified_files: if file[0] == changelog_file: diff --git a/contrib/gcc-changelog/test_email.py b/contrib/gcc-changelog/test_email.py index c56f6da513a..d0de88cf562 100755 --- a/contrib/gcc-changelog/test_email.py +++ b/contrib/gcc-changelog/test_email.py @@ -451,3 +451,7 @@ class TestGccChangelog(unittest.TestCase): email = self.from_patch_glob('toplev-new-file.patch') assert (email.errors[0].message == 'new file in the top-level folder not mentioned in a ChangeLog') + + def test_space_after_tab(self): + email = self.from_patch_glob('0001-Use-Value_Range-when-applying-inferred-ranges.patch') + assert (email.errors[0].message == 'extra space after tab') diff --git a/contrib/gcc-changelog/test_patches.txt b/contrib/gcc-changelog/test_patches.txt index 95ad961f2d3..b28de7d30b0 100644 --- a/contrib/gcc-changelog/test_patches.txt +++ b/contrib/gcc-changelog/test_patches.txt @@ -3571,3 +3571,42 @@ index 00000000000..d6459e00543 +xxx -- 2.34.1 + +=== 0001-Use-Value_Range-when-applying-inferred-ranges.patch === +From 69a233610f6b27cd4283561569d8ce0f35044dc4 Mon Sep 17 00:00:00 2001 +From: Andrew MacLeod +Date: Wed, 19 Oct 2022 09:21:22 -0400 +Subject: [PATCH] Use Value_Range when applying inferred ranges. + +Applying an inferred range is using int_range_ma as the +temporary rather than the general purpose Value_Range. This causes it +to trap if we have a non-integral inferred range. + + * gimple-range-cache.cc (ranger_cache::range_from_dom): Use + Value_Range not int_range_max. +--- + gcc/gimple-range-cache.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc +index 0b9aa3639c5..f279371948a 100644 +--- a/gcc/gimple-range-cache.cc ++++ b/gcc/gimple-range-cache.cc +@@ -1546,7 +1546,6 @@ ranger_cache::range_from_dom (vrange &r, tree name, basic_block start_bb, + void + ranger_cache::apply_inferred_ranges (gimple *s) + { +- int_range_max r; + bool update = true; + + basic_block bb = gimple_bb (s); +@@ -1572,6 +1571,7 @@ ranger_cache::apply_inferred_ranges (gimple *s) + m_exit.add_range (name, bb, infer.range (x)); + if (update) + { ++ Value_Range r (TREE_TYPE (name)); + if (!m_on_entry.get_bb_range (r, name, bb)) + exit_range (r, name, bb, RFD_READ_ONLY); + if (r.intersect (infer.range (x))) +-- +2.38.0