+2018-02-06 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
+
+ PR target/84145
+ * config/i386/i386.c: Reimplement the check of possible options
+ -mibt/-mshstk conbination. Change error messages.
+ * doc/invoke.texi: Fix a typo: remove extra '='.
+
2018-02-06 Marek Polacek <polacek@redhat.com>
PR tree-optimization/84228
/* Do not support control flow instrumentation if CET is not enabled. */
if (opts->x_flag_cf_protection != CF_NONE)
{
- if (!(TARGET_IBT_P (opts->x_ix86_isa_flags2)
- || TARGET_SHSTK_P (opts->x_ix86_isa_flags)))
+ switch (flag_cf_protection)
{
- if (flag_cf_protection == CF_FULL)
+ case CF_NONE:
+ break;
+ case CF_BRANCH:
+ if (! TARGET_IBT_P (opts->x_ix86_isa_flags2))
{
- error ("%<-fcf-protection=full%> requires CET support "
- "on this target. Use -mcet or one of -mibt, "
- "-mshstk options to enable CET");
+ error ("%<-fcf-protection=branch%> requires Intel CET "
+ "support. Use -mcet or -mibt option to enable CET");
+ flag_cf_protection = CF_NONE;
+ return false;
}
- else if (flag_cf_protection == CF_BRANCH)
+ break;
+ case CF_RETURN:
+ if (! TARGET_SHSTK_P (opts->x_ix86_isa_flags))
{
- error ("%<-fcf-protection=branch%> requires CET support "
- "on this target. Use -mcet or one of -mibt, "
- "-mshstk options to enable CET");
+ error ("%<-fcf-protection=return%> requires Intel CET "
+ "support. Use -mcet or -mshstk option to enable CET");
+ flag_cf_protection = CF_NONE;
+ return false;
}
- else if (flag_cf_protection == CF_RETURN)
+ break;
+ case CF_FULL:
+ if ( ! TARGET_IBT_P (opts->x_ix86_isa_flags2)
+ || ! TARGET_SHSTK_P (opts->x_ix86_isa_flags))
{
- error ("%<-fcf-protection=return%> requires CET support "
- "on this target. Use -mcet or one of -mibt, "
+ error ("%<-fcf-protection=full%> requires Intel CET "
+ "support. Use -mcet or both of -mibt and "
"-mshstk options to enable CET");
+ flag_cf_protection = CF_NONE;
+ return false;
}
- flag_cf_protection = CF_NONE;
- return false;
+ break;
+ default:
+ gcc_unreachable ();
}
+
opts->x_flag_cf_protection =
(cf_protection_level) (opts->x_flag_cf_protection | CF_SET);
}
-fchkp-check-read -fchkp-check-write -fchkp-store-bounds @gol
-fchkp-instrument-calls -fchkp-instrument-marked-only @gol
-fchkp-use-wrappers -fchkp-flexible-struct-trailing-arrays@gol
--fcf-protection==@r{[}full@r{|}branch@r{|}return@r{|}none@r{]} @gol
+-fcf-protection=@r{[}full@r{|}branch@r{|}return@r{|}none@r{]} @gol
-fstack-protector -fstack-protector-all -fstack-protector-strong @gol
-fstack-protector-explicit -fstack-check @gol
-fstack-limit-register=@var{reg} -fstack-limit-symbol=@var{sym} @gol
against @file{libmpxwrappers}. See also @option{-static-libmpxwrappers}.
Enabled by default.
-@item -fcf-protection==@r{[}full@r{|}branch@r{|}return@r{|}none@r{]}
+@item -fcf-protection=@r{[}full@r{|}branch@r{|}return@r{|}none@r{]}
@opindex fcf-protection
Enable code instrumentation of control-flow transfers to increase
program security by checking that target addresses of control-flow
+2018-02-06 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
+
+ PR target/84145
+ * c-c++-common/fcf-protection-1.c: Change a compared message.
+ * c-c++-common/fcf-protection-2.c: Likewise.
+ * c-c++-common/fcf-protection-3.c: Likewise.
+ * c-c++-common/fcf-protection-5.c: Likewise.
+ * c-c++-common/fcf-protection-6.c: New test.
+ * c-c++-common/fcf-protection-7.c: Likewise.
+
2018-02-06 Marek Polacek <polacek@redhat.com>
PR tree-optimization/84228
/* { dg-do compile } */
/* { dg-options "-fcf-protection=full" } */
-/* { dg-error "'-fcf-protection=full' requires CET support on this target" "" { target { "i?86-*-* x86_64-*-*" } } 0 } */
+/* { dg-error "'-fcf-protection=full' requires Intel CET.*-mcet.*-mibt and -mshstk option" "" { target { "i?86-*-* x86_64-*-*" } } 0 } */
/* { dg-error "'-fcf-protection=full' is not supported for this target" "" { target { ! "i?86-*-* x86_64-*-*" } } 0 } */
/* { dg-do compile } */
/* { dg-options "-fcf-protection=branch" } */
-/* { dg-error "'-fcf-protection=branch' requires CET support on this target" "" { target { "i?86-*-* x86_64-*-*" } } 0 } */
+/* { dg-error "'-fcf-protection=branch' requires Intel CET.*-mcet or -mibt option" "" { target { "i?86-*-* x86_64-*-*" } } 0 } */
/* { dg-error "'-fcf-protection=branch' is not supported for this target" "" { target { ! "i?86-*-* x86_64-*-*" } } 0 } */
/* { dg-do compile } */
/* { dg-options "-fcf-protection=return" } */
-/* { dg-error "'-fcf-protection=return' requires CET support on this target" "" { target { "i?86-*-* x86_64-*-*" } } 0 } */
+/* { dg-error "'-fcf-protection=return' requires Intel CET.*-mcet or -mshstk option" "" { target { "i?86-*-* x86_64-*-*" } } 0 } */
/* { dg-error "'-fcf-protection=return' is not supported for this target" "" { target { ! "i?86-*-* x86_64-*-*" } } 0 } */
/* { dg-do compile } */
/* { dg-options "-fcf-protection" } */
-/* { dg-error "'-fcf-protection=full' requires CET support on this target" "" { target { "i?86-*-* x86_64-*-*" } } 0 } */
+/* { dg-error "'-fcf-protection=full' requires Intel CET.*-mcet.*-mibt and -mshstk option" "" { target { "i?86-*-* x86_64-*-*" } } 0 } */
/* { dg-error "'-fcf-protection=full' is not supported for this target" "" { target { ! "i?86-*-* x86_64-*-*" } } 0 } */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-fcf-protection=branch -mshstk" } */
+/* { dg-error "'-fcf-protection=branch' requires Intel CET.*-mcet or -mibt option" "" { target { "i?86-*-* x86_64-*-*" } } 0 } */
+/* { dg-error "'-fcf-protection=branch' is not supported for this target" "" { target { ! "i?86-*-* x86_64-*-*" } } 0 } */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-fcf-protection=return -mibt" } */
+/* { dg-error "'-fcf-protection=return' requires Intel CET.*-mcet or -mshstk option" "" { target { "i?86-*-* x86_64-*-*" } } 0 } */
+/* { dg-error "'-fcf-protection=return' is not supported for this target" "" { target { ! "i?86-*-* x86_64-*-*" } } 0 } */