From 42870a86829f9d6dd326d318a3a028fbceb88d94 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 5 Dec 2019 10:08:44 +0100 Subject: [PATCH] Fix profile name files without -fprofile-dir. 2019-12-05 Martin Liska PR gcov-profile/91971 * coverage.c (coverage_init): Mangle full path only when -fprofile-dir is used. From-SVN: r278990 --- gcc/ChangeLog | 6 ++++++ gcc/coverage.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9bb76236d24..b736bb291d4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-12-05 Martin Liska + + PR gcov-profile/91971 + * coverage.c (coverage_init): Mangle full path + only when -fprofile-dir is used. + 2019-12-05 Jakub Jelinek PR target/92791 diff --git a/gcc/coverage.c b/gcc/coverage.c index b8b20ddc8e3..2cdbb0172c9 100644 --- a/gcc/coverage.c +++ b/gcc/coverage.c @@ -1228,7 +1228,7 @@ coverage_init (const char *filename) else profile_data_prefix = getpwd (); } - else + else if (profile_data_prefix != NULL) { /* when filename is a absolute path, we also need to mangle the full path of filename to prevent the profiling data being stored into a -- 2.30.2