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]

Re: RFA: profile.c USE_MAPPED_LOCATION support


Hi -


hubicka wrote:

> There are few failures due to bugs in the testsuite itself already fixed
> on tree-profiling, so in the case you get at least few passes, it is
> fine.  (if you break line numbering you will likely get all failures)

OK, I'm committing a minor variant of the original gcc/profile.c patch.

> The overall goal is to switch to tree based coverage soon and kill the
> rtl based coverage code too, but in the case you want to extend the
> testuiste to test both for time being, you are welcome to do that too.

OK, I'm committing the following testsuite patch.  At the moment,
it generates some failures for the tree-profiling iteration.


+2004-09-16  Frank Ch. Eigler  <fche@redhat.com>
+
+	* gcc.misc-tests/bprob.exp, g++.dg/bprob/bprob.exp: Iterate tests
+	with -ftree-based-profiling also.
+	* lib/profopt.exp: Support late-set profile_option/feedback_option.
+

Index: g++.dg/bprob/bprob.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.dg/bprob/bprob.exp,v
retrieving revision 1.8
diff -u -w -s -r1.8 bprob.exp
--- g++.dg/bprob/bprob.exp	21 Feb 2004 02:58:23 -0000	1.8
+++ g++.dg/bprob/bprob.exp	16 Sep 2004 19:31:08 -0000
@@ -1,4 +1,4 @@
-#   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+#   Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -27,8 +27,6 @@
 
 # The procedures in profopt.exp need these parameters.
 set tool g++
-set profile_option -fprofile-arcs
-set feedback_option -fbranch-probabilities
 set prof_ext gcda
 
 if $tracelevel then {
@@ -52,12 +50,20 @@
 # Load support procs.
 load_lib profopt.exp
 
+set profile_options "-fprofile-arcs"
+set feedback_options "-fbranch-probabilities"
+if {[check_profiling_available "-ftree-based-profiling"]} {
+    lappend profile_options "-ftree-based-profiling -fprofile-arcs"
+    lappend feedback_options "-ftree-based-profiling -fbranch-probabilities"
+}
+
 # Main loop.
+foreach profile_option $profile_options feedback_option $feedback_options {
 foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.C]] {
     # If we're only testing specific files and this isn't one of them, skip it.
     if ![runtest_file_p $runtests $src] then {
 	continue
     }
-
     profopt-execute $src
 }
+}
Index: gcc.misc-tests/bprob.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.misc-tests/bprob.exp,v
retrieving revision 1.9
diff -u -w -s -r1.9 bprob.exp
--- gcc.misc-tests/bprob.exp	21 Feb 2004 02:58:24 -0000	1.9
+++ gcc.misc-tests/bprob.exp	16 Sep 2004 19:31:20 -0000
@@ -1,4 +1,4 @@
-#   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+#   Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -27,8 +27,6 @@
 
 # The procedures in profopt.exp need these parameters.
 set tool gcc
-set profile_option -fprofile-arcs
-set feedback_option -fbranch-probabilities
 set prof_ext gcda
 set perf_ext tim
 
@@ -49,11 +47,19 @@
 # Load support procs.
 load_lib profopt.exp
 
+set profile_options "-fprofile-arcs"
+set feedback_options "-fbranch-probabilities"
+if {[check_profiling_available "-ftree-based-profiling"]} {
+    lappend profile_options "-ftree-based-profiling -fprofile-arcs"
+    lappend feedback_options "-ftree-based-profiling -fbranch-probabilities"
+}
+
+foreach profile_option $profile_options feedback_option $feedback_options {
 foreach src [lsort [glob -nocomplain $srcdir/$subdir/bprob-*.c]] {
     # If we're only testing specific files and this isn't one of them, skip it.
     if ![runtest_file_p $runtests $src] then {
 	continue
     }
-
     profopt-execute $src
 }
+}
Index: lib/profopt.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/profopt.exp,v
retrieving revision 1.4
diff -u -w -s -r1.4 profopt.exp
--- lib/profopt.exp	31 Dec 2002 20:00:44 -0000	1.4
+++ lib/profopt.exp	16 Sep 2004 19:31:21 -0000
@@ -1,4 +1,4 @@
-#   Copyright (C) 2001 Free Software Foundation, Inc.
+#   Copyright (C) 2001, 2004 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -37,12 +37,6 @@
 if ![info exists tool] {
     error "Tools is not specified."
 }
-if ![info exists profile_option] {
-    error "No profile option specified for first compile."
-}
-if ![info exists feedback_option] {
-    error "No feedback option specified for second compile."
-}
 if ![info exists prof_ext] {
     error "No profile data file extension specified."
 }
@@ -130,6 +124,13 @@
     global tool profile_option feedback_option prof_ext perf_ext perf_delta
     global verbose
 
+    if ![info exists profile_option] {
+        error "No profile option specified for first compile."
+    }
+    if ![info exists feedback_option] {
+        error "No feedback option specified for second compile."
+    }
+
     regsub "^$srcdir/?" $src "" testcase
     # If we couldn't rip $srcdir out of `src' then just do the best we can.
     # The point is to reduce the unnecessary noise in the logs.  Don't strip


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