]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
options: Make -Ofast switch off -fsemantic-interposition
authorMartin Jambor <mjambor@suse.cz>
Fri, 19 Nov 2021 17:46:00 +0000 (18:46 +0100)
committerMartin Jambor <mjambor@suse.cz>
Fri, 19 Nov 2021 17:46:08 +0000 (18:46 +0100)
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  <mjambor@suse.cz>

* opts.c (default_options_table): Switch off
flag_semantic_interposition at Ofast.
* doc/invoke.texi (Optimize Options): Document that Ofast switches off
-fsemantic-interposition.

gcc/doc/invoke.texi
gcc/opts.c

index 11ef7970378739c29d36234d2ddce379e2a62263..1cfb70291f6891c16e019edd0a361fafdc6a85c0 100644 (file)
@@ -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
index 175b4635bb4d0e64597e1080e4458cfeb58538e8..b16497e45b3021729442fe184c8399ef490225c3 100644 (file)
@@ -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 }
   };