{"id":807533,"url":"http://patchwork.ozlabs.org/api/1.2/patches/807533/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/a1959943-f196-da67-e391-3901ffe68d28@suse.cz/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/1.2/projects/17/?format=json","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":"<a1959943-f196-da67-e391-3901ffe68d28@suse.cz>","list_archive_url":null,"date":"2017-08-30T09:45:21","name":"[RFC] Make 4-stage PGO bootstrap really working","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"219cd79ceb719660b1ef84d57afe8f4acd906044","submitter":{"id":62010,"url":"http://patchwork.ozlabs.org/api/1.2/people/62010/?format=json","name":"Martin Liška","email":"mliska@suse.cz"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/a1959943-f196-da67-e391-3901ffe68d28@suse.cz/mbox/","series":[{"id":562,"url":"http://patchwork.ozlabs.org/api/1.2/series/562/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=562","date":"2017-08-30T09:45:21","name":"[RFC] Make 4-stage PGO bootstrap really working","version":1,"mbox":"http://patchwork.ozlabs.org/series/562/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/807533/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/807533/checks/","tags":{},"related":[],"headers":{"Return-Path":"<gcc-patches-return-461144-incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list gcc-patches@gcc.gnu.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-461144-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"OzEnVhvN\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xj0xR4rfcz9sNn\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 19:45:45 +1000 (AEST)","(qmail 2614 invoked by alias); 30 Aug 2017 09:45:36 -0000","(qmail 2182 invoked by uid 89); 30 Aug 2017 09:45:27 -0000","from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by\n\tsourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tWed, 30 Aug 2017 09:45:25 +0000","from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])\tby\n\tmx1.suse.de (Postfix) with ESMTP id A70A5ABBC;\n\tWed, 30 Aug 2017 09:45:21 +0000 (UTC)"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:subject:to:cc:references:from:message-id:date:mime-version\n\t:in-reply-to:content-type; q=dns; s=default; b=BpEcKXfrt/fXjmY+q\n\ttw3mP7JgIqZj91MdzHrDzJfkpJFD/zvFqflPq3tCuEBuZ3QPf58u6uYHcxwMEEH+\n\tsF2sZVq1G0Mfworj/aCmnRcssQ5z2r+HmjXg9cWsFrUTxE3jHTbgLPQ+RocxGRo3\n\tgn53AA4k/ZfMmUWhzWIMvxssfI=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:subject:to:cc:references:from:message-id:date:mime-version\n\t:in-reply-to:content-type; s=default; bh=JFIN7OBSkafgfA7Tx453Da/\n\tTu3I=; b=OzEnVhvNkVxErTJUPhqv0r/Baj+yttHqhDc9ObYxKLuMfJBPKSmelGe\n\tnzc+4uaEUM+lg2HMhhbYb4MVzDHoCuSXtidkdtzEPokiZMH+L/Bf1soOSQZXrpxG\n\tUYhO+pSNK90+jYM4+4UAy/qwwucEeVmYPa2TCJPGZ/Xw4u+jzn44=","Mailing-List":"contact gcc-patches-help@gcc.gnu.org; run by ezmlm","Precedence":"bulk","List-Id":"<gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>","List-Archive":"<http://gcc.gnu.org/ml/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-help@gcc.gnu.org>","Sender":"gcc-patches-owner@gcc.gnu.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0,\n\tGIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=spread,\n\tHx-languages-length:4217, Hack","X-HELO":"mx1.suse.de","Subject":"[RFC] Make 4-stage PGO bootstrap really working","To":"Jan Hubicka <hubicka@ucw.cz>","Cc":"Markus Trippelsdorf <markus@trippelsdorf.de>,\n\tGCC Patches <gcc-patches@gcc.gnu.org>,\n\tRichard Biener <richard.guenther@gmail.com>","References":"<f61115af-55e1-8d59-545f-295f7e5b53cb@suse.cz>\n\t<20170529050407.GA15061@x4>\n\t<9203f3a8-3aa4-292b-1f2d-6749d3e6d0f7@suse.cz>\n\t<20170619103713.GB72026@kam.mff.cuni.cz>","From":"=?utf-8?q?Martin_Li=C5=A1ka?= <mliska@suse.cz>","Message-ID":"<a1959943-f196-da67-e391-3901ffe68d28@suse.cz>","Date":"Wed, 30 Aug 2017 11:45:21 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64;\n\trv:52.0) Gecko/20100101 Thunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170619103713.GB72026@kam.mff.cuni.cz>","Content-Type":"multipart/mixed;\n\tboundary=\"------------0A14DD8C6D9D93B6C5E5D54A\"","X-IsSubscribed":"yes"},"content":"Hi.\n\nThis is follow up which I've just noticed. Main problem we have is that\nan instrumented compiler w/ -fprofile-generate (built in $OBJDIR/gcc subfolder)\nwill generate all *.gcda files in a same dir as *.o files. That's problematic\nbecause we then have *.gcda files spread in 'profile' subfolder (because profile'\ncompiler builds libgcc) and 'train' subfolder. Eventually in 'feedback' stage\nwe don't load any *.gcda files :/\n\nWell I really hope we need to set -fprofile-generate=$folder to a $folder. There comes\nsecond problem: all *.gcda files are created as $folder/$aux_base_name.gcda which makes\nit useless as we multiple same file names:\n\n$ find . -name expr.c\n./libcpp/expr.c\n./gcc/expr.c\n\nThus I suggest patch #0001 that appends full path of current work dir. Patch #0002 sets\na folder for PGO bootstrap. So far so good with a small exception: conftest.gcda files\nthat trigger -Wcoverage-mismatch. Can we remove these before a stage? Do we do a similar\nthing somewhere?\n\nThoughts?\nThanks,\nMartin","diff":"From 654ca05a0e1e0261a4477283ca2dd8678f62f1e7 Mon Sep 17 00:00:00 2001\nFrom: marxin <mliska@suse.cz>\nDate: Wed, 16 Aug 2017 10:22:57 +0200\nSubject: [PATCH 1/2] Append PWD to path when using\n -fprofile-generate=/some/path.\n\n---\n gcc/coverage.c | 20 ++++++++++++++++++--\n 1 file changed, 18 insertions(+), 2 deletions(-)\n\ndiff --git a/gcc/coverage.c b/gcc/coverage.c\nindex ed469107e3e..5780e19bbc8 100644\n--- a/gcc/coverage.c\n+++ b/gcc/coverage.c\n@@ -1220,8 +1220,24 @@ coverage_init (const char *filename)\n     g->get_passes ()->get_pass_profile ()->static_pass_number;\n   g->get_dumps ()->dump_start (profile_pass_num, NULL);\n \n-  if (!profile_data_prefix && !IS_ABSOLUTE_PATH (filename))\n-    profile_data_prefix = getpwd ();\n+  if (!IS_ABSOLUTE_PATH (filename))\n+    {\n+      if (profile_data_prefix)\n+\t{\n+\t  const char *pwd = getpwd ();\n+\t  unsigned l1 = strlen (profile_data_prefix);\n+\t  unsigned l2 = strlen (pwd);\n+\n+\t  char *b = XNEWVEC (char, l1 + l2 + 2);\n+\t  memcpy (b, profile_data_prefix, l1);\n+\t  b[l1] = '/';\n+\t  memcpy (b + l1 + 1, pwd, l2);\n+\t  b[l1 + l2 + 1] = '\\0';\n+\t  profile_data_prefix = b;\n+\t}\n+      else\n+\tprofile_data_prefix = getpwd ();\n+    }\n \n   if (profile_data_prefix)\n     prefix_len = strlen (profile_data_prefix);\n-- \n2.14.1\n\n","prefixes":["RFC"]}