Commit 6ad05bcc by H.J. Lu Committed by H.J. Lu

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
parent c31bc4ac
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> 2018-02-07 Tom de Vries <tom@codesourcery.com>
PR libgomp/84217 PR libgomp/84217
...@@ -165,7 +171,6 @@ ...@@ -165,7 +171,6 @@
%1, %0<mask_scalar_operand4>|%0<mask_scalar_operand4>, %1, %1, %0<mask_scalar_operand4>|%0<mask_scalar_operand4>, %1,
%2<round_saeonly_scalar_mask_op4>, %3}"): ... this. %2<round_saeonly_scalar_mask_op4>, %3}"): ... this.
>>>>>>> .r257416
2018-02-02 Andrew Jenner <andrew@codesourcery.com> 2018-02-02 Andrew Jenner <andrew@codesourcery.com>
* config/powerpcspe/powerpcspe.opt: Add Undocumented to irrelevant * config/powerpcspe/powerpcspe.opt: Add Undocumented to irrelevant
......
...@@ -4909,12 +4909,12 @@ ix86_option_override_internal (bool main_args_p, ...@@ -4909,12 +4909,12 @@ ix86_option_override_internal (bool main_args_p,
= build_target_option_node (opts); = build_target_option_node (opts);
/* Do not support control flow instrumentation if CET is not enabled. */ /* 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: case CF_BRANCH:
if (! TARGET_IBT_P (opts->x_ix86_isa_flags2)) if (! TARGET_IBT_P (opts->x_ix86_isa_flags2))
{ {
...@@ -4949,7 +4949,7 @@ ix86_option_override_internal (bool main_args_p, ...@@ -4949,7 +4949,7 @@ ix86_option_override_internal (bool main_args_p,
} }
opts->x_flag_cf_protection = 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]) if (ix86_tune_features [X86_TUNE_AVOID_128FMA_CHAINS])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment