public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-4223] build: Fix --enable-gather-detailed-mem-stats
@ 2021-10-07 12:09 Martin Liska
  0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2021-10-07 12:09 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:8ae3b44a52394ddfeb3946ccda8f428ab5fbd153

commit r12-4223-g8ae3b44a52394ddfeb3946ccda8f428ab5fbd153
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Oct 7 12:29:15 2021 +0200

    build: Fix --enable-gather-detailed-mem-stats
    
    gcc/c-family/ChangeLog:
    
            * c-common.c (parse_optimize_options): Make
            save_opt_decoded_options a pointer type.
    
    gcc/ChangeLog:
    
            * toplev.c (toplev::main): Make
            save_opt_decoded_options a pointer type
            * toplev.h: Likewise.

Diff:
---
 gcc/c-family/c-common.c | 4 ++--
 gcc/toplev.c            | 5 +++--
 gcc/toplev.h            | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 9d19e352725..32c7e3e8972 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -5921,7 +5921,7 @@ parse_optimize_options (tree args, bool attr_p)
   decoded_options_count = j;
 
   /* Merge the decoded options with save_decoded_options.  */
-  unsigned save_opt_count = save_opt_decoded_options.length ();
+  unsigned save_opt_count = save_opt_decoded_options->length ();
   unsigned merged_decoded_options_count
     = save_opt_count + decoded_options_count;
   cl_decoded_option *merged_decoded_options
@@ -5929,7 +5929,7 @@ parse_optimize_options (tree args, bool attr_p)
 
   /* Note the first decoded_options is used for the program name.  */
   for (unsigned i = 0; i < save_opt_count; ++i)
-    merged_decoded_options[i + 1] = save_opt_decoded_options[i];
+    merged_decoded_options[i + 1] = (*save_opt_decoded_options)[i];
   for (unsigned i = 1; i < decoded_options_count; ++i)
     merged_decoded_options[save_opt_count + i] = decoded_options[i];
 
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 70769087c13..ecb2b694970 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -117,7 +117,7 @@ struct cl_decoded_option *save_decoded_options;
 unsigned int save_decoded_options_count;
 
 /* Vector of saved Optimization decoded command line options.  */
-auto_vec<cl_decoded_option> save_opt_decoded_options;
+vec<cl_decoded_option> *save_opt_decoded_options;
 
 /* Used to enable -fvar-tracking, -fweb and -frename-registers according
    to optimize in process_options ().  */
@@ -2320,10 +2320,11 @@ toplev::main (int argc, char **argv)
 						&save_decoded_options_count);
 
   /* Save Optimization decoded options.  */
+  save_opt_decoded_options = new vec<cl_decoded_option> ();
   for (unsigned i = 1; i < save_decoded_options_count; ++i)
     if (save_decoded_options[i].opt_index < cl_options_count
 	&& cl_options[save_decoded_options[i].opt_index].flags & CL_OPTIMIZATION)
-      save_opt_decoded_options.safe_push (save_decoded_options[i]);
+      save_opt_decoded_options->safe_push (save_decoded_options[i]);
 
   /* Perform language-specific options initialization.  */
   lang_hooks.init_options (save_decoded_options_count, save_decoded_options);
diff --git a/gcc/toplev.h b/gcc/toplev.h
index c44c5ff926a..493f7eb5ad6 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3.  If not see
 /* Decoded options, and number of such options.  */
 extern struct cl_decoded_option *save_decoded_options;
 extern unsigned int save_decoded_options_count;
-extern auto_vec<cl_decoded_option> save_opt_decoded_options;
+extern vec<cl_decoded_option> *save_opt_decoded_options;
 
 class timer;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-07 12:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-07 12:09 [gcc r12-4223] build: Fix --enable-gather-detailed-mem-stats 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).