From: "Martin Liška" <mliska@suse.cz>
To: gcc-patches@gcc.gnu.org
Cc: Jakub Jelinek <jakub@redhat.com>
Subject: [PATCH] changelog: check for space after tab
Date: Wed, 9 Nov 2022 14:41:27 +0100 [thread overview]
Message-ID: <c1d91c0b-5326-ce2e-3f78-8a9de6af9a37@suse.cz> (raw)
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 <amacleod@redhat.com>
+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
--
2.38.0
reply other threads:[~2022-11-09 13:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c1d91c0b-5326-ce2e-3f78-8a9de6af9a37@suse.cz \
--to=mliska@suse.cz \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).