From: Uros Bizjak Date: Thu, 17 Aug 2017 19:39:20 +0000 (+0200) Subject: backport: re PR target/81861 (ASan pr64820.c testcase segfaults with LTO and -fstack... X-Git-Tag: releases/gcc-5.5.0~116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6703b4bafd0f01a326630a43c7635f3d862fb560;p=thirdparty%2Fgcc.git backport: re PR target/81861 (ASan pr64820.c testcase segfaults with LTO and -fstack-protector-strong) Backport from mainline 2017-08-17 Maxim Ostapenko PR target/81861 * config/i386/i386.c (ix86_option_override_internal): Save target specific options after ix86_stack_protector_guard_reg was changed. From-SVN: r251164 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3932ee83d690..495333698a19 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2017-08-17 Uros Bizjak + + Backport from mainline + 2017-08-17 Maxim Ostapenko + + PR target/81861 + * config/i386/i386.c (ix86_option_override_internal): Save target + specific options after ix86_stack_protector_guard_reg was changed. + 2017-08-16 Bill Schmidt Backport from mainline diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 11ab50b69732..189317458d6c 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4357,12 +4357,6 @@ ix86_option_override_internal (bool main_args_p, gcc_assert ((opts->x_target_flags & MASK_LONG_DOUBLE_64) == 0 || (opts->x_target_flags & MASK_LONG_DOUBLE_128) == 0); - /* Save the initial options in case the user does function specific - options. */ - if (main_args_p) - target_option_default_node = target_option_current_node - = build_target_option_node (opts); - /* Handle stack protector */ if (!opts_set->x_ix86_stack_protector_guard) opts->x_ix86_stack_protector_guard @@ -4382,6 +4376,12 @@ ix86_option_override_internal (bool main_args_p, ix86_parse_stringop_strategy_string (str, true); free (str); } + + /* Save the initial options in case the user does function specific + options. */ + if (main_args_p) + target_option_default_node = target_option_current_node + = build_target_option_node (opts); } /* Implement the TARGET_OPTION_OVERRIDE hook. */