public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] options: Make -Ofast switch off -fsemantic-interposition
@ 2021-11-12 15:38 Martin Jambor
  2021-11-12 15:40 ` Jan Hubicka
  2021-11-12 22:14 ` Martin Jambor
  0 siblings, 2 replies; 7+ messages in thread
From: Martin Jambor @ 2021-11-12 15:38 UTC (permalink / raw)
  To: GCC Patches; +Cc: Richard Biener, Jan Hubicka, Jan Hubicka

Hi,

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.

I have verified that with the following patch IPA-CP sees
flag_semantic_interposition set to zero at Ofast and that info and pdf
manual builds fine with the documentation change.  I am bootstrapping
and testing it now in order to comply with submission criteria but I
don't think an Ofast change gets much tested.

Assuming it passes, is the patch OK?  (If it is, I will also add a note
about it in the "Caveats" section in gcc-12/changes.html of wwwdocs
after I commit the patch.)

Thanks,

Martin


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 | 1 +
 gcc/opts.c          | 1 +
 2 files changed, 2 insertions(+)

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 2ea23d07c4c..fd16c91aec8 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10551,6 +10551,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 caed6255500..3da53d8f890 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 }
   };
-- 
2.33.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-05-11 21:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12 15:38 [PATCH] options: Make -Ofast switch off -fsemantic-interposition Martin Jambor
2021-11-12 15:40 ` Jan Hubicka
2021-11-12 22:14 ` Martin Jambor
2021-11-18 17:31   ` Jan Hubicka
2021-11-19 11:51     ` Jan Hubicka
2021-11-19 17:55       ` Martin Jambor
2022-05-11 21:25         ` Fāng-ruì Sòng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).