From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1611) id B3ED6385C40A; Fri, 19 Nov 2021 17:47:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B3ED6385C40A MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Martin Jambor To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-5412] options: Make -Ofast switch off -fsemantic-interposition X-Act-Checkin: gcc X-Git-Author: Martin Jambor X-Git-Refname: refs/heads/master X-Git-Oldrev: ada63d56beb0e535d35b165b55f85e29a0b36929 X-Git-Newrev: 458d2c689963d8461d84670a3d8988cd6ecbfd81 Message-Id: <20211119174725.B3ED6385C40A@sourceware.org> Date: Fri, 19 Nov 2021 17:47:25 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2021 17:47:25 -0000 https://gcc.gnu.org/g:458d2c689963d8461d84670a3d8988cd6ecbfd81 commit r12-5412-g458d2c689963d8461d84670a3d8988cd6ecbfd81 Author: Martin Jambor Date: Fri Nov 19 18:46:00 2021 +0100 options: Make -Ofast switch off -fsemantic-interposition Using -fno-semantic-interposition has been reported by various people to bring about considerable speed up at the cost of strict compliance to the ELF symbol interposition rules See for example https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup As such I believe it should be implied by our -Ofast optimization level, not only so that benchmarks that can benefit run faster, but also so that people looking at -Ofast documentation for options that could speed their programs find it. gcc/ChangeLog: 2021-11-12 Martin Jambor * opts.c (default_options_table): Switch off flag_semantic_interposition at Ofast. * doc/invoke.texi (Optimize Options): Document that Ofast switches off -fsemantic-interposition. Diff: --- gcc/doc/invoke.texi | 1 + gcc/opts.c | 1 + 2 files changed, 2 insertions(+) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 11ef7970378..1cfb70291f6 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -10677,6 +10677,7 @@ valid for all standard-compliant programs. It turns on @option{-ffast-math}, @option{-fallow-store-data-races} and the Fortran-specific @option{-fstack-arrays}, unless @option{-fmax-stack-var-size} is specified, and @option{-fno-protect-parens}. +It turns off @option {-fsemantic-interposition}. @item -Og @opindex Og diff --git a/gcc/opts.c b/gcc/opts.c index 175b4635bb4..b16497e45b3 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -682,6 +682,7 @@ static const struct default_options default_options_table[] = /* -Ofast adds optimizations to -O3. */ { OPT_LEVELS_FAST, OPT_ffast_math, NULL, 1 }, { OPT_LEVELS_FAST, OPT_fallow_store_data_races, NULL, 1 }, + { OPT_LEVELS_FAST, OPT_fsemantic_interposition, NULL, 0 }, { OPT_LEVELS_NONE, 0, NULL, 0 } };