aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2025-04-08 11:53:34 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2025-04-08 11:53:34 +0200
commit15baa0055601a00b77e2e0ed6259bbc9e5ea5fa9 (patch)
treee36b35b503feab7cebc006e10c44e884eb89f0b4
parent29ed33631f0eb4c88c8b253d5245958304102217 (diff)
downloadgcc-15baa0055601a00b77e2e0ed6259bbc9e5ea5fa9.zip
gcc-15baa0055601a00b77e2e0ed6259bbc9e5ea5fa9.tar.gz
gcc-15baa0055601a00b77e2e0ed6259bbc9e5ea5fa9.tar.bz2
lto: Add & ~CF_SET into lto-opts.cc [PR119625]
The following patch uses & ~CF_SET so that we get the -fcf-protection= options into .gnu.lto_.opts section even when it has CF_SET bit set. 2025-04-08 Jakub Jelinek <jakub@redhat.com> PR lto/119625 * lto-opts.cc (lto_write_options): Mask of CF_SET from global_options.x_flag_cf_protection.
-rw-r--r--gcc/lto-opts.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/lto-opts.cc b/gcc/lto-opts.cc
index 3959598..62a3fb2 100644
--- a/gcc/lto-opts.cc
+++ b/gcc/lto-opts.cc
@@ -97,7 +97,7 @@ lto_write_options (void)
if (!OPTION_SET_P (flag_cf_protection))
{
const char *cf_protection = NULL;
- switch (global_options.x_flag_cf_protection)
+ switch (global_options.x_flag_cf_protection & ~CF_SET)
{
case CF_NONE: cf_protection = "-fcf-protection=none"; break;
case CF_FULL: cf_protection = "-fcf-protection=full"; break;