From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 58C25385840F for ; Fri, 12 Nov 2021 15:38:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 58C25385840F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 217F71FD66; Fri, 12 Nov 2021 15:38:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1636731528; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=sR+wv4WpFX+vK+CGe1c6szY5XXdEK6jMDMCi243yeSk=; b=VfVyvXG8hgOtkdNnel/oIIqKnodLTrzDYuojl9ERvGgMdVeu98ygbZ2UZ3CCFxb74fRxv0 T7Gpr8sHTKWQObGeOE5AH5Hp5y4JZznt4BXGJvb8eGMteWrkoywwa18zHc1IGY1xk7EDfo m5Y7YLXnsCFMJ9A/e/XvlMijPN7y1d4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1636731528; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=sR+wv4WpFX+vK+CGe1c6szY5XXdEK6jMDMCi243yeSk=; b=bEuRBBPDU8SgvA9GIvT9g1Wzjto63FgRozfcYEPQhGDiRvGC6R8SC8KIeFW7wzna04Ntnq dPEruM/uCDyPLKCw== Received: from suse.cz (virgil.suse.cz [10.100.13.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 0E66FA3B8F; Fri, 12 Nov 2021 15:38:48 +0000 (UTC) From: Martin Jambor To: GCC Patches Cc: Richard Biener , Jan Hubicka , Jan Hubicka Subject: [PATCH] options: Make -Ofast switch off -fsemantic-interposition User-Agent: Notmuch/0.33.2 (https://notmuchmail.org) Emacs/27.2 (x86_64-suse-linux-gnu) Date: Fri, 12 Nov 2021 16:38:47 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2021 15:38:50 -0000 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 * 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