aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2018-05-29 14:11:21 +0200
committerMartin Liska <marxin@gcc.gnu.org>2018-05-29 12:11:21 +0000
commit0e8f29daae817560fa28935f23150307abee8f43 (patch)
treedae6fb571218c28f4bd4fc966f8b044443aebbc7 /libgcc
parente379122d1f078d230514ff862c4f9053c2898af4 (diff)
downloadgcc-0e8f29daae817560fa28935f23150307abee8f43.zip
gcc-0e8f29daae817560fa28935f23150307abee8f43.tar.gz
gcc-0e8f29daae817560fa28935f23150307abee8f43.tar.bz2
libgcov: report about a different timestamp (PR gcov-profile/85759).
2018-05-29 Martin Liska <mliska@suse.cz> PR gcov-profile/85759 * doc/gcov.texi: Document GCOV_ERROR_FILE and GCOV_EXIT_AT_ERROR env variables. 2018-05-29 Martin Liska <mliska@suse.cz> PR gcov-profile/85759 * libgcov-driver-system.c (gcov_error): Introduce usage of GCOV_EXIT_AT_ERROR env. variable. * libgcov-driver.c (merge_one_data): Print error that we overwrite a gcov file with a different timestamp. From-SVN: r260895
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/ChangeLog8
-rw-r--r--libgcc/libgcov-driver-system.c10
-rw-r--r--libgcc/libgcov-driver.c8
3 files changed, 23 insertions, 3 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 1b24190..7394b1f 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,11 @@
+2018-05-29 Martin Liska <mliska@suse.cz>
+
+ PR gcov-profile/85759
+ * libgcov-driver-system.c (gcov_error): Introduce usage of
+ GCOV_EXIT_AT_ERROR env. variable.
+ * libgcov-driver.c (merge_one_data): Print error that we
+ overwrite a gcov file with a different timestamp.
+
2018-05-23 Kalamatee <kalamatee@gmail.com>
* config/m68k/lb1sf68.S (Laddsf$nf): Fix sign bit handling in
diff --git a/libgcc/libgcov-driver-system.c b/libgcc/libgcov-driver-system.c
index 0df4423..bf12586 100644
--- a/libgcc/libgcov-driver-system.c
+++ b/libgcc/libgcov-driver-system.c
@@ -62,8 +62,16 @@ gcov_error (const char *fmt, ...)
va_list argp;
va_start (argp, fmt);
- ret = vfprintf (get_gcov_error_file (), fmt, argp);
+ FILE *f = get_gcov_error_file ();
+ ret = vfprintf (f, fmt, argp);
va_end (argp);
+
+ if (getenv ("GCOV_EXIT_AT_ERROR"))
+ {
+ fprintf (f, "profiling:exiting after an error\n");
+ exit (1);
+ }
+
return ret;
}
diff --git a/libgcc/libgcov-driver.c b/libgcc/libgcov-driver.c
index b4f195b..6103563 100644
--- a/libgcc/libgcov-driver.c
+++ b/libgcc/libgcov-driver.c
@@ -372,8 +372,12 @@ merge_one_data (const char *filename,
length = gcov_read_unsigned ();
if (length != gi_ptr->stamp)
- /* Read from a different compilation. Overwrite the file. */
- return 0;
+ {
+ /* Read from a different compilation. Overwrite the file. */
+ gcov_error ("profiling:%s:overwriting an existing profile data "
+ "with a different timestamp\n", filename);
+ return 0;
+ }
/* Look for program summary. */
for (f_ix = 0;;)