aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2016-10-06 09:34:23 +0200
committerMartin Liska <marxin@gcc.gnu.org>2016-10-06 07:34:23 +0000
commit2d5edbede6495f09b26123d8b71f217ea480c496 (patch)
tree97ad3a491bd8418695043888a1687cb0b05df20b /gcc/gcc.c
parentac2a97db4b862579d6fea2e97000650bfe9b4659 (diff)
downloadgcc-2d5edbede6495f09b26123d8b71f217ea480c496.zip
gcc-2d5edbede6495f09b26123d8b71f217ea480c496.tar.gz
gcc-2d5edbede6495f09b26123d8b71f217ea480c496.tar.bz2
Add -fprofile-update option juggling
* gcc.c: Set -fprofile-update=atomic when profiling is enabled and -pthread is set. Warn when one combines -pthread and -fprofile-update=single for an app using profiling code. From-SVN: r240828
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index fd2b182..5213cb0 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1141,7 +1141,14 @@ static const char *cc1_options =
%{-help=*:--help=%*}\
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
%{fsyntax-only:-o %j} %{-param*}\
- %{coverage:-fprofile-arcs -ftest-coverage}";
+ %{coverage:-fprofile-arcs -ftest-coverage}\
+ %{fprofile-arcs|fprofile-generate*|coverage:\
+ %{!fprofile-update=single:\
+ %{pthread:-fprofile-update=atomic}}}\
+ %{fprofile-update=single:\
+ %{fprofile-arcs|fprofile-generate*|coverage:\
+ %{pthread:%n-fprofile-update=atomic should be used\
+ for a multithreaded application}}}";
static const char *asm_options =
"%{-target-help:%:print-asm-header()} "