From patchwork Wed May 20 14:09:13 2020 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: 1294403 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Received: from 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Rvkr6TdRz9sRK for ; Thu, 21 May 2020 00:09:21 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8CE36395CC7D; Wed, 20 May 2020 14:09:18 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 2F516395CCA7 for ; Wed, 20 May 2020 14:09:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2F516395CCA7 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mliska@suse.cz X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id F1933ABCE for ; Wed, 20 May 2020 14:09:16 +0000 (UTC) From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] git_email.py: fix duplicate author_lines. To: gcc-patches@gcc.gnu.org Message-ID: Date: Wed, 20 May 2020 16:09:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-16.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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@gcc.gnu.org Sender: "Gcc-patches" Hi. A small de-duplication that I noticed for commit: eb069ae8819c3a84d7f78becc5501e21ee3a9554 I'm going to install the patch. Martin contrib/ChangeLog: 2020-05-20 Martin Liska * gcc-changelog/git_commit.py: Add author_tuple only if not present in author_lines. * gcc-changelog/test_email.py: New test. * gcc-changelog/test_patches.txt: Add new patch. --- contrib/gcc-changelog/git_commit.py | 3 +- contrib/gcc-changelog/test_email.py | 5 ++ contrib/gcc-changelog/test_patches.txt | 96 ++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 1 deletion(-) diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py index e4903cac4ef..fb002ed5b25 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -381,7 +381,8 @@ class GitCommit: self.changelog_entries.append(last_entry) will_deduce = True elif author_tuple: - last_entry.author_lines.append(author_tuple) + if not author_tuple in last_entry.author_lines: + last_entry.author_lines.append(author_tuple) continue if not line.startswith('\t'): diff --git a/contrib/gcc-changelog/test_email.py b/contrib/gcc-changelog/test_email.py index 92bcb89ed8b..ce69c64c79e 100755 --- a/contrib/gcc-changelog/test_email.py +++ b/contrib/gcc-changelog/test_email.py @@ -267,3 +267,8 @@ class TestGccChangelog(unittest.TestCase): email = self.from_patch_glob('0001-RISC-V-Make-unique.patch') assert not email.errors assert len(email.changelog_entries) == 1 + + def test_duplicate_top_level_author(self): + email = self.from_patch_glob('0001-Fortran-ProcPtr-function.patch') + assert not email.errors + assert len(email.changelog_entries[0].author_lines) == 1 diff --git a/contrib/gcc-changelog/test_patches.txt b/contrib/gcc-changelog/test_patches.txt index 7a78c4de897..d80cfc3a0c8 100644 --- a/contrib/gcc-changelog/test_patches.txt +++ b/contrib/gcc-changelog/test_patches.txt @@ -2445,3 +2445,99 @@ index e4c08d780db..1ad9799fce4 100644 -- 2.26.2 + +=== 0001-Fortran-ProcPtr-function.patch === +From eb069ae8819c3a84d7f78becc5501e21ee3a9554 Mon Sep 17 00:00:00 2001 +From: Mark Eggleston +Date: Thu, 7 May 2020 08:02:02 +0100 +Subject: [PATCH] Fortran : ProcPtr function results: 'ppr@' in error message + PR39695 + +The value 'ppr@' is set in the name of result symbol, the actual +name of the symbol is in the procedure name symbol pointed +to by the result symbol's namespace (ns). When reporting errors for +symbols that have the proc_pointer attribute check whether the +result attribute is set and set the name accordingly. + +2020-05-20 Mark Eggleston + +gcc/fortran/ + + PR fortran/39695 + * resolve.c (resolve_fl_procedure): Set name depending on + whether the result attribute is set. For PROCEDURE/RESULT + conflict use the name in sym->ns->proc_name->name. + * symbol.c (gfc_add_type): Add check for function and result + attributes use sym->ns->proc_name->name if both are set. + Where the symbol cannot have a type use the name in + sym->ns->proc_name->name. + +2020-05-20 Mark Eggleston + +gcc/testsuite/ + + PR fortran/39695 + * gfortran.dg/pr39695_1.f90: New test. + * gfortran.dg/pr39695_2.f90: New test. + * gfortran.dg/pr39695_3.f90: New test. + * gfortran.dg/pr39695_4.f90: New test. +--- + gcc/fortran/ChangeLog | 11 +++++++++++ + gcc/fortran/resolve.c | 6 ++++-- + gcc/fortran/symbol.c | 7 +++++-- + gcc/testsuite/ChangeLog | 8 ++++++++ + gcc/testsuite/gfortran.dg/pr39695_1.f90 | 8 ++++++++ + gcc/testsuite/gfortran.dg/pr39695_2.f90 | 12 ++++++++++++ + gcc/testsuite/gfortran.dg/pr39695_3.f90 | 11 +++++++++++ + gcc/testsuite/gfortran.dg/pr39695_4.f90 | 14 ++++++++++++++ + 8 files changed, 73 insertions(+), 4 deletions(-) + create mode 100644 gcc/testsuite/gfortran.dg/pr39695_1.f90 + create mode 100644 gcc/testsuite/gfortran.dg/pr39695_2.f90 + create mode 100644 gcc/testsuite/gfortran.dg/pr39695_3.f90 + create mode 100644 gcc/testsuite/gfortran.dg/pr39695_4.f90 + +diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c +index f6e10ea379c..aaee5eb6b9b 100644 +--- a/gcc/fortran/resolve.c ++++ b/gcc/fortran/resolve.c +@@ -1 +1,2 @@ + ++ +diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c +index 59f602d80d5..b96706138c9 100644 +--- a/gcc/fortran/symbol.c ++++ b/gcc/fortran/symbol.c +@@ -1 +1,2 @@ + ++ +diff --git a/gcc/testsuite/gfortran.dg/pr39695_1.f90 b/gcc/testsuite/gfortran.dg/pr39695_1.f90 +new file mode 100644 +index 00000000000..4c4b3045f69 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/pr39695_1.f90 +@@ -0,0 +1 @@ ++ +diff --git a/gcc/testsuite/gfortran.dg/pr39695_2.f90 b/gcc/testsuite/gfortran.dg/pr39695_2.f90 +new file mode 100644 +index 00000000000..8534724959a +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/pr39695_2.f90 +@@ -0,0 +1 @@ ++ +diff --git a/gcc/testsuite/gfortran.dg/pr39695_3.f90 b/gcc/testsuite/gfortran.dg/pr39695_3.f90 +new file mode 100644 +index 00000000000..661e2540bb3 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/pr39695_3.f90 +@@ -0,0 +1 @@ ++ +diff --git a/gcc/testsuite/gfortran.dg/pr39695_4.f90 b/gcc/testsuite/gfortran.dg/pr39695_4.f90 +new file mode 100644 +index 00000000000..ecb0a43929f +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/pr39695_4.f90 +@@ -0,0 +1 @@ ++ +-- +2.26.2 +