aboutsummaryrefslogtreecommitdiff
path: root/gcc/common.opt
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-11-13 17:47:40 +0100
committerMartin Liska <mliska@suse.cz>2020-11-16 12:52:14 +0100
commit27f7fb79d27bd4a4a7f04d4970c06e9050a6564e (patch)
tree4af8d2df27787d146b742cc8cde93ea3e668c084 /gcc/common.opt
parentd0a206abc6cbf0e992bf82bbb3584686eae05d34 (diff)
downloadgcc-27f7fb79d27bd4a4a7f04d4970c06e9050a6564e.zip
gcc-27f7fb79d27bd4a4a7f04d4970c06e9050a6564e.tar.gz
gcc-27f7fb79d27bd4a4a7f04d4970c06e9050a6564e.tar.bz2
gcov: Add -fprofile-info-section support
Register the profile information in the specified section instead of using a constructor/destructor. A pointer to the profile information generated by -fprofile-arcs or -ftest-coverage is placed in the specified section for each translation unit. This option disables the profile information registration through a constructor and it disables the profile information processing through a destructor. I am not sure how I can test this option. One approach would be to assemble a test file, then scan it and check that a .gcov_info section is present and no __gcov_init() and __gcov_exit() calls are present. Is there an example for this in the test suite? gcc/ * common.opt (fprofile-info-section): New. * coverage.c (build_gcov_info_var_registration): New. (coverage_obj_init): Evaluate profile_info_section and use build_gcov_info_var_registration(). * doc/invoke.texi (fprofile-info-section): Document. * opts.c (common_handle_option): Process fprofile-info-section option. gcc/testsuite/ChangeLog: * gcc.dg/profile-info-section.c: New test.
Diffstat (limited to 'gcc/common.opt')
-rw-r--r--gcc/common.opt8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/common.opt b/gcc/common.opt
index 9552ceb..fe39b3d 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -2272,6 +2272,14 @@ fprofile-generate=
Common Joined RejectNegative
Enable common options for generating profile info for profile feedback directed optimizations, and set -fprofile-dir=.
+fprofile-info-section
+Common RejectNegative
+Register the profile information in the .gcov_info section instead of using a constructor/destructor.
+
+fprofile-info-section=
+Common Joined RejectNegative Var(profile_info_section)
+Register the profile information in the specified section instead of using a constructor/destructor.
+
fprofile-partial-training
Common Report Var(flag_profile_partial_training) Optimization
Do not assume that functions never executed during the train run are cold.