From: Martin Liska Date: Thu, 6 Oct 2016 07:34:23 +0000 (+0200) Subject: Add -fprofile-update option juggling X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2d5edbede6495f09b26123d8b71f217ea480c496;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 965f54d9254..aa41f37050c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-10-06 Martin Liska + + * 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 PR bootstrap/77788 diff --git a/gcc/gcc.c b/gcc/gcc.c index fd2b182edc6..5213cb0fafa 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()} "