Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2215942/?format=api
{ "id": 2215942, "url": "http://patchwork.ozlabs.org/api/patches/2215942/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260325150133.B95944BAD144@sourceware.org/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/projects/17/?format=api", "name": "GNU Compiler Collection", "link_name": "gcc", "list_id": "gcc-patches.gcc.gnu.org", "list_email": "gcc-patches@gcc.gnu.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260325150133.B95944BAD144@sourceware.org>", "list_archive_url": null, "date": "2026-03-25T15:01:01", "name": "gcov-profile/121074 - hold onto gcov file for less time", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "11b55cb761acc86418230c8c0d20af406044b164", "submitter": { "id": 4338, "url": "http://patchwork.ozlabs.org/api/people/4338/?format=api", "name": "Richard Biener", "email": "rguenther@suse.de" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260325150133.B95944BAD144@sourceware.org/mbox/", "series": [ { "id": 497458, "url": "http://patchwork.ozlabs.org/api/series/497458/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=497458", "date": "2026-03-25T15:01:01", "name": "gcov-profile/121074 - hold onto gcov file for less time", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/497458/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2215942/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2215942/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=achv219W;\n\tdkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=JfVyBDMS;\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.a=rsa-sha256 header.s=susede2_rsa header.b=achv219W;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=JfVyBDMS;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)", "sourceware.org;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=achv219W;\n\tdkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=JfVyBDMS;\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.a=rsa-sha256 header.s=susede2_rsa header.b=achv219W;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=JfVyBDMS", "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=suse.de", "sourceware.org; spf=pass smtp.mailfrom=suse.de", "server2.sourceware.org;\n arc=none smtp.remote-ip=195.135.223.131", "smtp-out2.suse.de;\n\tnone" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fgqqg5bb3z1xy3\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 02:01:35 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id B95944BAD144\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 15:01:33 +0000 (GMT)", "from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131])\n by sourceware.org (Postfix) with ESMTPS id 3DEA44B9DB57\n for <gcc-patches@gcc.gnu.org>; Wed, 25 Mar 2026 15:01:02 +0000 (GMT)", "from murzim.nue2.suse.org (unknown [10.168.4.243])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-out2.suse.de (Postfix) with ESMTPS id 342B65BDD9;\n Wed, 25 Mar 2026 15:01:01 +0000 (UTC)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org B95944BAD144", "OpenDKIM Filter v2.11.0 sourceware.org 3DEA44B9DB57" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 3DEA44B9DB57", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 3DEA44B9DB57", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774450862; cv=none;\n b=PYXYn6H8WitC8cbiUTANSTXmeOmW8wLK2CDnIF75yZxU3yl83g341XHGzoUUZBxtJ5mVTrB5ypq7ujCbpcDl9rBAdKroqFQLVr2L3ouPxbmBaZ1j/FagENMLMTXiix7K2fV1Jn0grIvZHaJWXKchukb44YqHaVjJyYO386S7GiM=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1774450862; c=relaxed/simple;\n bh=VUABcLlUDTaiT4S5hfi7oBKveZvCNoTVH8rKbZ7Ben8=;\n h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date:\n From:To:Subject:MIME-Version;\n b=ZWEfqVUq9MGMG0CEviSoe2Hh2CCfBT2etbYQI6W0yyWZ5FDQFpmUtzygeGk1A/tn3qLs74Y6qyNdUhyUm/IR3OqdEZSwm4JtjY8LRihPE81L0mQEyudOVny7szQItLye4Yi1OPKNd+OSo4+GSgYnDYjgXuXVUpkHB0JNoca47hk=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1774450861;\n h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version:\n content-type:content-type; bh=7SCQ6N5MH6LefyPe9Y+qMna/q/Vjl5bBpMyXFt2+AEk=;\n b=achv219WqHjznxnCXpZNwTOocYCdw3/5osFWOgW3cxtRHJ4euDRNYOpsbbHCZWX2sbgA1V\n JxNic2b654f0vuApkgrDNhnYkBc+7lxo430iNbooLy3Wjf5zOjvfBHwo1DcNJ+CRCRCBxq\n JwtBr1x5qO3kg5jGvq7fxYxWjEYPqDw=", "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1774450861;\n h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version:\n content-type:content-type; bh=7SCQ6N5MH6LefyPe9Y+qMna/q/Vjl5bBpMyXFt2+AEk=;\n b=JfVyBDMSRAIgJjmNhXeTSxqi9SO+NuYX8cOt3jd77Mq/BHfPPAzHfL9NXMcj6Ms/2aScs9\n z7HSNk3IgjwZLpAQ==", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1774450861;\n h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version:\n content-type:content-type; bh=7SCQ6N5MH6LefyPe9Y+qMna/q/Vjl5bBpMyXFt2+AEk=;\n b=achv219WqHjznxnCXpZNwTOocYCdw3/5osFWOgW3cxtRHJ4euDRNYOpsbbHCZWX2sbgA1V\n JxNic2b654f0vuApkgrDNhnYkBc+7lxo430iNbooLy3Wjf5zOjvfBHwo1DcNJ+CRCRCBxq\n JwtBr1x5qO3kg5jGvq7fxYxWjEYPqDw=", "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1774450861;\n h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version:\n content-type:content-type; bh=7SCQ6N5MH6LefyPe9Y+qMna/q/Vjl5bBpMyXFt2+AEk=;\n b=JfVyBDMSRAIgJjmNhXeTSxqi9SO+NuYX8cOt3jd77Mq/BHfPPAzHfL9NXMcj6Ms/2aScs9\n z7HSNk3IgjwZLpAQ==" ], "Date": "Wed, 25 Mar 2026 16:01:01 +0100 (CET)", "From": "Richard Biener <rguenther@suse.de>", "To": "gcc-patches@gcc.gnu.org", "cc": "Jan Hubicka <hubicka@ucw.cz>, Jakub Jelinek <jakub@redhat.com>", "Subject": "[PATCH] gcov-profile/121074 - hold onto gcov file for less time", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=US-ASCII", "X-Spamd-Result": "default: False [-1.80 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n MISSING_MID(2.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000];\n NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain];\n MISSING_XM_UA(0.00)[]; FROM_HAS_DN(0.00)[];\n MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[];\n FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_COUNT_ZERO(0.00)[0];\n DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n FROM_EQ_ENVFROM(0.00)[]; TO_DN_SOME(0.00)[];\n TO_MATCH_ENVRCPT_ALL(0.00)[];\n URIBL_BLOCKED(0.00)[coverage.cc:url,murzim.nue2.suse.org:helo];\n RCPT_COUNT_THREE(0.00)[3]", "X-BeenThere": "gcc-patches@gcc.gnu.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Gcc-patches mailing list <gcc-patches.gcc.gnu.org>", "List-Unsubscribe": "<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>", "List-Archive": "<https://gcc.gnu.org/pipermail/gcc-patches/>", "List-Post": "<mailto:gcc-patches@gcc.gnu.org>", "List-Help": "<mailto:gcc-patches-request@gcc.gnu.org?subject=help>", "List-Subscribe": "<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>", "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org", "Message-Id": "<20260325150133.B95944BAD144@sourceware.org>" }, "content": "The following fixes the issue of two open gcov files at the\nsame time, one from -ftest-coverage, opened/closed by\ncoverage_init/finish and one from -fauto-profile, attempted\nto be opened by pass_ipa_auto_profile. The solution is\nto open the coverage files only during pass_ipa_tree_profile.\n\nprofile-bootstrapped and tested on x86_64-unknown-linux-gnu.\n\nOK?\n\nThanks,\nRichard.\n\n\tPR gcov-profile/121074\n\t* coverage.h (coverage_init_file): Declare.\n\t(coverage_finish_file): Likewise.\n\t* coverage.cc (coverage_init_file): New function, split\n\tout actual file opening and writing from ...\n\t(coverage_init): ... here.\n\t(coverage_finish_file): Likewise for file closing, from ...\n\t(coverage_finish): ... here.\n---\n gcc/coverage.cc | 57 ++++++++++++++++++++++++++++-----------------\n gcc/coverage.h | 2 ++\n gcc/tree-profile.cc | 3 +++\n 3 files changed, 41 insertions(+), 21 deletions(-)", "diff": "diff --git a/gcc/coverage.cc b/gcc/coverage.cc\nindex 0f7fe09d865..5742dd92166 100644\n--- a/gcc/coverage.cc\n+++ b/gcc/coverage.cc\n@@ -1248,6 +1248,33 @@ coverage_obj_finish (vec<constructor_elt, va_gc> *ctor,\n varpool_node::finalize_decl (gcov_info_var);\n }\n \n+/* Open the coverage files. */\n+\n+void\n+coverage_init_file (void)\n+{\n+ if (flag_test_coverage && !flag_compare_debug)\n+ {\n+ if (!gcov_open (bbg_file_name, -1))\n+\t{\n+\t error (\"cannot open %s\", bbg_file_name);\n+\t bbg_file_name = NULL;\n+\t}\n+ else\n+\t{\n+\t gcov_write_unsigned (GCOV_NOTE_MAGIC);\n+\t gcov_write_unsigned (GCOV_VERSION);\n+\t gcov_write_unsigned (bbg_file_stamp);\n+\t /* Use an arbitrary checksum */\n+\t gcov_write_unsigned (0);\n+\t gcov_write_string (remap_profile_filename (getpwd ()));\n+\n+\t /* Do not support has_unexecuted_blocks for Ada. */\n+\t gcov_write_unsigned (strcmp (lang_hooks.name, \"GNU Ada\") != 0);\n+\t}\n+ }\n+}\n+\n /* Perform file-level initialization. Read in data file, generate name\n of notes file. */\n \n@@ -1330,34 +1357,15 @@ coverage_init (const char *filename)\n \t memcpy (bbg_file_name, original_filename, original_len);\n \t strcpy (bbg_file_name + original_len, GCOV_NOTE_SUFFIX);\n \t}\n-\n- if (!gcov_open (bbg_file_name, -1))\n-\t{\n-\t error (\"cannot open %s\", bbg_file_name);\n-\t bbg_file_name = NULL;\n-\t}\n- else\n-\t{\n-\t gcov_write_unsigned (GCOV_NOTE_MAGIC);\n-\t gcov_write_unsigned (GCOV_VERSION);\n-\t gcov_write_unsigned (bbg_file_stamp);\n-\t /* Use an arbitrary checksum */\n-\t gcov_write_unsigned (0);\n-\t gcov_write_string (remap_profile_filename (getpwd ()));\n-\n-\t /* Do not support has_unexecuted_blocks for Ada. */\n-\t gcov_write_unsigned (strcmp (lang_hooks.name, \"GNU Ada\") != 0);\n-\t}\n }\n \n g->get_dumps ()->dump_finish (profile_pass_num);\n }\n \n-/* Performs file-level cleanup. Close notes file, generate coverage\n- variables and constructor. */\n+/* Close the coverage files. */\n \n void\n-coverage_finish (void)\n+coverage_finish_file (void)\n {\n if (bbg_file_name && gcov_close ())\n unlink (bbg_file_name);\n@@ -1367,7 +1375,14 @@ coverage_finish (void)\n /* Only remove the da file, if we're emitting coverage code and\n cannot uniquely stamp it. If we can stamp it, libgcov will DTRT. */\n unlink (da_file_name);\n+}\n \n+/* Performs file-level cleanup. Close notes file, generate coverage\n+ variables and constructor. */\n+\n+void\n+coverage_finish (void)\n+{\n /* Global GCDA checksum that aggregates all functions. */\n unsigned object_checksum = 0;\n \ndiff --git a/gcc/coverage.h b/gcc/coverage.h\nindex abd07e40bad..4450f427e98 100644\n--- a/gcc/coverage.h\n+++ b/gcc/coverage.h\n@@ -24,6 +24,8 @@ along with GCC; see the file COPYING3. If not see\n \n extern void coverage_init (const char *);\n extern void coverage_finish (void);\n+extern void coverage_init_file (void);\n+extern void coverage_finish_file (void);\n extern void coverage_remove_note_file (void);\n \n /* Start outputting coverage information for the current\ndiff --git a/gcc/tree-profile.cc b/gcc/tree-profile.cc\nindex 273050ba55a..7569dbb2f91 100644\n--- a/gcc/tree-profile.cc\n+++ b/gcc/tree-profile.cc\n@@ -1856,6 +1856,8 @@ tree_profiling (void)\n {\n struct cgraph_node *node;\n \n+ coverage_init_file ();\n+\n /* Verify whether we can utilize atomic update operations. */\n bool can_support_atomic = targetm.have_libatomic;\n unsigned HOST_WIDE_INT gcov_type_size\n@@ -2071,6 +2073,7 @@ tree_profiling (void)\n \n del_node_map ();\n end_branch_prob ();\n+ coverage_finish_file ();\n return 0;\n }\n \n", "prefixes": [] }