From 33321643e868a31fe0b1d45f035fc86721564f4b Mon Sep 17 00:00:00 2001 From: Laurynas Biveinis Date: Mon, 21 Aug 2006 20:26:49 +0000 Subject: Change some typed allocations to atomic ones git-svn-id: https://gcc.gnu.org/svn/gcc/branches/boehms-gc@116310 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/c-format.c | 2 +- gcc/c-typeck.c | 14 ++++++++------ gcc/ggc-common.c | 8 ++++---- gcc/integrate.c | 5 +++-- gcc/stmt.c | 2 +- gcc/tree-dfa.c | 6 +++--- gcc/value-prof.c | 6 +++--- 7 files changed, 23 insertions(+), 20 deletions(-) diff --git a/gcc/c-format.c b/gcc/c-format.c index c036ab09917..5f3dcb95cd1 100644 --- a/gcc/c-format.c +++ b/gcc/c-format.c @@ -2077,7 +2077,7 @@ check_format_info_main (format_check_results *res, fci = fci->chain; if (fci) { - wanted_type_ptr = ggc_alloc_format_wanted_type(); + wanted_type_ptr = ggc_alloc_atomic (sizeof (struct format_wanted_type)); arg_num++; wanted_type = *fci->types[length_chars_val].type; wanted_type_name = fci->types[length_chars_val].name; diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 5fd8b278cd3..de67b45f3a7 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -4803,9 +4803,10 @@ static int constructor_erroneous; /* Structure for managing pending initializer elements, organized as an AVL tree. */ -struct init_node +struct init_node GTY(()) { - struct init_node *left, *right; + struct init_node *left; + struct init_node *right; struct init_node *parent; int balance; tree purpose; @@ -4878,9 +4879,10 @@ static struct constructor_stack *constructor_stack; /* This stack represents designators from some range designator up to the last designator in the list. */ -struct constructor_range_stack +struct constructor_range_stack GTY(()) { - struct constructor_range_stack *next, *prev; + struct constructor_range_stack *next; + struct constructor_range_stack *prev; struct constructor_stack *stack; tree range_start; tree index; @@ -5538,7 +5540,7 @@ push_range_stack (tree range_end) { struct constructor_range_stack *p; - p = ggc_alloc_constructor_range_stack(); + p = ggc_alloc_atomic (sizeof (struct constructor_range_stack)); p->prev = constructor_range_stack; p->next = 0; p->fields = constructor_fields; @@ -5703,7 +5705,7 @@ add_pending_init (tree purpose, tree value) } } - r = ggc_alloc_init_node(); + r = ggc_alloc_atomic (sizeof (struct init_node)); r->purpose = purpose; r->value = value; diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c index 608fb4df0c1..9225ee1ef23 100644 --- a/gcc/ggc-common.c +++ b/gcc/ggc-common.c @@ -149,17 +149,17 @@ ggc_calloc_atomic (size_t s, size_t n) /* These are for splay_tree_new_ggc. */ void * -ggc_splay_alloc_tree (int sz ATTRIBUTE_UNUSED, void *nl) +ggc_splay_alloc_tree (int sz, void *nl) { gcc_assert (!nl); - return ggc_alloc_splay_tree_s(); + return ggc_alloc_atomic(sz); } void * -ggc_splay_alloc_tree_node (int sz ATTRIBUTE_UNUSED, void *nl) +ggc_splay_alloc_tree_node (int sz, void *nl) { gcc_assert (!nl); - return ggc_alloc_splay_tree_node_s(); + return ggc_alloc_atomic(sz); } void diff --git a/gcc/integrate.c b/gcc/integrate.c index 4c42fdcb461..8ea15be02b1 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -237,10 +237,11 @@ get_hard_reg_initial_val (enum machine_mode mode, unsigned int regno) ivs = cfun->hard_reg_initial_vals; if (ivs == 0) { - ivs = ggc_alloc_initial_value_struct(); + ivs = ggc_alloc_atomic (sizeof (struct initial_value_struct)); ivs->num_entries = 0; ivs->max_entries = 5; - ivs->entries = ggc_alloc_vec_initial_value_pair (5); + ivs->entries = ggc_alloc_vec_atomic (5, + sizeof (struct initial_value_pair)); cfun->hard_reg_initial_vals = ivs; } diff --git a/gcc/stmt.c b/gcc/stmt.c index bb1e8177bb3..2ad2acdf9d0 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -2124,7 +2124,7 @@ add_case_node (struct case_node *head, tree type, tree low, tree high, /* Add this label to the chain. Make sure to drop overflow flags. */ - r = ggc_alloc_case_node (); + r = ggc_alloc_atomic (sizeof (struct case_node)); r->low = build_int_cst_wide (TREE_TYPE (low), TREE_INT_CST_LOW (low), TREE_INT_CST_HIGH (low)); r->high = build_int_cst_wide (TREE_TYPE (high), TREE_INT_CST_LOW (high), diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index 8d3b558ad95..8f73890a0a8 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -142,7 +142,7 @@ create_var_ann (tree t) gcc_assert (DECL_P (t)); gcc_assert (!t->common.ann || t->common.ann->common.type == VAR_ANN); - ann = ggc_alloc_var_ann_d(); + ann = ggc_alloc_atomic (sizeof (struct var_ann_d)); memset ((void *) ann, 0, sizeof (*ann)); ann->common.type = VAR_ANN; @@ -163,7 +163,7 @@ create_function_ann (tree t) gcc_assert (TREE_CODE (t) == FUNCTION_DECL); gcc_assert (!t->common.ann || t->common.ann->common.type == FUNCTION_ANN); - ann = ggc_alloc_function_ann_d (); + ann = ggc_alloc_atomic (sizeof (struct function_ann_d)); memset ((void *) ann, 0, sizeof (*ann)); ann->common.type = FUNCTION_ANN; @@ -183,7 +183,7 @@ create_stmt_ann (tree t) gcc_assert (is_gimple_stmt (t)); gcc_assert (!t->common.ann || t->common.ann->common.type == STMT_ANN); - ann = ggc_alloc_stmt_ann_d(); + ann = ggc_alloc_atomic (sizeof (struct stmt_ann_d)); memset ((void *) ann, 0, sizeof (*ann)); ann->common.type = STMT_ANN; diff --git a/gcc/value-prof.c b/gcc/value-prof.c index b57607cbf47..8952142bcc2 100644 --- a/gcc/value-prof.c +++ b/gcc/value-prof.c @@ -736,7 +736,7 @@ tree_divmod_values_to_profile (tree stmt, histogram_values *values) { /* Check for the case where the divisor is the same value most of the time. */ - hist = ggc_alloc_histogram_value_t (); + hist = ggc_alloc_atomic (sizeof (struct histogram_value_t)); hist->hvalue.value = divisor; hist->hvalue.stmt = stmt; hist->type = HIST_TYPE_SINGLE_VALUE; @@ -749,13 +749,13 @@ tree_divmod_values_to_profile (tree stmt, histogram_values *values) && TYPE_UNSIGNED (type)) { /* Check for a special case where the divisor is power of 2. */ - hist = ggc_alloc_histogram_value_t (); + hist = ggc_alloc_atomic (sizeof (struct histogram_value_t)); hist->hvalue.value = divisor; hist->hvalue.stmt = stmt; hist->type = HIST_TYPE_POW2; VEC_quick_push (histogram_value, *values, hist); - hist = ggc_alloc_histogram_value_t (); + hist = ggc_alloc_atomic (sizeof (struct histogram_value_t)); hist->hvalue.stmt = stmt; hist->hvalue.value = build2 (TRUNC_DIV_EXPR, type, op0, divisor); -- cgit v1.2.3