summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-24 18:44:00 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-24 18:44:00 +0000
commit339872242b1d90bbdf17b7287bb1e137ecde71be (patch)
tree7cdad046b41fedb412d7f53b90b2d0ed1c3dc3ac
parent11a0151c0fc10d45ee589ccf27cadf6b411a1d0f (diff)
downloadppe42-gcc-339872242b1d90bbdf17b7287bb1e137ecde71be.tar.gz
ppe42-gcc-339872242b1d90bbdf17b7287bb1e137ecde71be.zip
* configure.in (enable-coverage): Add SELF_COVERAGE.
* profile.c (end_branch_prob): Use SELF_COVERAGE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60476 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/configure.in6
-rw-r--r--gcc/profile.c17
3 files changed, 13 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e23c31a95b2..0648c6f260c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2002-12-24 Nathan Sidwell <nathan@codesourcery.com>
+
+ * configure.in (enable-coverage): Add SELF_COVERAGE.
+ * profile.c (end_branch_prob): Use SELF_COVERAGE.
+
2002-12-24 Jim Wilson <wilson@redhat.com>
* alias.c (record_set): Handle multi-reg hard registers.
diff --git a/gcc/configure.in b/gcc/configure.in
index cb220f2078a..4a9e463da24 100644
--- a/gcc/configure.in
+++ b/gcc/configure.in
@@ -364,15 +364,15 @@ AC_ARG_ENABLE(coverage,
[ --enable-coverage[=LEVEL]
enable compiler\'s code coverage collection.
Use to measure compiler performance and locate
- unused parts of the compiler. With LEVEL, specificy
+ unused parts of the compiler. With LEVEL, specify
optimization. Values are opt, noopt,
default is noopt],
[case "${enableval}" in
yes|noopt)
- coverage_flags="-fprofile-arcs -ftest-coverage -O0"
+ coverage_flags="-fprofile-arcs -ftest-coverage -O0 -DSELF_COVERAGE=1"
;;
opt)
- coverage_flags="-fprofile-arcs -ftest-coverage -O2"
+ coverage_flags="-fprofile-arcs -ftest-coverage -O2 -DSELF_COVERAGE=2"
;;
*)
AC_MSG_ERROR(unknown coverage setting $enableval)
diff --git a/gcc/profile.c b/gcc/profile.c
index 4e6aecd6b64..2e705980f12 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -1428,18 +1428,11 @@ end_branch_prob ()
{
if (bbg_file)
{
-#if __GNUC__ && !CROSS_COMPILE && SUPPORTS_WEAK
- /* If __gcov_init has a value in the compiler, it means we
- are instrumenting ourselves. We should not remove the
- counts file, because we might be recompiling
- ourselves. The .da files are all removed during copying
- the stage1 files. */
- extern void __gcov_init (void *)
- __attribute__ ((weak));
-
- if (!__gcov_init)
- unlink (da_file_name);
-#else
+#if !SELF_COVERAGE
+ /* If the compiler is instrumented, we should not remove the
+ counts file, because we might be recompiling
+ ourselves. The .da files are all removed during copying
+ the stage1 files. */
unlink (da_file_name);
#endif
fclose (bbg_file);
OpenPOWER on IntegriCloud