From patchwork Fri Sep 25 22:07:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 1371623 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ucw.cz Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BymJ00r58z9sR4 for ; Sat, 26 Sep 2020 08:07:59 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6745D388A40A; Fri, 25 Sep 2020 22:07:56 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id 9351E385782E for ; Fri, 25 Sep 2020 22:07:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9351E385782E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=none smtp.mailfrom=hubicka@kam.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id B21CF28299E; Sat, 26 Sep 2020 00:07:51 +0200 (CEST) Date: Sat, 26 Sep 2020 00:07:51 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, d@dcepelik.cz Subject: Disable ipa-modref with -flive-patching Message-ID: <20200925220751.GB57232@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-15.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, ipa-modref propagates knowledge about callee to caller function. This is not compatible with live patching and thus this patch makes -flive-patching to imply -fno-ipa-modref. Bootstrapped/regtested x86_64-linux, comitted. gcc/ChangeLog: 2020-09-26 Jan Hubicka * doc/invoke.texi: Add -fno-ipa-modref to flags disabled by -flive-patching. * opts.c (control_options_for_live_patching): Disable ipa-modref. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 2091e0cd23b..226b0e1dc91 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -10879,7 +10879,7 @@ callers are impacted, therefore need to be patched as well. @gccoptlist{-fwhole-program -fipa-pta -fipa-reference -fipa-ra @gol -fipa-icf -fipa-icf-functions -fipa-icf-variables @gol -fipa-bit-cp -fipa-vrp -fipa-pure-const -fipa-reference-addressable @gol --fipa-stack-alignment} +-fipa-stack-alignment -fipa-modref} @item inline-only-static diff --git a/gcc/opts.c b/gcc/opts.c index 3c4a0b540b4..3bda59afced 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -792,6 +792,13 @@ control_options_for_live_patching (struct gcc_options *opts, else opts->x_flag_ipa_pure_const = 0; + if (opts_set->x_flag_ipa_modref && opts->x_flag_ipa_modref) + error_at (loc, + "%<-fipa-modref%> is incompatible with " + "%<-flive-patching=inline-only-static|inline-clone%>"); + else + opts->x_flag_ipa_modref = 0; + /* FIXME: disable unreachable code removal. */ /* discovery of functions/variables with no address taken. */