public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/global-options-checking-v3)] Save and restore also cl_target_option.
@ 2020-03-18 12:21 Martin Liska
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Liska @ 2020-03-18 12:21 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:de58ed0f90cbcf44a1195c4d7d9ce842f502d475

commit de58ed0f90cbcf44a1195c4d7d9ce842f502d475
Author: Martin Liska <mliska@suse.cz>
Date:   Wed Mar 18 11:17:45 2020 +0100

    Save and restore also cl_target_option.

Diff:
---
 gcc/c-family/c-attribs.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gcc/c-family/c-attribs.c b/gcc/c-family/c-attribs.c
index c99b1256186..4e94a8436f7 100644
--- a/gcc/c-family/c-attribs.c
+++ b/gcc/c-family/c-attribs.c
@@ -4441,10 +4441,14 @@ handle_optimize_attribute (tree *node, tree name, tree args,
   else
     {
       struct cl_optimization cur_opts;
+      struct cl_target_option cur_target_opts;
       tree old_opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node);
 
-      /* Save current options.  */
+      /* Save current options for both optimization and target.  We need
+	 to save target optimization because there can be interaction
+	 in between both these types of options.  */
       cl_optimization_save (&cur_opts, &global_options);
+      cl_target_option_save (&cur_target_opts, &global_options);
 
       /* If we previously had some optimization options, use them as the
 	 default.  */
@@ -4458,8 +4462,9 @@ handle_optimize_attribute (tree *node, tree name, tree args,
       DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node)
 	= build_optimization_node (&global_options);
 
-      /* Restore current options.  */
+      /* Restore current options for both optimization and target.  */
       cl_optimization_restore (&global_options, &cur_opts);
+      cl_target_option_restore (&global_options, &cur_target_opts);
       if (flag_checking)
 	gcc_assert (gcc_options_check (&saved_global_options, &global_options));
     }


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gcc(refs/users/marxin/heads/global-options-checking-v3)] Save and restore also cl_target_option.
@ 2020-03-18 10:18 Martin Liska
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Liska @ 2020-03-18 10:18 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:e95d4200b4280609f22e182c65e42f50bbac72ec

commit e95d4200b4280609f22e182c65e42f50bbac72ec
Author: Martin Liska <mliska@suse.cz>
Date:   Wed Mar 18 11:17:45 2020 +0100

    Save and restore also cl_target_option.

Diff:
---
 gcc/c-family/c-attribs.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gcc/c-family/c-attribs.c b/gcc/c-family/c-attribs.c
index c99b1256186..70dbf922c37 100644
--- a/gcc/c-family/c-attribs.c
+++ b/gcc/c-family/c-attribs.c
@@ -4441,10 +4441,14 @@ handle_optimize_attribute (tree *node, tree name, tree args,
   else
     {
       struct cl_optimization cur_opts;
+      struct cl_target_option cur_target_opts;
       tree old_opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node);
 
-      /* Save current options.  */
+      /* Save current options for both optimization and target.  We need
+	 to save target optimization because there can be interaction
+	 in between both these types of options.  */
       cl_optimization_save (&cur_opts, &global_options);
+      cl_target_option_save (&cur_target_opts, &global_options);
 
       /* If we previously had some optimization options, use them as the
 	 default.  */
@@ -4458,7 +4462,8 @@ handle_optimize_attribute (tree *node, tree name, tree args,
       DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node)
 	= build_optimization_node (&global_options);
 
-      /* Restore current options.  */
+      /* Restore current options for both optimization and target.  */
+      cl_target_option_restore (&global_options, &cur_target_opts);
       cl_optimization_restore (&global_options, &cur_opts);
       if (flag_checking)
 	gcc_assert (gcc_options_check (&saved_global_options, &global_options));


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-18 12:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-18 12:21 [gcc(refs/users/marxin/heads/global-options-checking-v3)] Save and restore also cl_target_option Martin Liska
  -- strict thread matches above, loose matches on Subject: below --
2020-03-18 10:18 Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).