From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26460 invoked by alias); 18 Apr 2011 18:52:31 -0000 Received: (qmail 26442 invoked by uid 22791); 18 Apr 2011 18:52:30 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,TW_CP,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Apr 2011 18:52:16 +0000 Received: from hpaq3.eem.corp.google.com (hpaq3.eem.corp.google.com [172.25.149.3]) by smtp-out.google.com with ESMTP id p3IIqEVo008520 for ; Mon, 18 Apr 2011 11:52:15 -0700 Received: from pwi8 (pwi8.prod.google.com [10.241.219.8]) by hpaq3.eem.corp.google.com with ESMTP id p3IIpRsZ030952 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 18 Apr 2011 11:52:13 -0700 Received: by pwi8 with SMTP id 8so2850103pwi.36 for ; Mon, 18 Apr 2011 11:52:13 -0700 (PDT) Received: by 10.142.191.1 with SMTP id o1mr2829341wff.396.1303152733109; Mon, 18 Apr 2011 11:52:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.143.6 with HTTP; Mon, 18 Apr 2011 11:51:52 -0700 (PDT) In-Reply-To: <20110418174849.D2B231EE08E@martint2.mtv.corp.google.com> References: <20110418174849.D2B231EE08E@martint2.mtv.corp.google.com> From: Martin Thuresson Date: Mon, 18 Apr 2011 19:01:00 -0000 Message-ID: Subject: Re: PR 47793 - Support relative paths using -fprofile-generate (issue4434055) To: reply@codereview.appspotmail.com, gcc-patches Cc: hubicka@ucw.cz Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg01441.txt.bz2 On Mon, Apr 18, 2011 at 10:48 AM, Martin Thuresson wro= te: > This is slightly updated from my previous patch proposal. The test now > correctly work if multiple tests are executed in parallell. Forgot to mention that this patch has been bootstrapped without regression on x86_64 and should be considered for GCC trunk. Thanks! Martin > > 2011-04-17 =A0Martin Thuresson =A0 > > =A0 =A0 =A0 =A0* gcc/doc/invoke.tex: Document support for relative profil= e paths. > =A0 =A0 =A0 =A0* gcc/testsuite/gcc.dg/pr47793.c: New test. > =A0 =A0 =A0 =A0* gcc/libgcov.c (gcov_exit): Support relative profile path= s. > > Index: gcc/doc/invoke.texi > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc/doc/invoke.texi (revision 172439) > +++ gcc/doc/invoke.texi (working copy) > @@ -7751,7 +7751,7 @@ Set the directory to search for the prof > =A0This option affects only the profile data generated by > =A0@option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofi= le-arcs} > =A0and used by @option{-fprofile-use} and @option{-fbranch-probabilities} > -and its related options. > +and its related options. =A0Both absolute and relative paths can be used. > =A0By default, GCC will use the current directory as @var{path}, thus the > =A0profile data file will appear in the same directory as the object file. > > Index: gcc/testsuite/gcc.dg/pr47793.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc/testsuite/gcc.dg/pr47793.c =A0 =A0 =A0(revision 0) > +++ gcc/testsuite/gcc.dg/pr47793.c =A0 =A0 =A0(revision 0) > @@ -0,0 +1,12 @@ > +/* Bug pr47793: Allow relative paths in profile-generate. =A0*/ > +/* { dg-do run } */ > +/* { dg-options "-O -fprofile-generate=3D./" } */ > +/* { dg-final { scan-file pr47793.gcda "."} } */ > + > +int > +main(void) > +{ > + =A0return 0; > +} > + > +/* { dg-final { cleanup-coverage-files } } */ > Index: gcc/libgcov.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc/libgcov.c =A0 =A0 =A0 (revision 172439) > +++ gcc/libgcov.c =A0 =A0 =A0 (working copy) > @@ -283,8 +283,9 @@ gcov_exit (void) > =A0 =A0 =A0 =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 /* Update complete filename with stripped original. */ > - =A0 =A0 =A0if (!IS_DIR_SEPARATOR (*fname) && !HAS_DRIVE_SPEC(fname)) > - =A0 =A0 =A0 { > + =A0 =A0 =A0if (prefix_length !=3D 0 && !IS_DIR_SEPARATOR (*fname)) > + =A0 =A0 =A0 =A0{ > + =A0 =A0 =A0 =A0 =A0/* If prefix is given, add directory separator. =A0*/ > =A0 =A0 =A0 =A0 =A0strcpy (gi_filename_up, "/"); > =A0 =A0 =A0 =A0 =A0strcpy (gi_filename_up + 1, fname); > =A0 =A0 =A0 =A0} > > -- > This patch is available for review at http://codereview.appspot.com/44340= 55 >