https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128960

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2026-11-23
           Assignee|unassigned at gcc dot gnu.org      |ubizjak at gmail dot com
             Status|UNCONFIRMED                 |ASSIGNED
   Target Milestone|---                         |14.5
     Ever confirmed|0                           |1

--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> ---
Patch in testing:

--cut here--
diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc
index a7b0ad03cad..1be18a50cc1 100644
--- a/gcc/config/i386/i386-options.cc
+++ b/gcc/config/i386/i386-options.cc
@@ -1572,6 +1572,12 @@ ix86_valid_target_attribute_p (tree fndecl,
   cl_target_option_restore (&func_options, &func_options_set,
                            TREE_TARGET_OPTION (old_target));

+  /* cl_target_option_restore restores the value of
+     -mstack-protector-guard= but not its explicit-set bit, so
+     ix86_option_override_internal would reset it to the default.  */
+  func_options_set.x_ix86_stack_protector_guard
+    = global_options_set.x_ix86_stack_protector_guard;
+
   /* FLAGS == 1 is used for target_clones attribute.  */
   new_target
     = ix86_valid_target_attribute_tree (fndecl, args, &func_options,
--cut here--

Reply via email to