From: Martin Liska Date: Fri, 6 Nov 2020 13:52:05 +0000 (+0100) Subject: Sync gcc-changelog scripts. X-Git-Tag: releases/gcc-10.3.0~676 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2612abf07557d641dc311e0d1d0e77fc7e4f295;p=thirdparty%2Fgcc.git Sync gcc-changelog scripts. contrib/ChangeLog: 2020-11-06 Martin Liska * gcc-changelog/git_commit.py: Sync. * gcc-changelog/git_email.py: Likewise. * gcc-changelog/git_repository.py: Likewise. * gcc-changelog/test_email.py: Likewise. * gcc-changelog/test_patches.txt: Likewise. * gcc-changelog/setup.cfg: New file. --- diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py index 5a9cc4c7563a..80ae0b2a77de 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -155,6 +155,8 @@ pr_regex = re.compile(r'\tPR (?P[a-z+-]+\/)?([0-9]+)$') dr_regex = re.compile(r'\tDR ([0-9]+)$') star_prefix_regex = re.compile(r'\t\*(?P\ *)(?P.*)') end_of_location_regex = re.compile(r'[\[<(:]') +item_empty_regex = re.compile(r'\t(\* \S+ )?\(\S+\):\s*$') +item_parenthesis_regex = re.compile(r'\t(\*|\(\S+\):)') LINE_LIMIT = 100 TAB_WIDTH = 8 @@ -421,7 +423,11 @@ class GitCommit: continue elif line.startswith(CHERRY_PICK_PREFIX): commit = line[len(CHERRY_PICK_PREFIX):].rstrip(')') - self.cherry_pick_commit = commit + if self.cherry_pick_commit: + self.errors.append(Error('multiple cherry pick lines', + line)) + else: + self.cherry_pick_commit = commit continue # ChangeLog name will be deduced later @@ -459,6 +465,13 @@ class GitCommit: msg = 'one space should follow asterisk' self.errors.append(Error(msg, line)) else: + content = m.group('content') + parts = content.split(':') + if len(parts) > 1: + for needle in ('()', '[]', '<>'): + if ' ' + needle in parts[0]: + msg = f'empty group "{needle}" found' + self.errors.append(Error(msg, line)) last_entry.lines.append(line) else: if last_entry.is_empty: @@ -483,9 +496,10 @@ class GitCommit: def check_for_empty_description(self): for entry in self.changelog_entries: for i, line in enumerate(entry.lines): - if (star_prefix_regex.match(line) and line.endswith(':') and + if (item_empty_regex.match(line) and (i == len(entry.lines) - 1 - or star_prefix_regex.match(entry.lines[i + 1]))): + or not entry.lines[i+1].strip() + or item_parenthesis_regex.match(entry.lines[i+1]))): msg = 'missing description of a change' self.errors.append(Error(msg, line)) diff --git a/contrib/gcc-changelog/git_email.py b/contrib/gcc-changelog/git_email.py index 014fdd1004b4..5b53ca4a6a9c 100755 --- a/contrib/gcc-changelog/git_email.py +++ b/contrib/gcc-changelog/git_email.py @@ -24,10 +24,11 @@ from dateutil.parser import parse from git_commit import GitCommit, GitInfo -from unidiff import PatchSet +from unidiff import PatchSet, PatchedFile DATE_PREFIX = 'Date: ' FROM_PREFIX = 'From: ' +unidiff_supports_renaming = hasattr(PatchedFile(), 'is_rename') class GitEmail(GitCommit): @@ -58,7 +59,7 @@ class GitEmail(GitCommit): t = 'A' elif f.is_removed_file: t = 'D' - elif f.is_rename: + elif unidiff_supports_renaming and f.is_rename: # Consider that renamed files are two operations: the deletion # of the original name and the addition of the new one. modified_files.append((source, 'D')) diff --git a/contrib/gcc-changelog/git_repository.py b/contrib/gcc-changelog/git_repository.py index 90edc3ce3d89..8edcff91ad67 100755 --- a/contrib/gcc-changelog/git_repository.py +++ b/contrib/gcc-changelog/git_repository.py @@ -29,7 +29,7 @@ except ImportError: from git_commit import GitCommit, GitInfo -def parse_git_revisions(repo_path, revisions, strict=False): +def parse_git_revisions(repo_path, revisions, strict=True): repo = Repo(repo_path) def commit_to_info(commit): diff --git a/contrib/gcc-changelog/setup.cfg b/contrib/gcc-changelog/setup.cfg new file mode 100644 index 000000000000..9e4a0f6479cc --- /dev/null +++ b/contrib/gcc-changelog/setup.cfg @@ -0,0 +1,2 @@ +[tool:pytest] +addopts = -vv --flake8 diff --git a/contrib/gcc-changelog/test_email.py b/contrib/gcc-changelog/test_email.py index b6fbe6a5303b..e38c3e52158c 100755 --- a/contrib/gcc-changelog/test_email.py +++ b/contrib/gcc-changelog/test_email.py @@ -362,6 +362,25 @@ class TestGccChangelog(unittest.TestCase): assert '\t2020-06-11 Martin Liska ' in entry assert '\t\t Jakub Jelinek ' in entry + def test_backport_double_cherry_pick(self): + email = self.from_patch_glob('double-cherry-pick.patch') + assert email.errors[0].message.startswith('multiple cherry pick lines') + def test_square_and_lt_gt(self): email = self.from_patch_glob('0001-Check-for-more-missing') assert not email.errors + + def test_empty_parenthesis(self): + email = self.from_patch_glob('0001-tree-optimization-97633-fix') + assert len(email.errors) == 1 + assert email.errors[0].message == 'empty group "()" found' + + def test_emptry_entry_desc(self): + email = self.from_patch_glob('0001-c-Set-CALL_FROM_NEW_OR') + assert len(email.errors) == 1 + assert email.errors[0].message == 'missing description of a change' + + def test_emptry_entry_desc_2(self): + email = self.from_patch_glob('0001-lto-fix-LTO-debug') + assert not email.errors + assert len(email.changelog_entries) == 1 diff --git a/contrib/gcc-changelog/test_patches.txt b/contrib/gcc-changelog/test_patches.txt index 2bf5d1aefaa0..37f49c851ecb 100644 --- a/contrib/gcc-changelog/test_patches.txt +++ b/contrib/gcc-changelog/test_patches.txt @@ -3160,6 +3160,35 @@ index 823eb539993..4ec22162c12 100644 -- 2.27.0 +=== double-cherry-pick.patch === +From e1d68582022cfa2b1dc76646724b397ba2739439 Mon Sep 17 00:00:00 2001 +From: Martin Liska +Date: Thu, 11 Jun 2020 09:34:41 +0200 +Subject: [PATCH] asan: fix RTX emission for ilp32 + +gcc/ChangeLog: + + PR sanitizer/95634 + * asan.c (asan_emit_stack_protection): Fix emission for ilp32 + by using Pmode instead of ptr_mode. + +Co-Authored-By: Jakub Jelinek +(cherry picked from commit 8cff672cb9a132d3d3158c2edfc9a64b55292b80) +(cherry picked from commit 8cff672cb9a132d3d3158c2edfc9a64b55292b80) +--- + gcc/asan.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gcc/asan.c b/gcc/asan.c +index 823eb539993..4ec22162c12 100644 +--- a/gcc/asan.c ++++ b/gcc/asan.c +@@ -1 +1,2 @@ + ++ +-- +2.27.0 + === 0001-Check-for-more-missing-math-decls-on-vxworks.patch === From 0edfc1fd22405ee8e946101e44cd8edc0ee12047 Mon Sep 17 00:00:00 2001 From: Douglas B Rupp @@ -3193,5 +3222,101 @@ index fe18288..313f84d 100644 + -- +=== 0001-tree-optimization-97633-fix-SLP-scheduling-of-single.patch === +From c0bfd9672e19caf08e45afeb4277f848488ced2b Mon Sep 17 00:00:00 2001 +From: Richard Biener +Date: Fri, 30 Oct 2020 09:57:02 +0100 +Subject: [PATCH] tree-optimization/97633 - fix SLP scheduling of single-node + cycles + +This makes sure to update backedges in single-node cycles. + +2020-10-30 Richard Biener + + PR tree-optimization/97633 + * tree-vect-slp.c (): Update backedges in single-node cycles. + Optimize processing of externals. + + * g++.dg/vect/slp-pr97636.cc: New testcase. + * gcc.dg/vect/bb-slp-pr97633.c: Likewise. +--- + gcc/testsuite/g++.dg/vect/slp-pr97636.cc | 83 +++++++++++ + gcc/testsuite/gcc.dg/vect/bb-slp-pr97633.c | 27 ++++ + gcc/tree-vect-slp.c | 162 +++++++++++---------- + 3 files changed, 198 insertions(+), 74 deletions(-) + create mode 100644 gcc/testsuite/g++.dg/vect/slp-pr97636.cc + create mode 100644 gcc/testsuite/gcc.dg/vect/bb-slp-pr97633.c + +diff --git a/gcc/testsuite/g++.dg/vect/slp-pr97636.cc b/gcc/testsuite/g++.dg/vect/slp-pr97636.cc +new file mode 100644 +index 00000000000..012342004f1 +--- /dev/null ++++ b/gcc/testsuite/g++.dg/vect/slp-pr97636.cc +@@ -0,0 +1 @@ ++ +diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c +index 5d69a98c2a9..714e50697bd 100644 +--- a/gcc/tree-vect-slp.c ++++ b/gcc/tree-vect-slp.c +@@ -1 +1,2 @@ + ++ +-- + 2.7.4 +=== 0001-c-Set-CALL_FROM_NEW_OR_DELETE_P-on-more-calls.patch === +From 4f4ced28826ece7b7b76649522ee2a9601a63b90 Mon Sep 17 00:00:00 2001 +From: Jason Merrill +Date: Fri, 2 Oct 2020 09:00:49 +0200 +Subject: [PATCH] c++: Set CALL_FROM_NEW_OR_DELETE_P on more calls. + +We were failing to set the flag on a delete call in a new expression, in a +deleting destructor, and in a coroutine. Fixed by setting it in the +function that builds the call. + +2020-10-02 Jason Merril + +gcc/cp/ChangeLog: + * init.c (build_new_1, build_vec_delete_1, build_delete): Not here. + (build_delete): + +--- + gcc/cp/init.c | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +diff --git a/gcc/cp/init.c b/gcc/cp/init.c +index e84e985492d..00fff3f7327 100644 +--- a/gcc/cp/init.c ++++ b/gcc/cp/init.c +@@ -3436,1 +3435,0 @@ build_new_1 (vec **placement, tree type, tree nelts, +- +-- +2.25.1 + +=== 0001-lto-fix-LTO-debug-sections-copying.patch === +From 190c04ba36d9c6c3dce41f12012aa97c6d7f22f5 Mon Sep 17 00:00:00 2001 +From: Martin Liska +Date: Mon, 5 Oct 2020 18:03:08 +0200 +Subject: [PATCH] lto: fix LTO debug sections copying. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +libiberty/ChangeLog: + + PR lto/97290 + * simple-object-elf.c (simple_object_elf_copy_lto_debug_sections): + Use sh_link of a .symtab_shndx section. +--- + libiberty/simple-object-elf.c | 1 - + 1 file changed, 0 insertions(+), 1 deletions(-) + +diff --git a/libiberty/simple-object-elf.c b/libiberty/simple-object-elf.c +index 7c9d492f6a4..37e73348cb7 100644 +--- a/libiberty/simple-object-elf.c ++++ b/libiberty/simple-object-elf.c +@@ -1191,1 +1191,0 @@ simple_object_elf_copy_lto_debug_sections (simple_object_read *sobj, +- +-- +2.25.1