This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH]: Fix -enable-coverage


Hi,
my recent local_tick patch breaks enable-coverage, because object
file comparison now fails. Fixed thusly, along with a couple of
other tweaks.

tested on i686-pc-linux-gnu, installed

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
         The voices in my head said this was stupid too
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2003-07-07  Nathan Sidwell  <nathan@codesourcery.com>

	* configure.in (enable_coverage): Remove -DSELF_COVERAGE, add
	-frandom-seed.
	* configure: Regenerated.
	* Makefile.in: Remove extraneous comment.
	* toplev.c (randomize): Protect against potential multiple calls.
	* doc/invoke.texi (-frandom-seed): Document use for in coverage
	files.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.695
diff -c -3 -p -r1.695 configure.in
*** configure.in	4 Jul 2003 18:18:49 -0000	1.695
--- configure.in	7 Jul 2003 08:56:13 -0000
*************** AC_ARG_ENABLE(coverage,
*** 430,439 ****
  			  default is noopt],
  [case "${enableval}" in
  yes|noopt)
! 	coverage_flags="-fprofile-arcs -ftest-coverage -O0 -DSELF_COVERAGE=1"
  	;;
  opt)
! 	coverage_flags="-fprofile-arcs -ftest-coverage -O2 -DSELF_COVERAGE=2"
  	;;
  *)
  	AC_MSG_ERROR(unknown coverage setting $enableval)
--- 430,439 ----
  			  default is noopt],
  [case "${enableval}" in
  yes|noopt)
! 	coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O0"
  	;;
  opt)
! 	coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O2"
  	;;
  *)
  	AC_MSG_ERROR(unknown coverage setting $enableval)
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.1100
diff -c -3 -p -r1.1100 Makefile.in
*** Makefile.in	5 Jul 2003 00:23:46 -0000	1.1100
--- Makefile.in	7 Jul 2003 08:56:25 -0000
*************** BOOT_CFLAGS = -g -O2
*** 123,130 ****
  
  # Flags to determine code coverage. When coverage is disabled, this will
  # contain the optimization flags, as you normally want code coverage
! # without optimization. The -dumpbase $@ makes sure that the auxilary
! # files end up near the object files.
  COVERAGE_FLAGS = @coverage_flags@
  coverageexts = .{da,bbg}
  
--- 123,129 ----
  
  # Flags to determine code coverage. When coverage is disabled, this will
  # contain the optimization flags, as you normally want code coverage
! # without optimization.
  COVERAGE_FLAGS = @coverage_flags@
  coverageexts = .{da,bbg}
  
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.798
diff -c -3 -p -r1.798 toplev.c
*** toplev.c	6 Jul 2003 14:48:56 -0000	1.798
--- toplev.c	7 Jul 2003 08:56:35 -0000
*************** randomize (void)
*** 1600,1606 ****
        sprintf (random_seed, HOST_WIDE_INT_PRINT_HEX, value);
        flag_random_seed = random_seed;
      }
!   else
      local_tick = -1;
  }
  
--- 1600,1606 ----
        sprintf (random_seed, HOST_WIDE_INT_PRINT_HEX, value);
        flag_random_seed = random_seed;
      }
!   else if (!local_tick)
      local_tick = -1;
  }
  
Index: doc/invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v
retrieving revision 1.308
diff -c -3 -p -r1.308 invoke.texi
*** doc/invoke.texi	5 Jul 2003 00:19:47 -0000	1.308
--- doc/invoke.texi	7 Jul 2003 08:57:07 -0000
*************** Dump after function inlining, to @file{@
*** 3323,3330 ****
  @item -frandom-seed=@var{string}
  @opindex frandom-string
  This option provides a seed that GCC uses when it would otherwise use
! random numbers.  At present, this is used to generate certain symbol names
! that have to be different in every compiled file.
  
  The @var{string} should be different for every file you compile.
  
--- 3323,3333 ----
  @item -frandom-seed=@var{string}
  @opindex frandom-string
  This option provides a seed that GCC uses when it would otherwise use
! random numbers.  It is used to generate certain symbol names
! that have to be different in every compiled file. It is also used to
! place unique stamps in coverage data files and the object files that
! produce them. You can use the @option{-frandom-seed} option to produce
! reproducibly identical object files.
  
  The @var{string} should be different for every file you compile.
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]