Disable ipa-modref with live patching
authorJan Hubicka <jh@suse.cz>
Fri, 25 Sep 2020 22:05:53 +0000 (00:05 +0200)
committerJan Hubicka <jh@suse.cz>
Fri, 25 Sep 2020 22:05:53 +0000 (00:05 +0200)
2020-09-26  Jan Hubicka  <hubicka@ucw.cz>

* doc/invoke.texi: Add -fno-ipa-modref to flags disabled by
-flive-patching.
* opts.c (control_options_for_live_patching): Disable ipa-modref.

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

index 2091e0cd23b95fc6c2ae34ce90bd555b7c012e44..226b0e1dc91d8f09a1f452f6eceaa0d5d5568bd3 100644 (file)
@@ -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
 
index 3c4a0b540b490abd99d0c00287bb970e355cd9e1..3bda59afced1dfae7b9dadc181209424a8ee3c24 100644 (file)
@@ -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.  */