diff options
-rw-r--r-- | gcc/ChangeLog | 36 | ||||
-rw-r--r-- | gcc/alias.c | 6 | ||||
-rw-r--r-- | gcc/c-decl.c | 41 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 8 | ||||
-rw-r--r-- | gcc/cp/parser.c | 4 | ||||
-rw-r--r-- | gcc/except.c | 251 | ||||
-rw-r--r-- | gcc/except.h | 49 | ||||
-rw-r--r-- | gcc/function.h | 8 | ||||
-rw-r--r-- | gcc/gcse.c | 58 | ||||
-rw-r--r-- | gcc/graphite.c | 61 | ||||
-rw-r--r-- | gcc/graphite.h | 4 | ||||
-rw-r--r-- | gcc/ipa-cp.c | 4 | ||||
-rw-r--r-- | gcc/ipa-inline.c | 2 | ||||
-rw-r--r-- | gcc/ipa-pure-const.c | 4 | ||||
-rw-r--r-- | gcc/ipa-reference.c | 4 | ||||
-rw-r--r-- | gcc/omega.c | 10 | ||||
-rw-r--r-- | gcc/omega.h | 8 | ||||
-rw-r--r-- | gcc/optabs.c | 10 | ||||
-rw-r--r-- | gcc/optabs.h | 19 | ||||
-rw-r--r-- | gcc/passes.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/Wcxx-compat-10.c | 73 | ||||
-rw-r--r-- | gcc/tree-cfg.c | 2 | ||||
-rw-r--r-- | gcc/tree-eh.c | 22 | ||||
-rw-r--r-- | gcc/tree-pass.h | 10 | ||||
-rw-r--r-- | gcc/tree-predcom.c | 10 | ||||
-rw-r--r-- | libcpp/ChangeLog | 5 | ||||
-rw-r--r-- | libcpp/include/cpplib.h | 4 | ||||
-rw-r--r-- | libcpp/init.c | 2 |
30 files changed, 458 insertions, 279 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f1070865ca3..c4177e61f5f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,39 @@ +2009-05-15 Ian Lance Taylor <iant@google.com> + + * alias.c (struct alias_set_entry_d): Rename from struct + alias_set_entry. Change all uses. + * except.c (struct call_site_record_d): Rename from struct + call_site_record. Change all uses. + * except.h (struct eh_region_d): Rename from struct eh_region. + Change all uses. + * gcse.c (struct hash_table_d): Rename from struct hash_table. + Change all uses. + * graphite.c (struct ivtype_map_elt_d): Rename fromstruct + ivtype_map_elt. Change all uses. + (struct rename_map_elt_d): Rename fromstruct rename_map_elt. + Change all uses. + (struct ifsese_d): Rename fromstruct ifsese. Change all uses. + * graphite.h (struct name_tree_d): Rename from struct name_tree. + Change all uses. + (struct sese_d): Rename from struct sese. Change all uses. + * omega.h (struct eqn_d): Rename from struct eqn. Change all + uses. + (struct omega_pb_d): Rename from struct omega_pb. Change all + uses. + * optabs.h (struct optab_d): Rename from struct optab. Change all + uses. + (struct convert_optab_d): Rename from struct convert_optab. + Change all uses. + * tree-pass.h (struct ipa_opt_pass_d): Rename fromstruct + ipa_opt_pass. Change all uses. + * tree-predcom.c (struct dref_d): Rename from struct dref. Change + all uses. + + * c-decl.c (pushtag): If -Wc++-compat, warn if the tag is already + defined as a typedef. + (grokdeclarator): If -Wc++-compat, warn if a typedef is already + defined as a tag. + 2009-05-15 Manuel López-Ibáñez <manu@gcc.gnu.org> PR 16302 diff --git a/gcc/alias.c b/gcc/alias.c index 794df755040..18d5b747cb0 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -128,7 +128,7 @@ along with GCC; see the file COPYING3. If not see However, this is no actual entry for alias set zero. It is an error to attempt to explicitly construct a subset of zero. */ -struct GTY(()) alias_set_entry { +struct GTY(()) alias_set_entry_d { /* The alias set number, as stored in MEM_ALIAS_SET. */ alias_set_type alias_set; @@ -145,7 +145,7 @@ struct GTY(()) alias_set_entry { `int', `double', `float', and `struct S'. */ splay_tree GTY((param1_is (int), param2_is (int))) children; }; -typedef struct alias_set_entry *alias_set_entry; +typedef struct alias_set_entry_d *alias_set_entry; static int rtx_equal_for_memref_p (const_rtx, const_rtx); static int memrefs_conflict_p (int, rtx, int, rtx, HOST_WIDE_INT); @@ -791,7 +791,7 @@ record_alias_subset (alias_set_type superset, alias_set_type subset) { /* Create an entry for the SUPERSET, so that we have a place to attach the SUBSET. */ - superset_entry = GGC_NEW (struct alias_set_entry); + superset_entry = GGC_NEW (struct alias_set_entry_d); superset_entry->alias_set = superset; superset_entry->children = splay_tree_new_ggc (splay_tree_compare_ints); diff --git a/gcc/c-decl.c b/gcc/c-decl.c index a9929c1a85c..0c05b2438b9 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1114,6 +1114,27 @@ pushtag (tree name, tree type, location_t loc) /* An approximation for now, so we can tell this is a function-scope tag. This will be updated in pop_scope. */ TYPE_CONTEXT (type) = DECL_CONTEXT (TYPE_STUB_DECL (type)); + + if (warn_cxx_compat && name != NULL_TREE) + { + struct c_binding *b = I_SYMBOL_BINDING (name); + + if (b != NULL + && b->decl != NULL_TREE + && TREE_CODE (b->decl) == TYPE_DECL + && (B_IN_CURRENT_SCOPE (b) + || (current_scope == file_scope && B_IN_EXTERNAL_SCOPE (b))) + && (TYPE_MAIN_VARIANT (TREE_TYPE (b->decl)) + != TYPE_MAIN_VARIANT (type))) + { + warning_at (loc, OPT_Wc___compat, + ("using %qD as both a typedef and a tag is " + "invalid in C++"), + b->decl); + if (b->locus != UNKNOWN_LOCATION) + inform (b->locus, "originally defined here"); + } + } } /* Subroutine of compare_decls. Allow harmless mismatches in return @@ -4961,6 +4982,26 @@ grokdeclarator (const struct c_declarator *declarator, C_TYPEDEF_EXPLICITLY_SIGNED (decl) = 1; if (declspecs->inline_p) pedwarn (input_location, 0,"typedef %q+D declared %<inline%>", decl); + + if (warn_cxx_compat && declarator->u.id != NULL_TREE) + { + struct c_binding *b = I_TAG_BINDING (declarator->u.id); + + if (b != NULL + && b->decl != NULL_TREE + && (B_IN_CURRENT_SCOPE (b) + || (current_scope == file_scope && B_IN_EXTERNAL_SCOPE (b))) + && TYPE_MAIN_VARIANT (b->decl) != TYPE_MAIN_VARIANT (type)) + { + warning_at (declarator->id_loc, OPT_Wc___compat, + ("using %qD as both a typedef and a tag is " + "invalid in C++"), + decl); + if (b->locus != UNKNOWN_LOCATION) + inform (b->locus, "originally defined here"); + } + } + return decl; } diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b4d782610a1..7bd5f934812 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2009-05-15 Ian Lance Taylor <iant@google.com> + + * cp-tree.h (enum cp_lvalue_kind_flags): Rename from + cp_lvalue_kind. Change all uses. + (enum base_access_flags): Rename from enum base_access. Change + all uses. + * parser.c (enum cp_parser_flags): Remove enum tag. + 2009-05-15 Manuel López-Ibáñez <manu@gcc.gnu.org> PR 16302 diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 0ea2d8623f6..e6545f650f0 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -3466,7 +3466,7 @@ enum tag_types { }; /* The various kinds of lvalues we distinguish. */ -enum cp_lvalue_kind { +enum cp_lvalue_kind_flags { clk_none = 0, /* Things that are not an lvalue. */ clk_ordinary = 1, /* An ordinary lvalue. */ clk_class = 2, /* An rvalue of class-type. */ @@ -3475,7 +3475,7 @@ enum cp_lvalue_kind { }; /* This type is used for parameters and variables which hold - combinations of the flags in enum cp_lvalue_kind. */ + combinations of the flags in enum cp_lvalue_kind_flags. */ typedef int cp_lvalue_kind; /* Various kinds of template specialization, instantiation, etc. */ @@ -3575,7 +3575,7 @@ enum tsubst_flags { typedef int tsubst_flags_t; /* The kind of checking we can do looking in a class hierarchy. */ -enum base_access { +enum base_access_flags { ba_any = 0, /* Do not check access, allow an ambiguous base, prefer a non-virtual base */ ba_unique = 1 << 0, /* Must be a unique base. */ @@ -3586,7 +3586,7 @@ enum base_access { }; /* This type is used for parameters and variables which hold - combinations of the flags in enum base_access. */ + combinations of the flags in enum base_access_flags. */ typedef int base_access; /* The various kinds of access check during parsing. */ diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 0b734727648..6954ef0b35e 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -1183,7 +1183,7 @@ function_declarator_p (const cp_declarator *declarator) /* Flags that are passed to some parsing functions. These values can be bitwise-ored together. */ -enum cp_parser_flags +enum { /* No flags. */ CP_PARSER_FLAGS_NONE = 0x0, @@ -1195,7 +1195,7 @@ enum cp_parser_flags }; /* This type is used for parameters and variables which hold - combinations of the flags in enum cp_parser_flags. */ + combinations of the above flags. */ typedef int cp_parser_flags; /* The different kinds of declarators we want to parse. */ diff --git a/gcc/except.c b/gcc/except.c index a33f3096fbf..a698e8f1c5b 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -99,7 +99,7 @@ tree (*lang_eh_runtime_type) (tree); struct GTY(()) ehl_map_entry { rtx label; - struct eh_region *region; + struct eh_region_d *region; }; static GTY(()) int call_site_base; @@ -115,7 +115,7 @@ static int sjlj_fc_lsda_ofs; static int sjlj_fc_jbuf_ofs; -struct GTY(()) call_site_record +struct GTY(()) call_site_record_d { rtx landing_pad; int action; @@ -144,9 +144,9 @@ static void sjlj_emit_function_exit (void); static void sjlj_emit_dispatch_table (rtx, struct sjlj_lp_info *); static void sjlj_build_landing_pads (void); -static void remove_eh_handler (struct eh_region *); -static void remove_eh_handler_and_replace (struct eh_region *, - struct eh_region *, bool); +static void remove_eh_handler (struct eh_region_d *); +static void remove_eh_handler_and_replace (struct eh_region_d *, + struct eh_region_d *, bool); /* The return value of reachable_next_level. */ enum reachable_code @@ -162,13 +162,13 @@ enum reachable_code }; struct reachable_info; -static enum reachable_code reachable_next_level (struct eh_region *, tree, +static enum reachable_code reachable_next_level (struct eh_region_d *, tree, struct reachable_info *, bool); static int action_record_eq (const void *, const void *); static hashval_t action_record_hash (const void *); static int add_action_record (htab_t, int, int); -static int collect_one_action_chain (htab_t, struct eh_region *); +static int collect_one_action_chain (htab_t, struct eh_region_d *); static int add_call_site (rtx, int); static void push_uleb128 (varray_type *, unsigned int); @@ -308,17 +308,17 @@ init_eh_for_function (void) These are used from tree-eh.c when processing exception related nodes during tree optimization. */ -static struct eh_region * -gen_eh_region (enum eh_region_type type, struct eh_region *outer) +static struct eh_region_d * +gen_eh_region (enum eh_region_type type, struct eh_region_d *outer) { - struct eh_region *new_eh; + struct eh_region_d *new_eh; #ifdef ENABLE_CHECKING gcc_assert (doing_eh (0)); #endif /* Insert a new blank region as a leaf in the tree. */ - new_eh = GGC_CNEW (struct eh_region); + new_eh = GGC_CNEW (struct eh_region_d); new_eh->type = type; new_eh->outer = outer; if (outer) @@ -337,23 +337,23 @@ gen_eh_region (enum eh_region_type type, struct eh_region *outer) return new_eh; } -struct eh_region * -gen_eh_region_cleanup (struct eh_region *outer) +struct eh_region_d * +gen_eh_region_cleanup (struct eh_region_d *outer) { - struct eh_region *cleanup = gen_eh_region (ERT_CLEANUP, outer); + struct eh_region_d *cleanup = gen_eh_region (ERT_CLEANUP, outer); return cleanup; } -struct eh_region * -gen_eh_region_try (struct eh_region *outer) +struct eh_region_d * +gen_eh_region_try (struct eh_region_d *outer) { return gen_eh_region (ERT_TRY, outer); } -struct eh_region * -gen_eh_region_catch (struct eh_region *t, tree type_or_list) +struct eh_region_d * +gen_eh_region_catch (struct eh_region_d *t, tree type_or_list) { - struct eh_region *c, *l; + struct eh_region_d *c, *l; tree type_list, type_node; /* Ensure to always end up with a type list to normalize further @@ -382,10 +382,10 @@ gen_eh_region_catch (struct eh_region *t, tree type_or_list) return c; } -struct eh_region * -gen_eh_region_allowed (struct eh_region *outer, tree allowed) +struct eh_region_d * +gen_eh_region_allowed (struct eh_region_d *outer, tree allowed) { - struct eh_region *region = gen_eh_region (ERT_ALLOWED_EXCEPTIONS, outer); + struct eh_region_d *region = gen_eh_region (ERT_ALLOWED_EXCEPTIONS, outer); region->u.allowed.type_list = allowed; for (; allowed ; allowed = TREE_CHAIN (allowed)) @@ -394,26 +394,26 @@ gen_eh_region_allowed (struct eh_region *outer, tree allowed) return region; } -struct eh_region * -gen_eh_region_must_not_throw (struct eh_region *outer) +struct eh_region_d * +gen_eh_region_must_not_throw (struct eh_region_d *outer) { return gen_eh_region (ERT_MUST_NOT_THROW, outer); } int -get_eh_region_number (struct eh_region *region) +get_eh_region_number (struct eh_region_d *region) { return region->region_number; } bool -get_eh_region_may_contain_throw (struct eh_region *region) +get_eh_region_may_contain_throw (struct eh_region_d *region) { return region->may_contain_throw; } tree -get_eh_region_tree_label (struct eh_region *region) +get_eh_region_tree_label (struct eh_region_d *region) { return region->tree_label; } @@ -425,7 +425,7 @@ get_eh_region_no_tree_label (int region) } void -set_eh_region_tree_label (struct eh_region *region, tree lab) +set_eh_region_tree_label (struct eh_region_d *region, tree lab) { region->tree_label = lab; } @@ -434,8 +434,8 @@ void expand_resx_expr (tree exp) { int region_nr = TREE_INT_CST_LOW (TREE_OPERAND (exp, 0)); - struct eh_region *reg = VEC_index (eh_region, - cfun->eh->region_array, region_nr); + struct eh_region_d *reg = VEC_index (eh_region, + cfun->eh->region_array, region_nr); gcc_assert (!reg->resume); do_pending_stack_adjust (); @@ -447,7 +447,7 @@ expand_resx_expr (tree exp) call to a function which itself may contain a throw. */ void -note_eh_region_may_contain_throw (struct eh_region *region) +note_eh_region_may_contain_throw (struct eh_region_d *region) { while (region && !region->may_contain_throw) { @@ -486,7 +486,7 @@ get_exception_filter (void) void collect_eh_region_array (void) { - struct eh_region *i; + struct eh_region_d *i; i = cfun->eh->region_tree; if (! i) @@ -538,9 +538,9 @@ collect_eh_region_array (void) a problem. */ static bool -can_be_reached_by_runtime (sbitmap contains_stmt, struct eh_region *r) +can_be_reached_by_runtime (sbitmap contains_stmt, struct eh_region_d *r) { - struct eh_region *i = r->inner; + struct eh_region_d *i = r->inner; unsigned n; bitmap_iterator bi; @@ -574,7 +574,7 @@ can_be_reached_by_runtime (sbitmap contains_stmt, struct eh_region *r) firest place. */ if (found) { - struct eh_region *i1 = i; + struct eh_region_d *i1 = i; tree type_thrown = NULL_TREE; if (i1->type == ERT_THROW) @@ -614,10 +614,10 @@ can_be_reached_by_runtime (sbitmap contains_stmt, struct eh_region *r) /* Bring region R to the root of tree. */ static void -bring_to_root (struct eh_region *r) +bring_to_root (struct eh_region_d *r) { - struct eh_region **pp; - struct eh_region *outer = r->outer; + struct eh_region_d **pp; + struct eh_region_d *outer = r->outer; if (!r->outer) return; for (pp = &outer->inner; *pp != r; pp = &(*pp)->next_peer) @@ -631,8 +631,8 @@ bring_to_root (struct eh_region *r) /* Return true if region R2 can be replaced by R1. */ static bool -eh_region_replaceable_by_p (const struct eh_region *r1, - const struct eh_region *r2) +eh_region_replaceable_by_p (const struct eh_region_d *r1, + const struct eh_region_d *r2) { /* Regions are semantically same if they are of same type, have same label and type. */ @@ -649,7 +649,7 @@ eh_region_replaceable_by_p (const struct eh_region *r1, break; case ERT_TRY: { - struct eh_region *c1, *c2; + struct eh_region_d *c1, *c2; for (c1 = r1->u.eh_try.eh_catch, c2 = r2->u.eh_try.eh_catch; c1 && c2; @@ -690,10 +690,10 @@ eh_region_replaceable_by_p (const struct eh_region *r1, /* Replace region R2 by R1. */ static void -replace_region (struct eh_region *r1, struct eh_region *r2) +replace_region (struct eh_region_d *r1, struct eh_region_d *r2) { - struct eh_region *next1 = r1->u.eh_try.eh_catch; - struct eh_region *next2 = r2->u.eh_try.eh_catch; + struct eh_region_d *next1 = r1->u.eh_try.eh_catch; + struct eh_region_d *next2 = r2->u.eh_try.eh_catch; bool is_try = r1->type == ERT_TRY; gcc_assert (r1->type != ERT_CATCH); @@ -729,7 +729,7 @@ hash_type_list (tree t) static hashval_t hash_eh_region (const void *r) { - const struct eh_region *region = (const struct eh_region *)r; + const struct eh_region_d *region = (const struct eh_region_d *) r; hashval_t val = region->type; if (region->tree_label) @@ -741,7 +741,7 @@ hash_eh_region (const void *r) break; case ERT_TRY: { - struct eh_region *c; + struct eh_region_d *c; for (c = region->u.eh_try.eh_catch; c; c = c->u.eh_catch.next_catch) val = iterative_hash_hashval_t (hash_eh_region (c), val); @@ -770,8 +770,8 @@ hash_eh_region (const void *r) static int eh_regions_equal_p (const void *r1, const void *r2) { - return eh_region_replaceable_by_p ((const struct eh_region *)r1, - (const struct eh_region *)r2); + return eh_region_replaceable_by_p ((const struct eh_region_d *) r1, + (const struct eh_region_d *) r2); } /* Walk all peers of REGION and try to merge those regions @@ -779,9 +779,9 @@ eh_regions_equal_p (const void *r1, const void *r2) recursively too. */ static bool -merge_peers (struct eh_region *region) +merge_peers (struct eh_region_d *region) { - struct eh_region *r1, *r2, *outer = NULL, *next; + struct eh_region_d *r1, *r2, *outer = NULL, *next; bool merged = false; int num_regions = 0; if (region) @@ -851,7 +851,7 @@ merge_peers (struct eh_region *region) if (!*slot) *slot = r1; else - replace_region ((struct eh_region *)*slot, r1); + replace_region ((struct eh_region_d *) *slot, r1); } htab_delete (hash); } @@ -868,10 +868,10 @@ void remove_unreachable_regions (sbitmap reachable, sbitmap contains_stmt) { int i; - struct eh_region *r; + struct eh_region_d *r; VEC(eh_region,heap) *must_not_throws = VEC_alloc (eh_region, heap, 16); - struct eh_region *local_must_not_throw = NULL; - struct eh_region *first_must_not_throw = NULL; + struct eh_region_d *local_must_not_throw = NULL; + struct eh_region_d *first_must_not_throw = NULL; for (i = cfun->eh->last_region_number; i > 0; --i) { @@ -907,7 +907,7 @@ remove_unreachable_regions (sbitmap reachable, sbitmap contains_stmt) { /* TRY regions are reachable if any of its CATCH regions are reachable. */ - struct eh_region *c; + struct eh_region_d *c; for (c = r->u.eh_try.eh_catch; c; c = c->u.eh_catch.next_catch) if (TEST_BIT (reachable, c->region_number)) @@ -1001,7 +1001,7 @@ label_to_region_map (void) cfun->cfg->last_label_uid + 1); for (i = cfun->eh->last_region_number; i > 0; --i) { - struct eh_region *r = VEC_index (eh_region, cfun->eh->region_array, i); + struct eh_region_d *r = VEC_index (eh_region, cfun->eh->region_array, i); if (r && r->region_number == i && r->tree_label && LABEL_DECL_UID (r->tree_label) >= 0) { @@ -1030,7 +1030,7 @@ num_eh_regions (void) int get_next_region_sharing_label (int region) { - struct eh_region *r; + struct eh_region_d *r; if (!region) return 0; r = VEC_index (eh_region, cfun->eh->region_array, region); @@ -1052,7 +1052,7 @@ convert_from_eh_region_ranges (void) we allocated earlier. */ for (i = 1; i <= n; ++i) { - struct eh_region *region; + struct eh_region_d *region; region = VEC_index (eh_region, cfun->eh->region_array, i); if (region && region->tree_label) @@ -1070,7 +1070,7 @@ find_exception_handler_labels (void) for (i = cfun->eh->last_region_number; i > 0; --i) { - struct eh_region *region; + struct eh_region_d *region; rtx lab; region = VEC_index (eh_region, cfun->eh->region_array, i); @@ -1092,7 +1092,7 @@ current_function_has_exception_handlers (void) for (i = cfun->eh->last_region_number; i > 0; --i) { - struct eh_region *region; + struct eh_region_d *region; region = VEC_index (eh_region, cfun->eh->region_array, i); if (region @@ -1147,7 +1147,7 @@ duplicate_eh_regions_1 (eh_region old, eh_region outer, int eh_offset) { eh_region ret, n; - ret = n = GGC_NEW (struct eh_region); + ret = n = GGC_NEW (struct eh_region_d); *n = *old; n->outer = outer; @@ -1185,8 +1185,8 @@ duplicate_eh_regions_1 (eh_region old, eh_region outer, int eh_offset) /* Look for first outer region of R (or R itself) that is TRY region. Return NULL if none. */ -static struct eh_region * -find_prev_try (struct eh_region * r) +static struct eh_region_d * +find_prev_try (struct eh_region_d * r) { for (; r && r->type != ERT_TRY; r = r->outer) if (r->type == ERT_MUST_NOT_THROW @@ -1361,10 +1361,10 @@ duplicate_eh_regions (struct function *ifun, duplicate_eh_regions_map map, /* Return new copy of eh region OLD inside region NEW_OUTER. Do not care about updating the tree otherwise. */ -static struct eh_region * -copy_eh_region_1 (struct eh_region *old, struct eh_region *new_outer) +static struct eh_region_d * +copy_eh_region_1 (struct eh_region_d *old, struct eh_region_d *new_outer) { - struct eh_region *new_eh = gen_eh_region (old->type, new_outer); + struct eh_region_d *new_eh = gen_eh_region (old->type, new_outer); new_eh->u = old->u; new_eh->tree_label = old->tree_label; new_eh->may_contain_throw = old->may_contain_throw; @@ -1380,10 +1380,10 @@ copy_eh_region_1 (struct eh_region *old, struct eh_region *new_outer) Copy whole catch-try chain if neccesary. */ -static struct eh_region * -copy_eh_region (struct eh_region *old, struct eh_region *new_outer) +static struct eh_region_d * +copy_eh_region (struct eh_region_d *old, struct eh_region_d *new_outer) { - struct eh_region *r, *n, *old_try, *new_try, *ret = NULL; + struct eh_region_d *r, *n, *old_try, *new_try, *ret = NULL; VEC(eh_region,heap) *catch_list = NULL; if (old->type != ERT_CATCH) @@ -1438,7 +1438,7 @@ copy_eh_region (struct eh_region *old, struct eh_region *new_outer) /* Callback for forach_reachable_handler that push REGION into single VECtor DATA. */ static void -push_reachable_handler (struct eh_region *region, void *data) +push_reachable_handler (struct eh_region_d *region, void *data) { VEC(eh_region,heap) **trace = (VEC(eh_region,heap) **) data; VEC_safe_push (eh_region, heap, *trace, region); @@ -1448,17 +1448,17 @@ push_reachable_handler (struct eh_region *region, void *data) IS_RESX, INLINABLE_CALL and REGION_NMUBER match the parameter of foreach_reachable_handler. */ -struct eh_region * +struct eh_region_d * redirect_eh_edge_to_label (edge e, tree new_dest_label, bool is_resx, bool inlinable_call, int region_number) { - struct eh_region *outer; - struct eh_region *region; + struct eh_region_d *outer; + struct eh_region_d *region; VEC (eh_region, heap) * trace = NULL; int i; int start_here = -1; basic_block old_bb = e->dest; - struct eh_region *old, *r = NULL; + struct eh_region_d *old, *r = NULL; bool update_inplace = true; edge_iterator ei; edge e2; @@ -1584,7 +1584,7 @@ redirect_eh_edge_to_label (edge e, tree new_dest_label, bool is_resx, int eh_region_outermost (struct function *ifun, int region_a, int region_b) { - struct eh_region *rp_a, *rp_b; + struct eh_region_d *rp_a, *rp_b; sbitmap b_outer; gcc_assert (ifun->eh->last_region_number > 0); @@ -1810,7 +1810,7 @@ assign_filter_values (void) for (i = cfun->eh->last_region_number; i > 0; --i) { - struct eh_region *r; + struct eh_region_d *r; r = VEC_index (eh_region, cfun->eh->region_array, i); @@ -1905,7 +1905,7 @@ build_post_landing_pads (void) for (i = cfun->eh->last_region_number; i > 0; --i) { - struct eh_region *region; + struct eh_region_d *region; rtx seq; region = VEC_index (eh_region, cfun->eh->region_array, i); @@ -1938,7 +1938,7 @@ build_post_landing_pads (void) switch statement generation code in expand_end_case. Rapid prototyping sez a sequence of ifs. */ { - struct eh_region *c; + struct eh_region_d *c; for (c = region->u.eh_try.eh_catch; c ; c = c->u.eh_catch.next_catch) { if (c->u.eh_catch.type_list == NULL) @@ -2033,8 +2033,8 @@ connect_post_landing_pads (void) for (i = cfun->eh->last_region_number; i > 0; --i) { - struct eh_region *region; - struct eh_region *outer; + struct eh_region_d *region; + struct eh_region_d *outer; rtx seq; rtx barrier; @@ -2110,7 +2110,7 @@ dw2_build_landing_pads (void) for (i = cfun->eh->last_region_number; i > 0; --i) { - struct eh_region *region; + struct eh_region_d *region; rtx seq; basic_block bb; edge e; @@ -2178,7 +2178,7 @@ sjlj_find_directly_reachable_regions (struct sjlj_lp_info *lp_info) for (insn = get_insns (); insn ; insn = NEXT_INSN (insn)) { - struct eh_region *region; + struct eh_region_d *region; enum reachable_code rc; tree type_thrown; rtx note; @@ -2234,7 +2234,8 @@ sjlj_assign_call_site_values (rtx dispatch_label, struct sjlj_lp_info *lp_info) for (i = cfun->eh->last_region_number; i > 0; --i) if (lp_info[i].directly_reachable) { - struct eh_region *r = VEC_index (eh_region, cfun->eh->region_array, i); + struct eh_region_d *r = + VEC_index (eh_region, cfun->eh->region_array, i); r->landing_pad = dispatch_label; lp_info[i].action_index = collect_one_action_chain (ar_hash, r); @@ -2291,7 +2292,7 @@ sjlj_mark_call_sites (struct sjlj_lp_info *lp_info) for (insn = get_insns (); insn ; insn = NEXT_INSN (insn)) { - struct eh_region *region; + struct eh_region_d *region; int this_call_site; rtx note, before, p; @@ -2518,14 +2519,17 @@ sjlj_emit_dispatch_table (rtx dispatch_label, struct sjlj_lp_info *lp_info) emit_cmp_and_jump_insns (dispatch, GEN_INT (lp_info[i].dispatch_index), EQ, NULL_RTX, TYPE_MODE (integer_type_node), 0, - ((struct eh_region *)VEC_index (eh_region, cfun->eh->region_array, i)) - ->post_landing_pad); + (((struct eh_region_d *) + VEC_index (eh_region, + cfun->eh->region_array, i)) + ->post_landing_pad)); } seq = get_insns (); end_sequence (); - before = (((struct eh_region *)VEC_index (eh_region, cfun->eh->region_array, first_reachable)) + before = (((struct eh_region_d *) + VEC_index (eh_region, cfun->eh->region_array, first_reachable)) ->post_landing_pad); bb = emit_to_new_bb_before (seq, before); @@ -2636,11 +2640,11 @@ finish_eh_generation (void) region.*/ static void -remove_eh_handler_and_replace (struct eh_region *region, - struct eh_region *replace, +remove_eh_handler_and_replace (struct eh_region_d *region, + struct eh_region_d *replace, bool update_catch_try) { - struct eh_region **pp, **pp_start, *p, *outer, *inner; + struct eh_region_d **pp, **pp_start, *p, *outer, *inner; rtx lab; outer = region->outer; @@ -2703,7 +2707,7 @@ remove_eh_handler_and_replace (struct eh_region *region, if (region->type == ERT_CATCH && update_catch_try) { - struct eh_region *eh_try, *next, *prev; + struct eh_region_d *eh_try, *next, *prev; for (eh_try = region->next_peer; eh_try->type == ERT_CATCH; @@ -2733,7 +2737,7 @@ remove_eh_handler_and_replace (struct eh_region *region, etc. */ static void -remove_eh_handler (struct eh_region *region) +remove_eh_handler (struct eh_region_d *region) { remove_eh_handler_and_replace (region, region->outer, true); } @@ -2743,7 +2747,7 @@ remove_eh_handler (struct eh_region *region) void remove_eh_region (int r) { - struct eh_region *region; + struct eh_region_d *region; region = VEC_index (eh_region, cfun->eh->region_array, r); remove_eh_handler (region); @@ -2755,7 +2759,7 @@ remove_eh_region (int r) void remove_eh_region_and_replace_by_outer_of (int r, int r2) { - struct eh_region *region, *region2; + struct eh_region_d *region, *region2; region = VEC_index (eh_region, cfun->eh->region_array, r); region2 = VEC_index (eh_region, cfun->eh->region_array, r2); @@ -2771,7 +2775,7 @@ for_each_eh_label (void (*callback) (rtx)) int i; for (i = 0; i < cfun->eh->last_region_number; i++) { - struct eh_region *r = VEC_index (eh_region, cfun->eh->region_array, i); + struct eh_region_d *r = VEC_index (eh_region, cfun->eh->region_array, i); if (r && r->region_number == i && r->label && GET_CODE (r->label) == CODE_LABEL) (*callback) (r->label); @@ -2781,12 +2785,12 @@ for_each_eh_label (void (*callback) (rtx)) /* Invoke CALLBACK for every exception region in the current function. */ void -for_each_eh_region (void (*callback) (struct eh_region *)) +for_each_eh_region (void (*callback) (struct eh_region_d *)) { int i, n = cfun->eh->last_region_number; for (i = 1; i <= n; ++i) { - struct eh_region *region; + struct eh_region_d *region; region = VEC_index (eh_region, cfun->eh->region_array, i); if (region) @@ -2801,7 +2805,7 @@ struct reachable_info { tree types_caught; tree types_allowed; - void (*callback) (struct eh_region *, void *); + void (*callback) (struct eh_region_d *, void *); void *callback_data; }; @@ -2840,7 +2844,8 @@ check_handled (tree handled, tree type) static void add_reachable_handler (struct reachable_info *info, - struct eh_region *lp_region, struct eh_region *region) + struct eh_region_d *lp_region, + struct eh_region_d *region) { if (! info) return; @@ -2857,7 +2862,7 @@ add_reachable_handler (struct reachable_info *info, and caught/allowed type information between invocations. */ static enum reachable_code -reachable_next_level (struct eh_region *region, tree type_thrown, +reachable_next_level (struct eh_region_d *region, tree type_thrown, struct reachable_info *info, bool maybe_resx) { @@ -2872,7 +2877,7 @@ reachable_next_level (struct eh_region *region, tree type_thrown, case ERT_TRY: { - struct eh_region *c; + struct eh_region_d *c; enum reachable_code ret = RNL_NOT_CAUGHT; for (c = region->u.eh_try.eh_catch; c ; c = c->u.eh_catch.next_catch) @@ -3026,11 +3031,11 @@ reachable_next_level (struct eh_region *region, tree type_thrown, void foreach_reachable_handler (int region_number, bool is_resx, bool inlinable_call, - void (*callback) (struct eh_region *, void *), + void (*callback) (struct eh_region_d *, void *), void *callback_data) { struct reachable_info info; - struct eh_region *region; + struct eh_region_d *region; tree type_thrown; memset (&info, 0, sizeof (info)); @@ -3088,7 +3093,7 @@ foreach_reachable_handler (int region_number, bool is_resx, bool inlinable_call, reached by a given insn. */ static void -arh_to_landing_pad (struct eh_region *region, void *data) +arh_to_landing_pad (struct eh_region_d *region, void *data) { rtx *p_handlers = (rtx *) data; if (! *p_handlers) @@ -3096,7 +3101,7 @@ arh_to_landing_pad (struct eh_region *region, void *data) } static void -arh_to_label (struct eh_region *region, void *data) +arh_to_label (struct eh_region_d *region, void *data) { rtx *p_handlers = (rtx *) data; *p_handlers = alloc_INSN_LIST (region->label, *p_handlers); @@ -3138,7 +3143,7 @@ reachable_handlers (rtx insn) bool can_throw_internal_1 (int region_number, bool is_resx, bool inlinable_call) { - struct eh_region *region; + struct eh_region_d *region; tree type_thrown; region = VEC_index (eh_region, cfun->eh->region_array, region_number); @@ -3201,7 +3206,7 @@ can_throw_internal (const_rtx insn) bool can_throw_external_1 (int region_number, bool is_resx, bool inlinable_call) { - struct eh_region *region; + struct eh_region_d *region; tree type_thrown; region = VEC_index (eh_region, cfun->eh->region_array, region_number); @@ -3609,9 +3614,9 @@ add_action_record (htab_t ar_hash, int filter, int next) } static int -collect_one_action_chain (htab_t ar_hash, struct eh_region *region) +collect_one_action_chain (htab_t ar_hash, struct eh_region_d *region) { - struct eh_region *c; + struct eh_region_d *c; int next; /* If we've reached the top of the region chain, then we have @@ -3724,7 +3729,7 @@ add_call_site (rtx landing_pad, int action) { call_site_record record; - record = GGC_NEW (struct call_site_record); + record = GGC_NEW (struct call_site_record_d); record->landing_pad = landing_pad; record->action = action; @@ -3758,7 +3763,7 @@ convert_to_eh_region_ranges (void) for (iter = get_insns (); iter ; iter = NEXT_INSN (iter)) if (INSN_P (iter)) { - struct eh_region *region; + struct eh_region_d *region; int this_action; rtx this_landing_pad; @@ -3802,7 +3807,7 @@ convert_to_eh_region_ranges (void) landing pads. Collect the landing pad for this region. */ if (this_action >= 0) { - struct eh_region *o; + struct eh_region_d *o; for (o = region; ! o->landing_pad ; o = o->outer) continue; this_landing_pad = o->landing_pad; @@ -3925,7 +3930,8 @@ dw2_size_of_call_site_table (void) for (i = 0; i < n; ++i) { - struct call_site_record *cs = VEC_index (call_site_record, crtl->eh.call_site_record, i); + struct call_site_record_d *cs = + VEC_index (call_site_record, crtl->eh.call_site_record, i); size += size_of_uleb128 (cs->action); } @@ -3941,7 +3947,8 @@ sjlj_size_of_call_site_table (void) for (i = 0; i < n; ++i) { - struct call_site_record *cs = VEC_index (call_site_record, crtl->eh.call_site_record, i); + struct call_site_record_d *cs = + VEC_index (call_site_record, crtl->eh.call_site_record, i); size += size_of_uleb128 (INTVAL (cs->landing_pad)); size += size_of_uleb128 (cs->action); } @@ -3958,7 +3965,8 @@ dw2_output_call_site_table (void) for (i = 0; i < n; ++i) { - struct call_site_record *cs = VEC_index (call_site_record, crtl->eh.call_site_record, i); + struct call_site_record_d *cs = + VEC_index (call_site_record, crtl->eh.call_site_record, i); char reg_start_lab[32]; char reg_end_lab[32]; char landing_pad_lab[32]; @@ -4012,7 +4020,8 @@ sjlj_output_call_site_table (void) for (i = 0; i < n; ++i) { - struct call_site_record *cs = VEC_index (call_site_record, crtl->eh.call_site_record, i); + struct call_site_record_d *cs = + VEC_index (call_site_record, crtl->eh.call_site_record, i); dw2_asm_output_data_uleb128 (INTVAL (cs->landing_pad), "region %d landing pad", i); @@ -4330,7 +4339,7 @@ get_eh_throw_stmt_table (struct function *fun) void dump_eh_tree (FILE * out, struct function *fun) { - struct eh_region *i; + struct eh_region_d *i; int depth = 0; static const char *const type_name[] = { "unknown", "cleanup", "try", "catch", "allowed_exceptions", "must_not_throw", @@ -4380,7 +4389,7 @@ dump_eh_tree (FILE * out, struct function *fun) case ERT_TRY: { - struct eh_region *c; + struct eh_region_d *c; fprintf (out, " catch regions:"); for (c = i->u.eh_try.eh_catch; c; c = c->u.eh_catch.next_catch) fprintf (out, " %i", c->region_number); @@ -4455,7 +4464,7 @@ debug_eh_tree (struct function *fn) /* Verify EH region invariants. */ static bool -verify_eh_region (struct eh_region *region) +verify_eh_region (struct eh_region_d *region) { bool found = false; if (!region) @@ -4464,7 +4473,7 @@ verify_eh_region (struct eh_region *region) { case ERT_TRY: { - struct eh_region *c, *prev = NULL; + struct eh_region_d *c, *prev = NULL; if (region->u.eh_try.eh_catch->u.eh_catch.prev_catch) { error ("Try region %i has wrong rh_catch pointer to %i", @@ -4526,7 +4535,7 @@ verify_eh_region (struct eh_region *region) void verify_eh_tree (struct function *fun) { - struct eh_region *i, *outer = NULL; + struct eh_region_d *i, *outer = NULL; bool err = false; int nvisited = 0; int count = 0; diff --git a/gcc/except.h b/gcc/except.h index 70506d3a8c5..6906601ceb7 100644 --- a/gcc/except.h +++ b/gcc/except.h @@ -37,17 +37,17 @@ enum eh_region_type }; /* Describes one exception region. */ -struct GTY(()) eh_region +struct GTY(()) eh_region_d { /* The immediately surrounding region. */ - struct eh_region *outer; + struct eh_region_d *outer; /* The list of immediately contained regions. */ - struct eh_region *inner; - struct eh_region *next_peer; + struct eh_region_d *inner; + struct eh_region_d *next_peer; /* List of regions sharing label. */ - struct eh_region *next_region_sharing_label; + struct eh_region_d *next_region_sharing_label; /* An identifier for this region. */ int region_number; @@ -64,15 +64,15 @@ struct GTY(()) eh_region /* A list of catch blocks, a surrounding try block, and the label for continuing after a catch. */ struct eh_region_u_try { - struct eh_region *eh_catch; - struct eh_region *last_catch; + struct eh_region_d *eh_catch; + struct eh_region_d *last_catch; } GTY ((tag ("ERT_TRY"))) eh_try; /* The list through the catch handlers, the list of type objects matched, and the list of associated filters. */ struct eh_region_u_catch { - struct eh_region *next_catch; - struct eh_region *prev_catch; + struct eh_region_d *next_catch; + struct eh_region_d *prev_catch; tree type_list; tree filter_list; } GTY ((tag ("ERT_CATCH"))) eh_catch; @@ -108,7 +108,7 @@ struct GTY(()) eh_region unsigned may_contain_throw : 1; }; -typedef struct eh_region *eh_region; +typedef struct eh_region_d *eh_region; DEF_VEC_P(eh_region); DEF_VEC_ALLOC_P(eh_region, gc); DEF_VEC_ALLOC_P(eh_region, heap); @@ -118,7 +118,7 @@ DEF_VEC_ALLOC_P(eh_region, heap); struct GTY(()) eh_status { /* The tree of all regions for this function. */ - struct eh_region *region_tree; + struct eh_region_d *region_tree; /* The same information as an indexable array. */ VEC(eh_region,gc) *region_array; @@ -133,14 +133,14 @@ extern int doing_eh (int); /* Note that the current EH region (if any) may contain a throw, or a call to a function which itself may contain a throw. */ -extern void note_eh_region_may_contain_throw (struct eh_region *); +extern void note_eh_region_may_contain_throw (struct eh_region_d *); /* Invokes CALLBACK for every exception handler label. Only used by old loop hackery; should not be used by new code. */ extern void for_each_eh_label (void (*) (rtx)); /* Invokes CALLBACK for every exception region in the current function. */ -extern void for_each_eh_region (void (*) (struct eh_region *)); +extern void for_each_eh_region (void (*) (struct eh_region_d *)); /* Determine if the given INSN can throw an exception. */ extern bool can_throw_internal_1 (int, bool, bool); @@ -182,19 +182,19 @@ extern int duplicate_eh_regions (struct function *, duplicate_eh_regions_map, extern void sjlj_emit_function_exit_after (rtx); extern void default_init_unwind_resume_libfunc (void); -extern struct eh_region *gen_eh_region_cleanup (struct eh_region *); -extern struct eh_region *gen_eh_region_try (struct eh_region *); -extern struct eh_region *gen_eh_region_catch (struct eh_region *, tree); -extern struct eh_region *gen_eh_region_allowed (struct eh_region *, tree); -extern struct eh_region *gen_eh_region_must_not_throw (struct eh_region *); -extern int get_eh_region_number (struct eh_region *); -extern bool get_eh_region_may_contain_throw (struct eh_region *); +extern struct eh_region_d *gen_eh_region_cleanup (struct eh_region_d *); +extern struct eh_region_d *gen_eh_region_try (struct eh_region_d *); +extern struct eh_region_d *gen_eh_region_catch (struct eh_region_d *, tree); +extern struct eh_region_d *gen_eh_region_allowed (struct eh_region_d *, tree); +extern struct eh_region_d *gen_eh_region_must_not_throw (struct eh_region_d *); +extern int get_eh_region_number (struct eh_region_d *); +extern bool get_eh_region_may_contain_throw (struct eh_region_d *); extern tree get_eh_region_no_tree_label (int); -extern tree get_eh_region_tree_label (struct eh_region *); -extern void set_eh_region_tree_label (struct eh_region *, tree); +extern tree get_eh_region_tree_label (struct eh_region_d *); +extern void set_eh_region_tree_label (struct eh_region_d *, tree); extern void foreach_reachable_handler (int, bool, bool, - void (*) (struct eh_region *, void *), + void (*) (struct eh_region_d *, void *), void *); extern void collect_eh_region_array (void); @@ -274,5 +274,6 @@ extern void set_eh_throw_stmt_table (struct function *, struct htab *); extern void remove_unreachable_regions (sbitmap, sbitmap); extern VEC(int,heap) * label_to_region_map (void); extern int num_eh_regions (void); -extern struct eh_region *redirect_eh_edge_to_label (struct edge_def *, tree, bool, bool, int); +extern struct eh_region_d *redirect_eh_edge_to_label (struct edge_def *, tree, + bool, bool, int); extern int get_next_region_sharing_label (int); diff --git a/gcc/function.h b/gcc/function.h index cd9f59eece6..de3a46acc52 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -134,7 +134,7 @@ struct GTY(()) expr_status { rtx x_forced_labels; }; -typedef struct call_site_record *call_site_record; +typedef struct call_site_record_d *call_site_record; DEF_VEC_P(call_site_record); DEF_VEC_ALLOC_P(call_site_record, gc); @@ -169,12 +169,12 @@ struct GTY(()) rtl_eh { struct gimple_df; struct temp_slot; typedef struct temp_slot *temp_slot_p; -struct call_site_record; +struct call_site_record_d; DEF_VEC_P(temp_slot_p); DEF_VEC_ALLOC_P(temp_slot_p,gc); -struct ipa_opt_pass; -typedef struct ipa_opt_pass *ipa_opt_pass; +struct ipa_opt_pass_d; +typedef struct ipa_opt_pass_d *ipa_opt_pass; DEF_VEC_P(ipa_opt_pass); DEF_VEC_ALLOC_P(ipa_opt_pass,heap); diff --git a/gcc/gcse.c b/gcc/gcse.c index b3fa362aff3..bfd8c6822ba 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -343,7 +343,7 @@ struct occr [one could build a mapping table without holes afterwards though]. Someday I'll perform the computation and figure it out. */ -struct hash_table +struct hash_table_d { /* The table itself. This is an array of `expr_hash_table_size' elements. */ @@ -360,10 +360,10 @@ struct hash_table }; /* Expression hash table. */ -static struct hash_table expr_hash_table; +static struct hash_table_d expr_hash_table; /* Copy propagation hash table. */ -static struct hash_table set_hash_table; +static struct hash_table_d set_hash_table; /* This is a list of expressions which are MEMs and will be used by load or store motion. @@ -445,30 +445,30 @@ static void *gcalloc (size_t, size_t) ATTRIBUTE_MALLOC; static void *gcse_alloc (unsigned long); static void alloc_gcse_mem (void); static void free_gcse_mem (void); -static void hash_scan_insn (rtx, struct hash_table *); -static void hash_scan_set (rtx, rtx, struct hash_table *); -static void hash_scan_clobber (rtx, rtx, struct hash_table *); -static void hash_scan_call (rtx, rtx, struct hash_table *); +static void hash_scan_insn (rtx, struct hash_table_d *); +static void hash_scan_set (rtx, rtx, struct hash_table_d *); +static void hash_scan_clobber (rtx, rtx, struct hash_table_d *); +static void hash_scan_call (rtx, rtx, struct hash_table_d *); static int want_to_gcse_p (rtx); static bool gcse_constant_p (const_rtx); static int oprs_unchanged_p (const_rtx, const_rtx, int); static int oprs_anticipatable_p (const_rtx, const_rtx); static int oprs_available_p (const_rtx, const_rtx); static void insert_expr_in_table (rtx, enum machine_mode, rtx, int, int, - struct hash_table *); -static void insert_set_in_table (rtx, rtx, struct hash_table *); + struct hash_table_d *); +static void insert_set_in_table (rtx, rtx, struct hash_table_d *); static unsigned int hash_expr (const_rtx, enum machine_mode, int *, int); static unsigned int hash_set (int, int); static int expr_equiv_p (const_rtx, const_rtx); static void record_last_reg_set_info (rtx, int); static void record_last_mem_set_info (rtx); static void record_last_set_info (rtx, const_rtx, void *); -static void compute_hash_table (struct hash_table *); -static void alloc_hash_table (int, struct hash_table *, int); -static void free_hash_table (struct hash_table *); -static void compute_hash_table_work (struct hash_table *); -static void dump_hash_table (FILE *, const char *, struct hash_table *); -static struct expr *lookup_set (unsigned int, struct hash_table *); +static void compute_hash_table (struct hash_table_d *); +static void alloc_hash_table (int, struct hash_table_d *, int); +static void free_hash_table (struct hash_table_d *); +static void compute_hash_table_work (struct hash_table_d *); +static void dump_hash_table (FILE *, const char *, struct hash_table_d *); +static struct expr *lookup_set (unsigned int, struct hash_table_d *); static struct expr *next_set (unsigned int, struct expr *); static void reset_opr_set_tables (void); static int oprs_not_set_p (const_rtx, const_rtx); @@ -481,7 +481,7 @@ static void free_cprop_mem (void); static void compute_transp (const_rtx, int, sbitmap *, int); static void compute_transpout (void); static void compute_local_properties (sbitmap *, sbitmap *, sbitmap *, - struct hash_table *); + struct hash_table_d *); static void compute_cprop_data (void); static void find_used_regs (rtx *, void *); static int try_replace_reg (rtx, rtx, rtx); @@ -691,7 +691,7 @@ free_gcse_mem (void) static void compute_local_properties (sbitmap *transp, sbitmap *comp, sbitmap *antloc, - struct hash_table *table) + struct hash_table_d *table) { unsigned int i; @@ -1096,7 +1096,7 @@ expr_equiv_p (const_rtx x, const_rtx y) static void insert_expr_in_table (rtx x, enum machine_mode mode, rtx insn, int antic_p, - int avail_p, struct hash_table *table) + int avail_p, struct hash_table_d *table) { int found, do_not_record_p; unsigned int hash; @@ -1197,7 +1197,7 @@ insert_expr_in_table (rtx x, enum machine_mode mode, rtx insn, int antic_p, basic block. */ static void -insert_set_in_table (rtx x, rtx insn, struct hash_table *table) +insert_set_in_table (rtx x, rtx insn, struct hash_table_d *table) { int found; unsigned int hash; @@ -1293,7 +1293,7 @@ gcse_constant_p (const_rtx x) expression one). */ static void -hash_scan_set (rtx pat, rtx insn, struct hash_table *table) +hash_scan_set (rtx pat, rtx insn, struct hash_table_d *table) { rtx src = SET_SRC (pat); rtx dest = SET_DEST (pat); @@ -1432,14 +1432,14 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table *table) static void hash_scan_clobber (rtx x ATTRIBUTE_UNUSED, rtx insn ATTRIBUTE_UNUSED, - struct hash_table *table ATTRIBUTE_UNUSED) + struct hash_table_d *table ATTRIBUTE_UNUSED) { /* Currently nothing to do. */ } static void hash_scan_call (rtx x ATTRIBUTE_UNUSED, rtx insn ATTRIBUTE_UNUSED, - struct hash_table *table ATTRIBUTE_UNUSED) + struct hash_table_d *table ATTRIBUTE_UNUSED) { /* Currently nothing to do. */ } @@ -1456,7 +1456,7 @@ hash_scan_call (rtx x ATTRIBUTE_UNUSED, rtx insn ATTRIBUTE_UNUSED, otherwise it is for the expression hash table. */ static void -hash_scan_insn (rtx insn, struct hash_table *table) +hash_scan_insn (rtx insn, struct hash_table_d *table) { rtx pat = PATTERN (insn); int i; @@ -1486,7 +1486,7 @@ hash_scan_insn (rtx insn, struct hash_table *table) } static void -dump_hash_table (FILE *file, const char *name, struct hash_table *table) +dump_hash_table (FILE *file, const char *name, struct hash_table_d *table) { int i; /* Flattened out table, so it's printed in proper order. */ @@ -1647,7 +1647,7 @@ record_last_set_info (rtx dest, const_rtx setter ATTRIBUTE_UNUSED, void *data) TABLE is the table computed. */ static void -compute_hash_table_work (struct hash_table *table) +compute_hash_table_work (struct hash_table_d *table) { int i; @@ -1706,7 +1706,7 @@ compute_hash_table_work (struct hash_table *table) be created. */ static void -alloc_hash_table (int n_insns, struct hash_table *table, int set_p) +alloc_hash_table (int n_insns, struct hash_table_d *table, int set_p) { int n; @@ -1726,7 +1726,7 @@ alloc_hash_table (int n_insns, struct hash_table *table, int set_p) /* Free things allocated by alloc_hash_table. */ static void -free_hash_table (struct hash_table *table) +free_hash_table (struct hash_table_d *table) { free (table->table); } @@ -1735,7 +1735,7 @@ free_hash_table (struct hash_table *table) expression hash table. */ static void -compute_hash_table (struct hash_table *table) +compute_hash_table (struct hash_table_d *table) { /* Initialize count of number of entries in hash table. */ table->n_elems = 0; @@ -1750,7 +1750,7 @@ compute_hash_table (struct hash_table *table) table entry, or NULL if not found. */ static struct expr * -lookup_set (unsigned int regno, struct hash_table *table) +lookup_set (unsigned int regno, struct hash_table_d *table) { unsigned int hash = hash_set (regno, table->size); struct expr *expr; diff --git a/gcc/graphite.c b/gcc/graphite.c index 6b497a808f7..4e6919736ce 100644 --- a/gcc/graphite.c +++ b/gcc/graphite.c @@ -181,7 +181,7 @@ register_bb_in_sese (basic_block entry_bb, basic_block exit_bb, sese region) sese new_sese (edge entry, edge exit) { - sese res = XNEW (struct sese); + sese res = XNEW (struct sese_d); SESE_ENTRY (res) = entry; SESE_EXIT (res) = exit; @@ -274,7 +274,7 @@ static void loop_iv_stack_push_iv (loop_iv_stack stack, tree iv, const char *name) { iv_stack_entry *entry = XNEW (iv_stack_entry); - name_tree named_iv = XNEW (struct name_tree); + name_tree named_iv = XNEW (struct name_tree_d); named_iv->t = iv; named_iv->name = name; @@ -396,7 +396,7 @@ free_loop_iv_stack (loop_iv_stack stack) /* Structure containing the mapping between the CLooG's induction variable and the type of the old induction variable. */ -typedef struct ivtype_map_elt +typedef struct ivtype_map_elt_d { tree type; const char *cloog_iv; @@ -417,7 +417,7 @@ debug_ivtype_elt (ivtype_map_elt elt) static int debug_ivtype_map_1 (void **slot, void *s ATTRIBUTE_UNUSED) { - struct ivtype_map_elt *entry = (struct ivtype_map_elt *) *slot; + struct ivtype_map_elt_d *entry = (struct ivtype_map_elt_d *) *slot; debug_ivtype_elt (entry); return 1; } @@ -437,7 +437,7 @@ new_ivtype_map_elt (const char *cloog_iv, tree type) { ivtype_map_elt res; - res = XNEW (struct ivtype_map_elt); + res = XNEW (struct ivtype_map_elt_d); res->cloog_iv = cloog_iv; res->type = type; @@ -449,7 +449,7 @@ new_ivtype_map_elt (const char *cloog_iv, tree type) static hashval_t ivtype_map_elt_info (const void *elt) { - return htab_hash_pointer (((const struct ivtype_map_elt *) elt)->cloog_iv); + return htab_hash_pointer (((const struct ivtype_map_elt_d *) elt)->cloog_iv); } /* Compares database elements E1 and E2. */ @@ -457,8 +457,8 @@ ivtype_map_elt_info (const void *elt) static int eq_ivtype_map_elts (const void *e1, const void *e2) { - const struct ivtype_map_elt *elt1 = (const struct ivtype_map_elt *) e1; - const struct ivtype_map_elt *elt2 = (const struct ivtype_map_elt *) e2; + const struct ivtype_map_elt_d *elt1 = (const struct ivtype_map_elt_d *) e1; + const struct ivtype_map_elt_d *elt2 = (const struct ivtype_map_elt_d *) e2; return (elt1->cloog_iv == elt2->cloog_iv); } @@ -472,7 +472,7 @@ eq_ivtype_map_elts (const void *e1, const void *e2) static tree gcc_type_for_cloog_iv (const char *cloog_iv, graphite_bb_p gbb) { - struct ivtype_map_elt tmp; + struct ivtype_map_elt_d tmp; PTR *slot; tmp.cloog_iv = cloog_iv; @@ -1339,7 +1339,7 @@ free_graphite_bb (struct graphite_bb *gbb) /* Structure containing the mapping between the old names and the new names used after block copy in the new loop context. */ -typedef struct rename_map_elt +typedef struct rename_map_elt_d { tree old_name, new_name; } *rename_map_elt; @@ -1362,7 +1362,7 @@ debug_rename_elt (rename_map_elt elt) static int debug_rename_map_1 (void **slot, void *s ATTRIBUTE_UNUSED) { - struct rename_map_elt *entry = (struct rename_map_elt *) *slot; + struct rename_map_elt_d *entry = (struct rename_map_elt_d *) *slot; debug_rename_elt (entry); return 1; } @@ -1382,7 +1382,7 @@ new_rename_map_elt (tree old_name, tree new_name) { rename_map_elt res; - res = XNEW (struct rename_map_elt); + res = XNEW (struct rename_map_elt_d); res->old_name = old_name; res->new_name = new_name; @@ -1394,7 +1394,7 @@ new_rename_map_elt (tree old_name, tree new_name) static hashval_t rename_map_elt_info (const void *elt) { - return htab_hash_pointer (((const struct rename_map_elt *) elt)->old_name); + return htab_hash_pointer (((const struct rename_map_elt_d *) elt)->old_name); } /* Compares database elements E1 and E2. */ @@ -1402,8 +1402,8 @@ rename_map_elt_info (const void *elt) static int eq_rename_map_elts (const void *e1, const void *e2) { - const struct rename_map_elt *elt1 = (const struct rename_map_elt *) e1; - const struct rename_map_elt *elt2 = (const struct rename_map_elt *) e2; + const struct rename_map_elt_d *elt1 = (const struct rename_map_elt_d *) e1; + const struct rename_map_elt_d *elt2 = (const struct rename_map_elt_d *) e2; return (elt1->old_name == elt2->old_name); } @@ -1413,7 +1413,7 @@ eq_rename_map_elts (const void *e1, const void *e2) static tree get_new_name_from_old_name (htab_t map, tree old_name) { - struct rename_map_elt tmp; + struct rename_map_elt_d tmp; PTR *slot; tmp.old_name = old_name; @@ -2419,7 +2419,7 @@ scop_record_loop (scop_p scop, loop_p loop) if (!induction_var) return false; - oldiv = XNEW (struct name_tree); + oldiv = XNEW (struct name_tree_d); oldiv->t = induction_var; oldiv->name = get_name (SSA_NAME_VAR (oldiv->t)); oldiv->loop = loop; @@ -2664,7 +2664,7 @@ param_index (tree var, scop_p scop) gcc_assert (SCOP_ADD_PARAMS (scop)); - nvar = XNEW (struct name_tree); + nvar = XNEW (struct name_tree_d); nvar->t = var; nvar->name = NULL; VEC_safe_push (name_tree, heap, SCOP_PARAMS (scop), nvar); @@ -4428,7 +4428,7 @@ build_iv_mapping (loop_iv_stack ivstack, htab_t map, gbb_p gbb, scop_p scop) for (i = 0; VEC_iterate (name_tree, SCOP_OLDIVS (scop), i, iv); i++) { - struct rename_map_elt tmp; + struct rename_map_elt_d tmp; if (!flow_bb_inside_loop_p (iv->loop, GBB_BB (gbb))) continue; @@ -4450,7 +4450,7 @@ build_iv_mapping (loop_iv_stack ivstack, htab_t map, gbb_p gbb, scop_p scop) static void register_old_and_new_names (htab_t map, tree old_name, tree new_name) { - struct rename_map_elt tmp; + struct rename_map_elt_d tmp; PTR *slot; tmp.old_name = old_name; @@ -4549,7 +4549,7 @@ copy_bb_and_scalar_dependences (basic_block bb, scop_p scop, static int add_loop_exit_phis (void **slot, void *s) { - struct rename_map_elt *entry = (struct rename_map_elt *) *slot; + struct rename_map_elt_d *entry = (struct rename_map_elt_d *) *slot; tree new_name = entry->new_name; basic_block bb = (basic_block) s; gimple phi = create_phi_node (new_name, bb); @@ -4606,7 +4606,7 @@ default_liveout_before_guard (htab_t liveout_before_guard, tree old_name) static int add_guard_exit_phis (void **slot, void *s) { - struct rename_map_elt *entry = (struct rename_map_elt *) *slot; + struct rename_map_elt_d *entry = (struct rename_map_elt_d *) *slot; struct igp *i = (struct igp *) s; basic_block bb = i->bb; edge true_edge = i->true_edge; @@ -4661,11 +4661,11 @@ insert_guard_phis (scop_p scop, basic_block bb, edge true_edge, static int copy_renames (void **slot, void *s) { - struct rename_map_elt *entry = (struct rename_map_elt *) *slot; + struct rename_map_elt_d *entry = (struct rename_map_elt_d *) *slot; htab_t res = (htab_t) s; tree old_name = entry->old_name; tree new_name = entry->new_name; - struct rename_map_elt tmp; + struct rename_map_elt_d tmp; PTR *x; tmp.old_name = old_name; @@ -5009,7 +5009,8 @@ remove_sese_region (sese region) VEC_free (basic_block, heap, bbs); } -typedef struct ifsese { +typedef struct ifsese_d +{ sese region; sese true_region; sese false_region; @@ -5083,10 +5084,10 @@ create_if_region_on_edge (edge entry, tree condition) { edge e; edge_iterator ei; - sese sese_region = GGC_NEW (struct sese); - sese true_region = GGC_NEW (struct sese); - sese false_region = GGC_NEW (struct sese); - ifsese if_region = GGC_NEW (struct ifsese); + sese sese_region = GGC_NEW (struct sese_d); + sese true_region = GGC_NEW (struct sese_d); + sese false_region = GGC_NEW (struct sese_d); + ifsese if_region = GGC_NEW (struct ifsese_d); edge exit = create_empty_if_region_on_edge (entry, condition); if_region->region = sese_region; @@ -5369,7 +5370,7 @@ compute_cloog_iv_types_1 (graphite_bb_p gbb, for (t = user_stmt->substitutions; t; t = t->next, index++) { PTR *slot; - struct ivtype_map_elt tmp; + struct ivtype_map_elt_d tmp; struct clast_expr *expr = (struct clast_expr *) ((struct clast_assignment *)t)->RHS; diff --git a/gcc/graphite.h b/gcc/graphite.h index a2700655ea4..e663c2d0fe5 100644 --- a/gcc/graphite.h +++ b/gcc/graphite.h @@ -265,7 +265,7 @@ struct loop_to_cloog_loop_str CloogLoop *cloog_loop; }; -typedef struct name_tree +typedef struct name_tree_d { tree t; const char *name; @@ -277,7 +277,7 @@ DEF_VEC_ALLOC_P (name_tree, heap); /* A Single Entry, Single Exit region is a part of the CFG delimited by two edges. */ -typedef struct sese +typedef struct sese_d { /* Single ENTRY and single EXIT from the SESE region. */ edge entry, exit; diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 7761aab92d6..2b63806172b 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -1,5 +1,5 @@ /* Interprocedural constant propagation - Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Razya Ladelsky <RAZYA@il.ibm.com> This file is part of GCC. @@ -1201,7 +1201,7 @@ cgraph_gate_cp (void) return flag_ipa_cp; } -struct ipa_opt_pass pass_ipa_cp = +struct ipa_opt_pass_d pass_ipa_cp = { { IPA_PASS, diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index c8cb498109b..18eed571aae 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1773,7 +1773,7 @@ inline_transform (struct cgraph_node *node) return todo | execute_fixup_cfg (); } -struct ipa_opt_pass pass_ipa_inline = +struct ipa_opt_pass_d pass_ipa_inline = { { IPA_PASS, diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c index 41791d463c5..35d27a33696 100644 --- a/gcc/ipa-pure-const.c +++ b/gcc/ipa-pure-const.c @@ -1,5 +1,5 @@ /* Callgraph based analysis of static variables. - Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Kenneth Zadeck <zadeck@naturalbridge.com> This file is part of GCC. @@ -876,7 +876,7 @@ gate_pure_const (void) && !(errorcount || sorrycount)); } -struct ipa_opt_pass pass_ipa_pure_const = +struct ipa_opt_pass_d pass_ipa_pure_const = { { IPA_PASS, diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c index fce851e0eef..db63d02554f 100644 --- a/gcc/ipa-reference.c +++ b/gcc/ipa-reference.c @@ -1,5 +1,5 @@ /* Callgraph based analysis of static variables. - Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Kenneth Zadeck <zadeck@naturalbridge.com> This file is part of GCC. @@ -1250,7 +1250,7 @@ gate_reference (void) && !(errorcount || sorrycount)); } -struct ipa_opt_pass pass_ipa_reference = +struct ipa_opt_pass_d pass_ipa_reference = { { IPA_PASS, diff --git a/gcc/omega.c b/gcc/omega.c index af3bd84d39c..e307ba29057 100644 --- a/gcc/omega.c +++ b/gcc/omega.c @@ -1305,7 +1305,7 @@ verify_omega_pb (omega_pb pb) enum omega_result result; int e; bool any_color = false; - omega_pb tmp_problem = XNEW (struct omega_pb); + omega_pb tmp_problem = XNEW (struct omega_pb_d); omega_copy_problem (tmp_problem, pb); tmp_problem->safe_vars = 0; @@ -2286,7 +2286,7 @@ omega_eliminate_redundant (omega_pb pb, bool expensive) if (!expensive) goto eliminate_redundant_done; - tmp_problem = XNEW (struct omega_pb); + tmp_problem = XNEW (struct omega_pb_d); conservative++; for (e = pb->num_geqs - 1; e >= 0; e--) @@ -2648,7 +2648,7 @@ omega_eliminate_red (omega_pb pb, bool eliminate_all) return; conservative++; - tmp_problem = XNEW (struct omega_pb); + tmp_problem = XNEW (struct omega_pb_d); for (e = pb->num_geqs - 1; e >= 0; e--) if (pb->geqs[e].color == omega_red) @@ -3491,7 +3491,7 @@ parallel_splinter (omega_pb pb, int e, int diff, omega_print_problem (dump_file, pb); } - tmp_problem = XNEW (struct omega_pb); + tmp_problem = XNEW (struct omega_pb_d); omega_copy_eqn (&pb->eqs[0], &pb->geqs[e], pb->num_vars); pb->num_eqs = 1; @@ -5499,7 +5499,7 @@ omega_alloc_problem (int nvars, int nprot) omega_initialize (); /* Allocate and initialize PB. */ - pb = XCNEW (struct omega_pb); + pb = XCNEW (struct omega_pb_d); pb->var = XCNEWVEC (int, OMEGA_MAX_VARS + 2); pb->forwarding_address = XCNEWVEC (int, OMEGA_MAX_VARS + 2); pb->geqs = omega_alloc_eqns (0, OMEGA_MAX_GEQS); diff --git a/gcc/omega.h b/gcc/omega.h index b97bfc50f21..02c17987dee 100644 --- a/gcc/omega.h +++ b/gcc/omega.h @@ -5,7 +5,7 @@ This code has no license restrictions, and is considered public domain. - Changes copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. + Changes copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. Contributed by Sebastian Pop <sebastian.pop@inria.fr> This file is part of GCC. @@ -58,7 +58,7 @@ enum omega_eqn_color { }; /* Structure for equations. */ -typedef struct eqn +typedef struct eqn_d { int key; int touched; @@ -72,7 +72,7 @@ typedef struct eqn int *coef; } *eqn; -typedef struct omega_pb +typedef struct omega_pb_d { /* The number of variables in the system of equations. */ int num_vars; @@ -215,7 +215,7 @@ static inline eqn omega_alloc_eqns (int s, int n) { int i; - eqn res = (eqn) (xcalloc (n, sizeof (struct eqn))); + eqn res = (eqn) (xcalloc (n, sizeof (struct eqn_d))); for (i = n - 1; i >= 0; i--) { diff --git a/gcc/optabs.c b/gcc/optabs.c index 3a13eaddc8c..2b9da2cdb29 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -55,25 +55,25 @@ along with GCC; see the file COPYING3. If not see See expr.h for documentation of these optabs. */ #if GCC_VERSION >= 4000 -__extension__ struct optab optab_table[OTI_MAX] +__extension__ struct optab_d optab_table[OTI_MAX] = { [0 ... OTI_MAX - 1].handlers[0 ... NUM_MACHINE_MODES - 1].insn_code = CODE_FOR_nothing }; #else /* init_insn_codes will do runtime initialization otherwise. */ -struct optab optab_table[OTI_MAX]; +struct optab_d optab_table[OTI_MAX]; #endif rtx libfunc_table[LTI_MAX]; /* Tables of patterns for converting one mode to another. */ #if GCC_VERSION >= 4000 -__extension__ struct convert_optab convert_optab_table[COI_MAX] +__extension__ struct convert_optab_d convert_optab_table[COI_MAX] = { [0 ... COI_MAX - 1].handlers[0 ... NUM_MACHINE_MODES - 1] [0 ... NUM_MACHINE_MODES - 1].insn_code = CODE_FOR_nothing }; #else /* init_convert_optab will do runtime initialization otherwise. */ -struct convert_optab convert_optab_table[COI_MAX]; +struct convert_optab_d convert_optab_table[COI_MAX]; #endif /* Contains the optab used for each rtx code. */ @@ -2248,7 +2248,7 @@ sign_expand_binop (enum machine_mode mode, optab uoptab, optab soptab, { rtx temp; optab direct_optab = unsignedp ? uoptab : soptab; - struct optab wide_soptab; + struct optab_d wide_soptab; /* Do it without widening, if possible. */ temp = expand_binop (mode, direct_optab, op0, op1, target, diff --git a/gcc/optabs.h b/gcc/optabs.h index f4ddfa1480b..096feda7df2 100644 --- a/gcc/optabs.h +++ b/gcc/optabs.h @@ -1,5 +1,5 @@ /* Definitions for code generation pass of GNU compiler. - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GCC. @@ -43,29 +43,30 @@ struct optab_handlers enum insn_code insn_code; }; -struct optab +struct optab_d { enum rtx_code code; const char *libcall_basename; char libcall_suffix; - void (*libcall_gen)(struct optab *, const char *name, char suffix, enum machine_mode); + void (*libcall_gen)(struct optab_d *, const char *name, char suffix, + enum machine_mode); struct optab_handlers handlers[NUM_MACHINE_MODES]; }; -typedef struct optab * optab; +typedef struct optab_d * optab; /* A convert_optab is for some sort of conversion operation between modes. The first array index is the destination mode, the second is the source mode. */ -struct convert_optab +struct convert_optab_d { enum rtx_code code; const char *libcall_basename; - void (*libcall_gen)(struct convert_optab *, const char *name, + void (*libcall_gen)(struct convert_optab_d *, const char *name, enum machine_mode, enum machine_mode); struct optab_handlers handlers[NUM_MACHINE_MODES][NUM_MACHINE_MODES]; }; -typedef struct convert_optab *convert_optab; +typedef struct convert_optab_d *convert_optab; /* Given an enum insn_code, access the function to construct the body of that kind of insn. */ @@ -369,7 +370,7 @@ enum optab_index OTI_MAX }; -extern struct optab optab_table[OTI_MAX]; +extern struct optab_d optab_table[OTI_MAX]; #define ssadd_optab (&optab_table[OTI_ssadd]) #define usadd_optab (&optab_table[OTI_usadd]) @@ -571,7 +572,7 @@ enum convert_optab_index COI_MAX }; -extern struct convert_optab convert_optab_table[COI_MAX]; +extern struct convert_optab_d convert_optab_table[COI_MAX]; #define sext_optab (&convert_optab_table[COI_sext]) #define zext_optab (&convert_optab_table[COI_zext]) diff --git a/gcc/passes.c b/gcc/passes.c index 945cf5cec1a..a050df3516e 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -1152,14 +1152,14 @@ update_properties_after_pass (void *data) static void add_ipa_transform_pass (void *data) { - struct ipa_opt_pass *ipa_pass = (struct ipa_opt_pass *) data; + struct ipa_opt_pass_d *ipa_pass = (struct ipa_opt_pass_d *) data; VEC_safe_push (ipa_opt_pass, heap, cfun->ipa_transforms_to_apply, ipa_pass); } /* Execute summary generation for all of the passes in IPA_PASS. */ static void -execute_ipa_summary_passes (struct ipa_opt_pass *ipa_pass) +execute_ipa_summary_passes (struct ipa_opt_pass_d *ipa_pass) { while (ipa_pass) { @@ -1173,7 +1173,7 @@ execute_ipa_summary_passes (struct ipa_opt_pass *ipa_pass) ipa_pass->generate_summary (); pass_fini_dump_file (pass); } - ipa_pass = (struct ipa_opt_pass *)ipa_pass->pass.next; + ipa_pass = (struct ipa_opt_pass_d *)ipa_pass->pass.next; } } @@ -1181,7 +1181,7 @@ execute_ipa_summary_passes (struct ipa_opt_pass *ipa_pass) static void execute_one_ipa_transform_pass (struct cgraph_node *node, - struct ipa_opt_pass *ipa_pass) + struct ipa_opt_pass_d *ipa_pass) { struct opt_pass *pass = &ipa_pass->pass; unsigned int todo_after = 0; @@ -1353,7 +1353,7 @@ execute_ipa_pass_list (struct opt_pass *pass) { if (!quiet_flag && !cfun) fprintf (stderr, " <summary generate>"); - execute_ipa_summary_passes ((struct ipa_opt_pass *) pass); + execute_ipa_summary_passes ((struct ipa_opt_pass_d *) pass); } summaries_generated = true; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3a8f4ab3cb4..b82f4721256 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2009-05-15 Ian Lance Taylor <iant@google.com> + + * gcc.dg/Wcxx-compat-10.c: New testcase. + 2009-05-15 Manuel López-Ibáñez <manu@gcc.gnu.org> PR 16302 diff --git a/gcc/testsuite/gcc.dg/Wcxx-compat-10.c b/gcc/testsuite/gcc.dg/Wcxx-compat-10.c new file mode 100644 index 00000000000..0f1d037bfea --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wcxx-compat-10.c @@ -0,0 +1,73 @@ +/* { dg-do compile } */ +/* { dg-options "-Wc++-compat" } */ + +struct s1 { int f; }; +typedef int s2; +void +f1 () +{ + typedef int s1; + struct s2 { int f; }; +} + +struct s3 { int f; }; +typedef struct s3 s3; + +typedef struct s4 s4; +struct s4 { int f; }; + +struct s5 { int f; }; /* { dg-message "note: originally defined here" } */ +typedef int s5; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + +typedef int s6; /* { dg-message "note: originally defined here" } */ +struct s6 { int f; }; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + +void +f2 () +{ + struct s7 { int f; }; /* { dg-message "note: originally defined here" } */ + typedef int s7; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + + typedef int s8; /* { dg-message "note: originally defined here" } */ + struct s8 { int f; }; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + + struct s9 { int f; }; + { typedef int s9; } + + typedef int s10; + { struct s10 { int f; }; } +} + +enum e1 { A }; +typedef int e2; +void +f3 () +{ + typedef int e1; + enum e2 { B }; +} + +enum e3 { C }; +typedef enum e3 e3; + +enum e5 { E }; /* { dg-message "note: originally defined here" } */ +typedef int e5; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + +typedef int e6; /* { dg-message "note: originally defined here" } */ +enum e6 { F }; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + +void +f4 () +{ + enum e7 { G }; /* { dg-message "note: originally defined here" } */ + typedef int e7; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + + typedef int e8; /* { dg-message "note: originally defined here" } */ + enum e8 { H }; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + + enum e9 { I }; + { typedef int e9; } + + typedef int e10; + { enum e10 { J }; } +} diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 077f9d602d7..68d6f5b1c13 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -917,7 +917,7 @@ static struct label_record /* Callback for for_each_eh_region. Helper for cleanup_dead_labels. */ static void -update_eh_label (struct eh_region *region) +update_eh_label (struct eh_region_d *region) { tree old_label = get_eh_region_tree_label (region); if (old_label) diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index 204bf7e336b..6a19bd52930 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -87,7 +87,7 @@ struct_ptr_hash (const void *a) of space by only allocating memory for those that can throw. */ static void -record_stmt_eh_region (struct eh_region *region, gimple t) +record_stmt_eh_region (struct eh_region_d *region, gimple t) { if (!region) return; @@ -371,7 +371,7 @@ struct leh_state /* What's "current" while constructing the eh region tree. These correspond to variables of the same name in cfun->eh, which we don't have easy access to. */ - struct eh_region *cur_region; + struct eh_region_d *cur_region; /* Processing of TRY_FINALLY requires a bit more state. This is split out into a separate structure so that we don't have to @@ -395,7 +395,7 @@ struct leh_tf_state struct leh_state *outer; /* The exception region created for it. */ - struct eh_region *region; + struct eh_region_d *region; /* The goto queue. */ struct goto_queue_node *goto_queue; @@ -1646,7 +1646,7 @@ lower_try_finally (struct leh_state *state, gimple tp) static gimple_seq lower_catch (struct leh_state *state, gimple tp) { - struct eh_region *try_region; + struct eh_region_d *try_region; struct leh_state this_state; gimple_stmt_iterator gsi; tree out_label; @@ -1665,7 +1665,7 @@ lower_catch (struct leh_state *state, gimple tp) out_label = NULL; for (gsi = gsi_start (gimple_try_cleanup (tp)); !gsi_end_p (gsi); ) { - struct eh_region *catch_region; + struct eh_region_d *catch_region; tree eh_label; gimple x, gcatch; @@ -1707,7 +1707,7 @@ static gimple_seq lower_eh_filter (struct leh_state *state, gimple tp) { struct leh_state this_state; - struct eh_region *this_region; + struct eh_region_d *this_region; gimple inner; tree eh_label; @@ -1744,7 +1744,7 @@ static gimple_seq lower_cleanup (struct leh_state *state, gimple tp) { struct leh_state this_state; - struct eh_region *this_region; + struct eh_region_d *this_region; struct leh_tf_state fake_tf; gimple_seq result; @@ -1947,7 +1947,7 @@ struct gimple_opt_pass pass_lower_eh = /* Construct EH edges for STMT. */ static void -make_eh_edge (struct eh_region *region, void *data) +make_eh_edge (struct eh_region_d *region, void *data) { gimple stmt; tree lab; @@ -2026,7 +2026,7 @@ redirect_eh_edge (edge e, basic_block new_bb) bool is_resx; bool inlinable = false; tree label = gimple_block_label (new_bb); - struct eh_region *r; + struct eh_region_d *r; if (gimple_code (stmt) == GIMPLE_RESX) { @@ -2066,7 +2066,7 @@ static bool mark_eh_edge_found_error; field, output error if something goes wrong. */ static void -mark_eh_edge (struct eh_region *region, void *data) +mark_eh_edge (struct eh_region_d *region, void *data) { gimple stmt; tree lab; @@ -2958,7 +2958,7 @@ struct update_info operands from DATA->bb_to_remove. */ static void -make_eh_edge_and_update_phi (struct eh_region *region, void *data) +make_eh_edge_and_update_phi (struct eh_region_d *region, void *data) { struct update_info *info = (struct update_info *) data; edge e, e2; diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index 0237bcef188..a123341920e 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -164,7 +164,7 @@ struct cgraph_node_set_def; /* Description of IPA pass with generate summary, write, execute, read and transform stages. */ -struct ipa_opt_pass +struct ipa_opt_pass_d { struct opt_pass pass; @@ -401,10 +401,10 @@ extern struct gimple_opt_pass pass_local_pure_const; extern struct gimple_opt_pass pass_tracer; /* IPA Passes */ -extern struct ipa_opt_pass pass_ipa_inline; -extern struct ipa_opt_pass pass_ipa_cp; -extern struct ipa_opt_pass pass_ipa_reference; -extern struct ipa_opt_pass pass_ipa_pure_const; +extern struct ipa_opt_pass_d pass_ipa_inline; +extern struct ipa_opt_pass_d pass_ipa_cp; +extern struct ipa_opt_pass_d pass_ipa_reference; +extern struct ipa_opt_pass_d pass_ipa_pure_const; extern struct simple_ipa_opt_pass pass_ipa_matrix_reorg; extern struct simple_ipa_opt_pass pass_ipa_early_inline; diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c index a5d4dcd5da6..7ebd6c082ad 100644 --- a/gcc/tree-predcom.c +++ b/gcc/tree-predcom.c @@ -1,5 +1,5 @@ /* Predictive commoning. - Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GCC. @@ -210,7 +210,7 @@ along with GCC; see the file COPYING3. If not see /* Data references (or phi nodes that carry data reference values across loop iterations). */ -typedef struct dref +typedef struct dref_d { /* The reference itself. */ struct data_reference *ref; @@ -775,7 +775,7 @@ split_data_refs_to_components (struct loop *loop, comps[ca] = comp; } - dataref = XCNEW (struct dref); + dataref = XCNEW (struct dref_d); dataref->ref = dr; dataref->stmt = DR_STMT (dr); dataref->offset = double_int_zero; @@ -1126,7 +1126,7 @@ find_looparound_phi (struct loop *loop, dref ref, dref root) static void insert_looparound_copy (chain_p chain, dref ref, gimple phi) { - dref nw = XCNEW (struct dref), aref; + dref nw = XCNEW (struct dref_d), aref; unsigned i; nw->stmt = phi; @@ -2339,7 +2339,7 @@ combine_chains (chain_p ch1, chain_p ch2) for (i = 0; (VEC_iterate (dref, ch1->refs, i, r1) && VEC_iterate (dref, ch2->refs, i, r2)); i++) { - nw = XCNEW (struct dref); + nw = XCNEW (struct dref_d); nw->stmt = stmt_combining_refs (r1, r2); nw->distance = r1->distance; diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 36a2fbc1c56..f604c48d1d6 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,8 @@ +2009-05-15 Ian Lance Taylor <iant@google.com> + + * include/cpplib.h (enum cpp_builtin_type): Rename from enum + builtin_type. Change all uses. + 2009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR cpp/36674 diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index 83439c7341f..effe9a04b1f 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -578,7 +578,7 @@ enum node_type /* Different flavors of builtin macro. _Pragma is an operator, but we handle it with the builtin code for efficiency reasons. */ -enum builtin_type +enum cpp_builtin_type { BT_SPECLINE = 0, /* `__LINE__' */ BT_DATE, /* `__DATE__' */ @@ -624,7 +624,7 @@ union GTY(()) _cpp_hashnode_value { /* Answers to an assertion. */ struct answer * GTY ((tag ("NTV_ANSWER"))) answers; /* Code for a builtin macro. */ - enum builtin_type GTY ((tag ("NTV_BUILTIN"))) builtin; + enum cpp_builtin_type GTY ((tag ("NTV_BUILTIN"))) builtin; /* Macro argument index. */ unsigned short GTY ((tag ("NTV_ARGUMENT"))) arg_index; }; diff --git a/libcpp/init.c b/libcpp/init.c index aef39981792..0f6f49f41da 100644 --- a/libcpp/init.c +++ b/libcpp/init.c @@ -419,7 +419,7 @@ cpp_init_special_builtins (cpp_reader *pfile) if (b->always_warn_if_redefined || CPP_OPTION (pfile, warn_builtin_macro_redefined)) hp->flags |= NODE_WARN; - hp->value.builtin = (enum builtin_type) b->value; + hp->value.builtin = (enum cpp_builtin_type) b->value; } } |