+2018-11-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/85644
+ PR target/86832
+ * config/i386/i386.c (ix86_option_override_internal): Default
+ ix86_stack_protector_guard to SSP_TLS only if TARGET_THREAD_SSP_OFFSET
+ is defined.
+ * config/i386/i386.md (stack_protect_set, stack_protect_set_<mode>,
+ stack_protect_test, stack_protect_test_<mode>): Use empty condition
+ instead of TARGET_SSP_TLS_GUARD.
+
2018-11-22 Martin Liska <mliska@suse.cz>
PR sanitizer/88017
/* Handle stack protector */
if (!opts_set->x_ix86_stack_protector_guard)
- opts->x_ix86_stack_protector_guard
- = TARGET_HAS_BIONIC ? SSP_GLOBAL : SSP_TLS;
+ {
+#ifdef TARGET_THREAD_SSP_OFFSET
+ if (!TARGET_HAS_BIONIC)
+ opts->x_ix86_stack_protector_guard = SSP_TLS;
+ else
+#endif
+ opts->x_ix86_stack_protector_guard = SSP_GLOBAL;
+ }
#ifdef TARGET_THREAD_SSP_OFFSET
ix86_stack_protector_guard_offset = TARGET_THREAD_SSP_OFFSET;
(define_expand "stack_protect_set"
[(match_operand 0 "memory_operand")
(match_operand 1 "memory_operand")]
- "TARGET_SSP_TLS_GUARD"
+ ""
{
rtx (*insn)(rtx, rtx);
UNSPEC_SP_SET))
(set (match_scratch:PTR 2 "=&r") (const_int 0))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_SSP_TLS_GUARD"
+ ""
"mov{<imodesuffix>}\t{%1, %2|%2, %1}\;mov{<imodesuffix>}\t{%2, %0|%0, %2}\;xor{l}\t%k2, %k2"
[(set_attr "type" "multi")])
[(match_operand 0 "memory_operand")
(match_operand 1 "memory_operand")
(match_operand 2)]
- "TARGET_SSP_TLS_GUARD"
+ ""
{
rtx flags = gen_rtx_REG (CCZmode, FLAGS_REG);
(match_operand:PTR 2 "memory_operand" "m")]
UNSPEC_SP_TEST))
(clobber (match_scratch:PTR 3 "=&r"))]
- "TARGET_SSP_TLS_GUARD"
+ ""
"mov{<imodesuffix>}\t{%1, %3|%3, %1}\;xor{<imodesuffix>}\t{%2, %3|%3, %2}"
[(set_attr "type" "multi")])