From 54cef8b2c6aca00172697b4fd5b9b6a2e4565d01 Mon Sep 17 00:00:00 2001 From: amacleod Date: Thu, 25 Jun 2015 17:03:33 +0000 Subject: [PATCH] 2015-06-25 Andrew MacLeod * tree-core.h (struct tree_optimization_option): Make opts a pointer to struct cl_optimization. * tree.h (TREE_OPTIMIZATION): Return the pointer, not the address of it. * tree.c (make_node_stat): Allocate cl_optimization struct. (copy_node_stat): Allocate and copy cl_optimization struct. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224952 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 8 ++++++++ gcc/tree-core.h | 2 +- gcc/tree.c | 23 ++++++++++++++++++++--- gcc/tree.h | 2 +- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a45adfd715f..202c3a71949 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2015-06-25 Andrew MacLeod + * tree-core.h (struct tree_optimization_option): Make opts a pointer to + struct cl_optimization. + * tree.h (TREE_OPTIMIZATION): Return the pointer, not the address of it. + * tree.c (make_node_stat): Allocate cl_optimization struct. + (copy_node_stat): Allocate and copy cl_optimization struct. + +2015-06-25 Andrew MacLeod + * function.h (struct incoming_args): Move struct. (pass_by_reference, reference_callee_copied): Remove prototypes. * emit-rtl.h (struct incoming_args): Relocate struct here. diff --git a/gcc/tree-core.h b/gcc/tree-core.h index 58dc301b990..f23abe2bb43 100644 --- a/gcc/tree-core.h +++ b/gcc/tree-core.h @@ -1652,7 +1652,7 @@ struct GTY(()) tree_optimization_option { struct tree_common common; /* The optimization options used by the user. */ - struct cl_optimization opts; + struct cl_optimization *opts; /* Target optabs for this set of optimization options. This is of type `struct target_optabs *'. */ diff --git a/gcc/tree.c b/gcc/tree.c index f6ab441ae03..d44bc180f51 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -1095,9 +1095,20 @@ 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 (); + switch (code) + { + case TARGET_OPTION_NODE: + TREE_TARGET_OPTION(t) + = ggc_cleared_alloc (); + break; + + case OPTIMIZATION_NODE: + TREE_OPTIMIZATION (t) + = ggc_cleared_alloc (); + break; + + default: + break; } break; @@ -1188,6 +1199,12 @@ copy_node_stat (tree node MEM_STAT_DECL) memcpy (TREE_TARGET_OPTION (t), TREE_TARGET_OPTION (node), sizeof (struct cl_target_option)); } + else if (code == OPTIMIZATION_NODE) + { + TREE_OPTIMIZATION (t) = ggc_alloc(); + memcpy (TREE_OPTIMIZATION (t), TREE_OPTIMIZATION (node), + sizeof (struct cl_optimization)); + } return t; } diff --git a/gcc/tree.h b/gcc/tree.h index 34b93681140..e9f0d734a43 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -2827,7 +2827,7 @@ extern vec **decl_debug_args_insert (tree); (STATEMENT_LIST_CHECK (NODE)->stmt_list.tail) #define TREE_OPTIMIZATION(NODE) \ - (&OPTIMIZATION_NODE_CHECK (NODE)->optimization.opts) + (OPTIMIZATION_NODE_CHECK (NODE)->optimization.opts) #define TREE_OPTIMIZATION_OPTABS(NODE) \ (OPTIMIZATION_NODE_CHECK (NODE)->optimization.optabs) -- 2.11.4.GIT