aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2018-02-07 10:48:39 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2018-02-07 02:48:39 -0800
commit6ad05bcc3e3c5f80fac077423dd222cf850f9096 (patch)
treefb65b769279b39cfaf9eea29fe3a481f48e027b5 /gcc
parentc31bc4ac378f56593caae12bba086a98d002bb64 (diff)
downloadgcc-6ad05bcc3e3c5f80fac077423dd222cf850f9096.zip
gcc-6ad05bcc3e3c5f80fac077423dd222cf850f9096.tar.gz
gcc-6ad05bcc3e3c5f80fac077423dd222cf850f9096.tar.bz2
i386: Mask out the CF_SET bit for -fcf-protection check
Since ix86_option_override_internal sets the CF_SET bit in flag_cf_protection and it can be called more than once via pragma, we need to mask out the CF_SET bit when checking flag_cf_protection. PR target/84248 * config/i386/i386.c (ix86_option_override_internal): Mask out the CF_SET bit when checking -fcf-protection. From-SVN: r257444
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/i386/i386.c10
2 files changed, 11 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1caefb6..51c45c0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2018-02-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/84248
+ * config/i386/i386.c (ix86_option_override_internal): Mask out
+ the CF_SET bit when checking -fcf-protection.
+
2018-02-07 Tom de Vries <tom@codesourcery.com>
PR libgomp/84217
@@ -165,7 +171,6 @@
%1, %0<mask_scalar_operand4>|%0<mask_scalar_operand4>, %1,
%2<round_saeonly_scalar_mask_op4>, %3}"): ... this.
->>>>>>> .r257416
2018-02-02 Andrew Jenner <andrew@codesourcery.com>
* config/powerpcspe/powerpcspe.opt: Add Undocumented to irrelevant
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index faa9d94..fc3d6f0 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -4909,12 +4909,12 @@ ix86_option_override_internal (bool main_args_p,
= build_target_option_node (opts);
/* Do not support control flow instrumentation if CET is not enabled. */
- if (opts->x_flag_cf_protection != CF_NONE)
+ cf_protection_level cf_protection
+ = (cf_protection_level) (opts->x_flag_cf_protection & ~CF_SET);
+ if (cf_protection != CF_NONE)
{
- switch (flag_cf_protection)
+ switch (cf_protection)
{
- case CF_NONE:
- break;
case CF_BRANCH:
if (! TARGET_IBT_P (opts->x_ix86_isa_flags2))
{
@@ -4949,7 +4949,7 @@ ix86_option_override_internal (bool main_args_p,
}
opts->x_flag_cf_protection =
- (cf_protection_level) (opts->x_flag_cf_protection | CF_SET);
+ (cf_protection_level) (cf_protection | CF_SET);
}
if (ix86_tune_features [X86_TUNE_AVOID_128FMA_CHAINS])