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
This commit is contained in:
Martin Liska 2016-10-06 09:34:23 +02:00 committed by Martin Liska
parent ac2a97db4b
commit 2d5edbede6
2 changed files with 15 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2016-10-06 Martin Liska <mliska@suse.cz>
* 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.
2016-10-06 Martin Liska <mliska@suse.cz>
PR bootstrap/77788

View File

@ -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()} "