From: Andrew MacLeod Date: Wed, 17 Jun 2015 17:55:26 +0000 (+0000) Subject: tree-core.h (tree_target_option): Make opts field a pointer to a cl_target_option... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f6e3667f976a0592eb156d948a9dfe240250778d;p=gcc.git tree-core.h (tree_target_option): Make opts field a pointer to a cl_target_option instead of an instance of the... 2017-06-17 Andrew MacLeod * tree-core.h (tree_target_option): Make opts field a pointer to a cl_target_option instead of an instance of the struct. * tree.h (TREE_TARGET_OPTION): Return the pointer, not an address of the structure. * tree.c (make_node_stat ): Allocate a cl_target_option struct for TARGET_OPTION_NODE. (copy_node_stat): Allocate and copy struct cl_target_option. From-SVN: r224567 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 155a985e7b0..868a70808a4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2017-06-17 Andrew MacLeod + + * tree-core.h (tree_target_option): Make opts field a pointer to a + cl_target_option instead of an instance of the struct. + * tree.h (TREE_TARGET_OPTION): Return the pointer, not an address of + the structure. + * tree.c (make_node_stat ): Allocate a cl_target_option struct for + TARGET_OPTION_NODE. + (copy_node_stat): Allocate and copy struct cl_target_option. + 2015-06-17 Andrew MacLeod * tree.h (merge_dllimport_decl_attributes, handle_dll_attribute): diff --git a/gcc/tree-core.h b/gcc/tree-core.h index 2a9f417bfb3..58dc301b990 100644 --- a/gcc/tree-core.h +++ b/gcc/tree-core.h @@ -1676,7 +1676,7 @@ struct GTY(()) tree_target_option { struct target_globals *globals; /* The optimization options used by the user. */ - struct cl_target_option opts; + struct cl_target_option *opts; }; /* Define the overall contents of a tree node. diff --git a/gcc/tree.c b/gcc/tree.c index 419e2767d9b..f6ab441ae03 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -1094,6 +1094,13 @@ make_node_stat (enum tree_code code MEM_STAT_DECL) } break; + case tcc_exceptional: + if (code == TARGET_OPTION_NODE) + { + TREE_TARGET_OPTION(t) = ggc_cleared_alloc (); + } + break; + default: /* Other classes need no special treatment. */ break; @@ -1175,6 +1182,12 @@ copy_node_stat (tree node MEM_STAT_DECL) TYPE_CACHED_VALUES (t) = NULL_TREE; } } + else if (code == TARGET_OPTION_NODE) + { + TREE_TARGET_OPTION (t) = ggc_alloc(); + memcpy (TREE_TARGET_OPTION (t), TREE_TARGET_OPTION (node), + sizeof (struct cl_target_option)); + } return t; } diff --git a/gcc/tree.h b/gcc/tree.h index dedcb370ea6..34b93681140 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -2839,7 +2839,7 @@ extern vec **decl_debug_args_insert (tree); extern tree build_optimization_node (struct gcc_options *opts); #define TREE_TARGET_OPTION(NODE) \ - (&TARGET_OPTION_NODE_CHECK (NODE)->target_option.opts) + (TARGET_OPTION_NODE_CHECK (NODE)->target_option.opts) #define TREE_TARGET_GLOBALS(NODE) \ (TARGET_OPTION_NODE_CHECK (NODE)->target_option.globals)