configure.in (enable-coverage): Add SELF_COVERAGE.
authorNathan Sidwell <nathan@codesourcery.com>
Tue, 24 Dec 2002 18:44:00 +0000 (18:44 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Tue, 24 Dec 2002 18:44:00 +0000 (18:44 +0000)
* configure.in (enable-coverage): Add SELF_COVERAGE.
* profile.c (end_branch_prob): Use SELF_COVERAGE.

From-SVN: r60476

gcc/ChangeLog
gcc/configure.in
gcc/profile.c

index e23c31a95b260aa63a5fdfdbe9af0a559abb5097..0648c6f260c2aea986dddaec78c79a8092c96a09 100644 (file)
@@ -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.
index cb220f2078a1e8b9d5828e217f85347c46faf5f7..4a9e463da24ae49a797888cb61cca53fc1651eb4 100644 (file)
@@ -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)
index 4e6aecd6b64be8811f0b565cc1aac5fcae3ba416..2e705980f12a9a36e548d3e2233295656e908c7e 100644 (file)
@@ -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);