diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-17 10:37:37 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-17 10:37:37 +0000 |
commit | fad150a1dd9a382bfe3bce39c1dab51191042d47 (patch) | |
tree | 8b477801e1b185a3dcb0662585b186128991f6fe | |
parent | 568aa6455bee169296c908fe07e629f3db0748b8 (diff) | |
download | gcc-fad150a1dd9a382bfe3bce39c1dab51191042d47.tar.gz |
2008-07-17 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r137918
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@137920 138bc75d-0d04-0410-961f-82ee72b054a4
163 files changed, 3285 insertions, 1248 deletions
diff --git a/ChangeLog.melt b/ChangeLog.melt index cc90e1310df..71cf373a5a9 100644 --- a/ChangeLog.melt +++ b/ChangeLog.melt @@ -1,3 +1,6 @@ +2008-07-17 Basile Starynkevitch <basile@starynkevitch.net> + MELT branch merged with trunk r137918 + 2008-07-15 Basile Starynkevitch <basile@starynkevitch.net> MELT branch merged with trunk r137813 diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 32438121f14..b6db7b7803a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,204 @@ +2008-07-17 Roman Zippel <zippel@linux-m68k.org> + + PR target/25343 + * config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __mc68000__. + +2008-07-17 Paolo Bonzini <bonzini@gnu.org> + + PR rtl-optimization/36753 + * fwprop.c (use_killed_between): Don't shortcut + single-definition global registers. + +2008-07-16 Jan Hubicka <jh@suse.cz> + + * cgraph.h (varpool_empty_needed_queue): Declare. + * cgraphunit.c (output_in_order): Mark all variables as needed; + empty the queue. + * varpool.c (varpool_assemble_node): Update debug queue. + (varpool_assemble_pending_decls): Don't do it here. + (varpool_empty_needed_queue): New function. + +2008-07-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * recog.c (peephole2_optimize): Fix formatting. + +2008-07-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * c-pch.c (get_ident): Avoid C++ keywords. + * combine-stack-adj.c (single_set_for_csa): Likewise. + * final.c (asm_insn_count, final_scan_insn, alter_subreg, + output_asm_insn): Likewise. + * reload.c (push_secondary_reload, find_reusable_reload, + push_reload, combine_reloads, find_reloads, + debug_reload_to_stream): Likewise. + * reload.h (struct reload): Likewise. + * reload1.c (reload_reg_class_lower, find_reg, find_reload_regs, + allocate_reload_reg, choose_reload_regs, emit_input_reload_insns, + emit_output_reload_insns): Likewise. + * targhooks.c (default_secondary_reload): Likewise. + * varasm.c (section_entry_eq, object_block_entry_eq): Likewise. + +2008-07-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * recog.c (validate_change_1, validate_change, + validate_unshare_change, validate_replace_rtx_1, struct + funny_match, constrain_operands, peephole2_optimize): Avoid C++ + keywords. + * reload.c (push_secondary_reload, secondary_reload_class, + scratch_reload_class, find_valid_class, find_reusable_reload, + push_reload, find_dummy_reload, find_reloads_address_1, + find_reloads_address_part, find_equiv_reg): Likewise. + * reload1.c (spill_failure, eliminate_regs_1, allocate_reload_reg, + choose_reload_regs): Likewise. + * rtlanal.c (replace_rtx, nonzero_bits1, num_sign_bit_copies1): + Likewise. + * rtlhooks.c (gen_lowpart_if_possible): Likewise. + * sched-ebb.c (add_deps_for_risky_insns): Likewise. + * sched-rgn.c (concat_INSN_LIST): Likewise. + * stor-layout.c (mode_for_size, mode_for_size_tree, + smallest_mode_for_size): Likewise. + +2008-07-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * cfg.c (dump_reg_info): Avoid C++ keywords. + * dwarf2asm.c (dw2_force_const_mem, + dw2_asm_output_encoded_addr_rtx): Likewise. + * except.c (gen_eh_region, add_action_record, output_ttype): + Likewise. + * expmed.c (expand_shift): Likewise. + * global.c (find_reg): Likewise. + * graph.c (draw_edge): Likewise. + * local-alloc.c (reg_meets_class_p, find_free_reg): Likewise. + * optabs.c (expand_binop, expand_twoval_unop, expand_twoval_binop, + widen_clz, widen_bswap, expand_parity, expand_unop, + emit_cmp_and_jump_insn_1): Likewise. + * postreload.c (reload_cse_simplify_operands): Likewise. + * ra.h (add_neighbor): Likewise. + * reg-stack.c (remove_regno_note, change_stack): Likewise. + * regclass.c (memory_move_secondary_cost, dump_regclass, regclass, + record_reg_classes, copy_cost, record_address_regs, + invalid_mode_change_p): Likewise. + * regrename.c (regrename_optimize, scan_rtx_reg, + dump_def_use_chain, find_oldest_value_reg, + replace_oldest_value_reg, copyprop_hardreg_forward_1): Likewise. + +2008-07-16 David Edelsohn <edelsohn@gnu.org> + + * config/rs6000/rs6000.c (processor_target_table): Remove duplicate + MASK_POWERPC64 for power4 in previous commit. + +2008-07-16 Olivier Hainque <hainque@adacore.com> + + * collect2.c (scan_prog_file, COFF version): Use CONST_CAST + instead of bare conversion to cast const-ness away. + +2008-07-16 Anatoly Sokolov <aesok@post.ru> + + * config/xtensa/xtensa.h (FUNCTION_OUTGOING_VALUE, + XTENSA_FUNCTION_VALUE, XTENSA_FUNCTION_VALUE): Remove. + * config/xtensa/xtensa.c (xtensa_function_value): New function. + (TARGET_FUNCTION_VALUE): Define. + +2008-07-16 David Edelsohn <edelsohn@gnu.org> + + * config/rs6000/rs6000.c (processor_target_table): Add + MASK_PPC_GPOPT for power4, power5, power5+, power6, and power6x. + +2008-07-16 Joseph Myers <joseph@codesourcery.com> + + PR target/36827 + * config/m32c/m32c.c (BIG_FB_ADJ): Move definition earlier. + (m32c_legitimate_address_p): Handle "++rii" addresses created by + m32c_legitimize_reload_address. + +2007-07-16 Rafael Avila de Espindola <espindola@google.com> + + * c-decl.c (merge_decls): Keep DECL_SOURCE_LOCATION and + DECL_IN_SYSTEM_HEADER in sync. + +2008-07-15 Daniel Berlin <dberlin@dberlin.org> + + * tree-ssa-sccvn.c (expressions_equal_p): Check type equality. + * tree-ssa-pre.c (pre_expr_eq): Ditto + (get_constant_for_value_id): Take a type as an argument. + (fully_constant_expression): Pass in type. + (find_or_generate_expression): Short circuit constant case. + (create_expression_by_pieces): Remove special casing of + pointer_plus. + (do_regular_insertion): Short circuit constant case. + (do_partial_partial_insertion): Ditto. + +2008-07-15 Kaz Kojima <kkojima@gcc.gnu.org> + + PR target/36782 + * config/sh/sh.md (symGOT_load): Don't add REG_EQUAL note. + +2008-07-15 Bob Wilson <bob.wilson@acm.org> + + * config/xtensa/libgcc-xtensa.ver: New file. + * config/xtensa/t-linux (SHLIB_MAPFILES): Append libgcc-xtensa.ver. + +2008-07-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * df-problems.c (df_set_note): Avoid C++ keywords. + * df-scan.c (df_ref_change_reg_with_loc_1): Likewise. + * dse.c (record_store, remove_useless_values): Likewise. + * emit-rtl.c (gen_reg_rtx, update_reg_offset, gen_rtx_REG_offset, + gen_reg_rtx_offset, operand_subword, change_address_1, + change_address, adjust_address_1, offset_address, + widen_memory_access, emit_copy_of_insn_after): Likewise. + * explow.c (round_push, allocate_dynamic_stack_space): Likewise. + * fwprop.c (should_replace_address, propagate_rtx_1, + propagate_rtx, try_fwprop_subst, forward_propagate_and_simplify): + Likewise. + * gcse.c (cprop_jump, find_implicit_sets, bypass_block, + gcse_emit_move_after, update_ld_motion_stores): Likewise. + * lcm.c (compute_insert_delete, pre_edge_lcm, + compute_rev_insert_delete, pre_edge_rev_lcm): Likewise. + * lower-subreg.c (resolve_reg_notes): Likewise. + * mode-switching.c (optimize_mode_switching): Likewise. + +2008-07-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * bt-load.c (add_btr_def, migrate_btr_def, + branch_target_load_optimize): Avoid C++ keywords. + * caller-save.c (insert_restore, insert_save, insert_one_insn): + Likewise. + * combine.c (subst, simplify_set, make_extraction, + make_compound_operation, known_cond, simplify_shift_const_1): + Likewise. + * cse.c (make_regs_eqv, merge_equiv_classes, validate_canon_reg, + fold_rtx, equiv_constant, cse_insn, cse_process_notes_1): + Likewise. + +2008-07-15 Richard Guenther <rguenther@suse.de> + + PR middle-end/36369 + * c-common.c (strict_aliasing_warning): Do not warn for + TYPE_REF_CAN_ALIAS_ALL pointers. + (c_common_get_alias_set): may_alias types are not special. + * tree.c (build_pointer_type_for_mode): Look up the may_alias + attribute and set can_ref_all accordingly. + (build_reference_type_for_mode): Likewise. + * doc/extend.texi (may_alias): Clarify. + +2008-07-15 Kaz Kojima <kkojima@gcc.gnu.org> + + PR target/36780 + * config/sh/sh.h (GO_IF_LEGITIMATE_ADDRESS): Allow + (plus (plus (reg) (const_int)) (const_int)) when reload_in_progress. + +2008-07-15 Andrew Pinski <andrew_pinski@playstation.sony.com> + + PR target/31568 + * config/rs6000/rs6000.c (print_operand <case 'y'>): Don't use + gcc_assert, instead call output_operand_lossage. + +2008-07-15 Kai Tietz <kai.tietz@onevision.com> + + * builtins.c (std_canonical_va_list): Treat structure based + va_list types. + 2008-07-15 Ben Elliston <bje@au.ibm.com> * emit-rtl.c (set_mem_attributes_minus_bitpos): Improve comment. diff --git a/gcc/ChangeLog.melt b/gcc/ChangeLog.melt index 9a64f0a8f7c..ee967f352d2 100644 --- a/gcc/ChangeLog.melt +++ b/gcc/ChangeLog.melt @@ -1,4 +1,7 @@ 2008-07-17 Basile Starynkevitch <basile@starynkevitch.net> + MELT branch merged with trunk r137918 + +2008-07-17 Basile Starynkevitch <basile@starynkevitch.net> * melt/warmelt-normal.bysl: still adding normexp_citeration. 2008-07-15 Basile Starynkevitch <basile@starynkevitch.net> diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 153ee5ea3fa..bf4dc5b288f 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20080715 +20080717 diff --git a/gcc/bt-load.c b/gcc/bt-load.c index b0a7fdb4a21..2d4b3e0ad3e 100644 --- a/gcc/bt-load.c +++ b/gcc/bt-load.c @@ -301,31 +301,30 @@ add_btr_def (fibheap_t all_btr_defs, basic_block bb, int insn_luid, rtx insn, unsigned int dest_reg, int other_btr_uses_before_def, btr_def_group *all_btr_def_groups) { - btr_def this - = XOBNEW (&migrate_btrl_obstack, struct btr_def_s); - this->bb = bb; - this->luid = insn_luid; - this->insn = insn; - this->btr = dest_reg; - this->cost = basic_block_freq (bb); - this->has_ambiguous_use = 0; - this->other_btr_uses_before_def = other_btr_uses_before_def; - this->other_btr_uses_after_use = 0; - this->next_this_bb = NULL; - this->next_this_group = NULL; - this->uses = NULL; - this->live_range = NULL; - find_btr_def_group (all_btr_def_groups, this); - - fibheap_insert (all_btr_defs, -this->cost, this); + btr_def this_def = XOBNEW (&migrate_btrl_obstack, struct btr_def_s); + this_def->bb = bb; + this_def->luid = insn_luid; + this_def->insn = insn; + this_def->btr = dest_reg; + this_def->cost = basic_block_freq (bb); + this_def->has_ambiguous_use = 0; + this_def->other_btr_uses_before_def = other_btr_uses_before_def; + this_def->other_btr_uses_after_use = 0; + this_def->next_this_bb = NULL; + this_def->next_this_group = NULL; + this_def->uses = NULL; + this_def->live_range = NULL; + find_btr_def_group (all_btr_def_groups, this_def); + + fibheap_insert (all_btr_defs, -this_def->cost, this_def); if (dump_file) fprintf (dump_file, "Found target reg definition: sets %u { bb %d, insn %d }%s priority %d\n", - dest_reg, bb->index, INSN_UID (insn), (this->group ? "" : ":not const"), - this->cost); + dest_reg, bb->index, INSN_UID (insn), + (this_def->group ? "" : ":not const"), this_def->cost); - return this; + return this_def; } /* Create a new target register user structure, for a use in block BB, @@ -1274,7 +1273,7 @@ migrate_btr_def (btr_def def, int min_cost) HARD_REG_SET btrs_live_in_range; int btr_used_near_def = 0; int def_basic_block_freq; - basic_block try; + basic_block attempt; int give_up = 0; int def_moved = 0; btr_user user; @@ -1328,31 +1327,31 @@ migrate_btr_def (btr_def def, int min_cost) def_basic_block_freq = basic_block_freq (def->bb); - for (try = get_immediate_dominator (CDI_DOMINATORS, def->bb); - !give_up && try && try != ENTRY_BLOCK_PTR && def->cost >= min_cost; - try = get_immediate_dominator (CDI_DOMINATORS, try)) + for (attempt = get_immediate_dominator (CDI_DOMINATORS, def->bb); + !give_up && attempt && attempt != ENTRY_BLOCK_PTR && def->cost >= min_cost; + attempt = get_immediate_dominator (CDI_DOMINATORS, attempt)) { /* Try to move the instruction that sets the target register into - basic block TRY. */ - int try_freq = basic_block_freq (try); + basic block ATTEMPT. */ + int try_freq = basic_block_freq (attempt); edge_iterator ei; edge e; - /* If TRY has abnormal edges, skip it. */ - FOR_EACH_EDGE (e, ei, try->succs) + /* If ATTEMPT has abnormal edges, skip it. */ + FOR_EACH_EDGE (e, ei, attempt->succs) if (e->flags & EDGE_COMPLEX) break; if (e) continue; if (dump_file) - fprintf (dump_file, "trying block %d ...", try->index); + fprintf (dump_file, "trying block %d ...", attempt->index); if (try_freq < def_basic_block_freq || (try_freq == def_basic_block_freq && btr_used_near_def)) { int btr; - augment_live_range (live_range, &btrs_live_in_range, def->bb, try, + augment_live_range (live_range, &btrs_live_in_range, def->bb, attempt, flag_btr_bb_exclusive); if (dump_file) { @@ -1363,7 +1362,7 @@ migrate_btr_def (btr_def def, int min_cost) btr = choose_btr (btrs_live_in_range); if (btr != -1) { - move_btr_def (try, btr, def, live_range, &btrs_live_in_range); + move_btr_def (attempt, btr, def, live_range, &btrs_live_in_range); bitmap_copy(live_range, def->live_range); btr_used_near_def = 0; def_moved = 1; @@ -1459,8 +1458,8 @@ migrate_btr_defs (enum reg_class btr_class, int allow_callee_save) static void branch_target_load_optimize (bool after_prologue_epilogue_gen) { - enum reg_class class = targetm.branch_target_register_class (); - if (class != NO_REGS) + enum reg_class klass = targetm.branch_target_register_class (); + if (klass != NO_REGS) { /* Initialize issue_rate. */ if (targetm.sched.issue_rate) @@ -1482,7 +1481,7 @@ branch_target_load_optimize (bool after_prologue_epilogue_gen) /* Dominator info is also needed for migrate_btr_def. */ calculate_dominance_info (CDI_DOMINATORS); - migrate_btr_defs (class, + migrate_btr_defs (klass, (targetm.branch_target_register_callee_saved (after_prologue_epilogue_gen))); diff --git a/gcc/builtins.c b/gcc/builtins.c index 2d6ad2a1a34..60caa8126d8 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -4691,10 +4691,12 @@ std_canonical_va_list_type (tree type) type = TREE_TYPE (type); else if (POINTER_TYPE_P (type) && POINTER_TYPE_P (TREE_TYPE(type))) type = TREE_TYPE (type); - wtype = va_list_type_node; htype = type; - if (TREE_CODE (wtype) == ARRAY_TYPE) + /* Treat structure va_list types. */ + if (TREE_CODE (wtype) == RECORD_TYPE && POINTER_TYPE_P (htype)) + htype = TREE_TYPE (htype); + else if (TREE_CODE (wtype) == ARRAY_TYPE) { /* If va_list is an array type, the argument may have decayed to a pointer type, e.g. by being passed to another function. diff --git a/gcc/c-common.c b/gcc/c-common.c index f54b1cb0942..71a83b030f5 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -1252,8 +1252,13 @@ warn_logical_operator (enum tree_code code, tree arg1, tree bool strict_aliasing_warning (tree otype, tree type, tree expr) { - if (!(flag_strict_aliasing && POINTER_TYPE_P (type) - && POINTER_TYPE_P (otype) && !VOID_TYPE_P (TREE_TYPE (type)))) + if (!(flag_strict_aliasing + && POINTER_TYPE_P (type) + && POINTER_TYPE_P (otype) + && !VOID_TYPE_P (TREE_TYPE (type))) + /* If the type we are casting to is a ref-all pointer + dereferencing it is always valid. */ + || TYPE_REF_CAN_ALIAS_ALL (type)) return false; if ((warn_strict_aliasing > 1) && TREE_CODE (expr) == ADDR_EXPR @@ -3474,10 +3479,6 @@ c_common_get_alias_set (tree t) || t == unsigned_char_type_node) return 0; - /* If it has the may_alias attribute, it can alias anything. */ - if (lookup_attribute ("may_alias", TYPE_ATTRIBUTES (t))) - return 0; - /* The C standard specifically allows aliasing between signed and unsigned variants of the same type. We treat the signed variant as canonical. */ diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 89430cbf3e1..4815797e564 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1679,12 +1679,27 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) if (TREE_DEPRECATED (newdecl)) TREE_DEPRECATED (olddecl) = 1; - /* Keep source location of definition rather than declaration and of - prototype rather than non-prototype unless that prototype is - built-in. */ - if ((DECL_INITIAL (newdecl) == 0 && DECL_INITIAL (olddecl) != 0) - || (old_is_prototype && !new_is_prototype - && !C_DECL_BUILTIN_PROTOTYPE (olddecl))) + /* If a decl is in a system header and the other isn't, keep the one on the + system header. Otherwise, keep source location of definition rather than + declaration and of prototype rather than non-prototype unless that + prototype is built-in. */ + if (CODE_CONTAINS_STRUCT (TREE_CODE (olddecl), TS_DECL_WITH_VIS) + && DECL_IN_SYSTEM_HEADER (olddecl) + && !DECL_IN_SYSTEM_HEADER (newdecl) ) + { + DECL_IN_SYSTEM_HEADER (newdecl) = 1; + DECL_SOURCE_LOCATION (newdecl) = DECL_SOURCE_LOCATION (olddecl); + } + else if (CODE_CONTAINS_STRUCT (TREE_CODE (olddecl), TS_DECL_WITH_VIS) + && DECL_IN_SYSTEM_HEADER (newdecl) + && !DECL_IN_SYSTEM_HEADER (olddecl)) + { + DECL_IN_SYSTEM_HEADER (olddecl) = 1; + DECL_SOURCE_LOCATION (olddecl) = DECL_SOURCE_LOCATION (newdecl); + } + else if ((DECL_INITIAL (newdecl) == 0 && DECL_INITIAL (olddecl) != 0) + || (old_is_prototype && !new_is_prototype + && !C_DECL_BUILTIN_PROTOTYPE (olddecl))) DECL_SOURCE_LOCATION (newdecl) = DECL_SOURCE_LOCATION (olddecl); /* Merge the initialization information. */ @@ -1700,12 +1715,6 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) if (CODE_CONTAINS_STRUCT (TREE_CODE (olddecl), TS_DECL_WITH_VIS)) { - /* Merge the unused-warning information. */ - if (DECL_IN_SYSTEM_HEADER (olddecl)) - DECL_IN_SYSTEM_HEADER (newdecl) = 1; - else if (DECL_IN_SYSTEM_HEADER (newdecl)) - DECL_IN_SYSTEM_HEADER (olddecl) = 1; - /* Merge the section attribute. We want to issue an error if the sections conflict but that must be done later in decl_attributes since we are called diff --git a/gcc/c-pch.c b/gcc/c-pch.c index 0da17f7f24b..8273914f144 100644 --- a/gcc/c-pch.c +++ b/gcc/c-pch.c @@ -93,10 +93,10 @@ static const char * get_ident (void) { static char result[IDENT_LENGTH]; - static const char template[IDENT_LENGTH] = "gpch.013"; + static const char templ[IDENT_LENGTH] = "gpch.013"; static const char c_language_chars[] = "Co+O"; - memcpy (result, template, IDENT_LENGTH); + memcpy (result, templ, IDENT_LENGTH); result[4] = c_language_chars[c_language]; return result; diff --git a/gcc/caller-save.c b/gcc/caller-save.c index f8a3c387775..233caca74f2 100644 --- a/gcc/caller-save.c +++ b/gcc/caller-save.c @@ -660,7 +660,7 @@ insert_restore (struct insn_chain *chain, int before_p, int regno, rtx pat = NULL_RTX; int code; unsigned int numregs = 0; - struct insn_chain *new; + struct insn_chain *new_chain; rtx mem; /* A common failure mode if register status is not correct in the @@ -713,13 +713,13 @@ insert_restore (struct insn_chain *chain, int before_p, int regno, gen_rtx_REG (GET_MODE (mem), regno), mem); code = reg_restore_code (regno, GET_MODE (mem)); - new = insert_one_insn (chain, before_p, code, pat); + new_chain = insert_one_insn (chain, before_p, code, pat); /* Clear status for all registers we restored. */ for (k = 0; k < i; k++) { CLEAR_HARD_REG_BIT (hard_regs_saved, regno + k); - SET_REGNO_REG_SET (&new->dead_or_set, regno + k); + SET_REGNO_REG_SET (&new_chain->dead_or_set, regno + k); n_regs_saved--; } @@ -738,7 +738,7 @@ insert_save (struct insn_chain *chain, int before_p, int regno, rtx pat = NULL_RTX; int code; unsigned int numregs = 0; - struct insn_chain *new; + struct insn_chain *new_chain; rtx mem; /* A common failure mode if register status is not correct in the @@ -790,13 +790,13 @@ insert_save (struct insn_chain *chain, int before_p, int regno, gen_rtx_REG (GET_MODE (mem), regno)); code = reg_save_code (regno, GET_MODE (mem)); - new = insert_one_insn (chain, before_p, code, pat); + new_chain = insert_one_insn (chain, before_p, code, pat); /* Set hard_regs_saved and dead_or_set for all the registers we saved. */ for (k = 0; k < numregs; k++) { SET_HARD_REG_BIT (hard_regs_saved, regno + k); - SET_REGNO_REG_SET (&new->dead_or_set, regno + k); + SET_REGNO_REG_SET (&new_chain->dead_or_set, regno + k); n_regs_saved++; } @@ -809,7 +809,7 @@ static struct insn_chain * insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat) { rtx insn = chain->insn; - struct insn_chain *new; + struct insn_chain *new_chain; #ifdef HAVE_cc0 /* If INSN references CC0, put our insns in front of the insn that sets @@ -824,23 +824,23 @@ insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat) chain = chain->prev, insn = chain->insn; #endif - new = new_insn_chain (); + new_chain = new_insn_chain (); if (before_p) { rtx link; - new->prev = chain->prev; - if (new->prev != 0) - new->prev->next = new; + new_chain->prev = chain->prev; + if (new_chain->prev != 0) + new_chain->prev->next = new_chain; else - reload_insn_chain = new; + reload_insn_chain = new_chain; - chain->prev = new; - new->next = chain; - new->insn = emit_insn_before (pat, insn); + chain->prev = new_chain; + new_chain->next = chain; + new_chain->insn = emit_insn_before (pat, insn); /* ??? It would be nice if we could exclude the already / still saved registers from the live sets. */ - COPY_REG_SET (&new->live_throughout, &chain->live_throughout); + COPY_REG_SET (&new_chain->live_throughout, &chain->live_throughout); /* Registers that die in CHAIN->INSN still live in the new insn. */ for (link = REG_NOTES (chain->insn); link; link = XEXP (link, 1)) { @@ -857,7 +857,7 @@ insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat) continue; for (i = hard_regno_nregs[regno][GET_MODE (reg)] - 1; i >= 0; i--) - SET_REGNO_REG_SET (&new->live_throughout, regno + i); + SET_REGNO_REG_SET (&new_chain->live_throughout, regno + i); } } @@ -885,41 +885,41 @@ insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat) for (i = hard_regno_nregs[regno][GET_MODE (reg)] - 1; i >= 0; i--) - SET_REGNO_REG_SET (&new->live_throughout, regno + i); + SET_REGNO_REG_SET (&new_chain->live_throughout, regno + i); } } } } - CLEAR_REG_SET (&new->dead_or_set); + CLEAR_REG_SET (&new_chain->dead_or_set); if (chain->insn == BB_HEAD (BASIC_BLOCK (chain->block))) - BB_HEAD (BASIC_BLOCK (chain->block)) = new->insn; + BB_HEAD (BASIC_BLOCK (chain->block)) = new_chain->insn; } else { - new->next = chain->next; - if (new->next != 0) - new->next->prev = new; - chain->next = new; - new->prev = chain; - new->insn = emit_insn_after (pat, insn); + new_chain->next = chain->next; + if (new_chain->next != 0) + new_chain->next->prev = new_chain; + chain->next = new_chain; + new_chain->prev = chain; + new_chain->insn = emit_insn_after (pat, insn); /* ??? It would be nice if we could exclude the already / still saved registers from the live sets, and observe REG_UNUSED notes. */ - COPY_REG_SET (&new->live_throughout, &chain->live_throughout); + COPY_REG_SET (&new_chain->live_throughout, &chain->live_throughout); /* Registers that are set in CHAIN->INSN live in the new insn. (Unless there is a REG_UNUSED note for them, but we don't look for them here.) */ note_stores (PATTERN (chain->insn), add_stored_regs, - &new->live_throughout); - CLEAR_REG_SET (&new->dead_or_set); + &new_chain->live_throughout); + CLEAR_REG_SET (&new_chain->dead_or_set); if (chain->insn == BB_END (BASIC_BLOCK (chain->block))) - BB_END (BASIC_BLOCK (chain->block)) = new->insn; + BB_END (BASIC_BLOCK (chain->block)) = new_chain->insn; } - new->block = chain->block; - new->is_caller_save_insn = 1; + new_chain->block = chain->block; + new_chain->is_caller_save_insn = 1; - INSN_CODE (new->insn) = code; - return new; + INSN_CODE (new_chain->insn) = code; + return new_chain; } #include "gt-caller-save.h" diff --git a/gcc/cfg.c b/gcc/cfg.c index e8bf789480b..1f681124105 100644 --- a/gcc/cfg.c +++ b/gcc/cfg.c @@ -597,7 +597,7 @@ dump_reg_info (FILE *file) fprintf (file, "%d registers.\n", max); for (i = FIRST_PSEUDO_REGISTER; i < max; i++) { - enum reg_class class, altclass; + enum reg_class rclass, altclass; if (regstat_n_sets_and_refs) fprintf (file, "\nRegister %d used %d times across %d insns", @@ -628,17 +628,17 @@ dump_reg_info (FILE *file) && PSEUDO_REGNO_BYTES (i) != UNITS_PER_WORD) fprintf (file, "; %d bytes", PSEUDO_REGNO_BYTES (i)); - class = reg_preferred_class (i); + rclass = reg_preferred_class (i); altclass = reg_alternate_class (i); - if (class != GENERAL_REGS || altclass != ALL_REGS) + if (rclass != GENERAL_REGS || altclass != ALL_REGS) { - if (altclass == ALL_REGS || class == ALL_REGS) - fprintf (file, "; pref %s", reg_class_names[(int) class]); + if (altclass == ALL_REGS || rclass == ALL_REGS) + fprintf (file, "; pref %s", reg_class_names[(int) rclass]); else if (altclass == NO_REGS) - fprintf (file, "; %s or none", reg_class_names[(int) class]); + fprintf (file, "; %s or none", reg_class_names[(int) rclass]); else fprintf (file, "; pref %s, else %s", - reg_class_names[(int) class], + reg_class_names[(int) rclass], reg_class_names[(int) altclass]); } diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 070bd77dcdc..b817f87f7f0 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -401,6 +401,7 @@ bool varpool_assemble_decl (struct varpool_node *node); bool varpool_analyze_pending_decls (void); void varpool_output_debug_info (void); void varpool_remove_unreferenced_decls (void); +void varpool_empty_needed_queue (void); /* Walk all reachable static variables. */ #define FOR_EACH_STATIC_VARIABLE(node) \ diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 2dcccc1bd93..5994ad12a03 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1291,6 +1291,16 @@ cgraph_output_in_order (void) nodes[i].u.a = pa; } + /* In toplevel reorder mode we output all statics; mark them as needed. */ + for (i = 0; i < max; ++i) + { + if (nodes[i].kind == ORDER_VAR) + { + varpool_mark_needed_node (nodes[i].u.v); + } + } + varpool_empty_needed_queue (); + for (i = 0; i < max; ++i) { switch (nodes[i].kind) diff --git a/gcc/collect2.c b/gcc/collect2.c index 314d30d7717..713c8f2d562 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -2476,8 +2476,8 @@ scan_prog_file (const char *prog_name, enum pass which_pass) /* Some platforms (e.g. OSF4) declare ldopen as taking a non-const char * filename parameter, even though it will not modify that string. So we must cast away const-ness here, - which will cause -Wcast-qual to burp. */ - if ((ldptr = ldopen ((char *)prog_name, ldptr)) != NULL) + using CONST_CAST to prevent complaints from -Wcast-qual. */ + if ((ldptr = ldopen (CONST_CAST (char *, prog_name), ldptr)) != NULL) { if (! MY_ISCOFF (HEADER (ldptr).f_magic)) fatal ("%s: not a COFF file", prog_name); diff --git a/gcc/combine-stack-adj.c b/gcc/combine-stack-adj.c index afcb35b33ea..c678a607c66 100644 --- a/gcc/combine-stack-adj.c +++ b/gcc/combine-stack-adj.c @@ -143,14 +143,14 @@ single_set_for_csa (rtx insn) for (i = 1; i < XVECLEN (tmp, 0); ++i) { - rtx this = XVECEXP (tmp, 0, i); + rtx this_rtx = XVECEXP (tmp, 0, i); /* The special case is allowing a no-op set. */ - if (GET_CODE (this) == SET - && SET_SRC (this) == SET_DEST (this)) + if (GET_CODE (this_rtx) == SET + && SET_SRC (this_rtx) == SET_DEST (this_rtx)) ; - else if (GET_CODE (this) != CLOBBER - && GET_CODE (this) != USE) + else if (GET_CODE (this_rtx) != CLOBBER + && GET_CODE (this_rtx) != USE) return NULL_RTX; } diff --git a/gcc/combine.c b/gcc/combine.c index a6cff36480f..706ee0689f3 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -4278,7 +4278,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) enum machine_mode op0_mode = VOIDmode; const char *fmt; int len, i; - rtx new; + rtx new_rtx; /* Two expressions are equal if they are identical copies of a shared RTX or if they are both registers with the same register number @@ -4333,14 +4333,14 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) && GET_CODE (XVECEXP (x, 0, 0)) == SET && GET_CODE (SET_SRC (XVECEXP (x, 0, 0))) == ASM_OPERANDS) { - new = subst (XVECEXP (x, 0, 0), from, to, 0, unique_copy); + new_rtx = subst (XVECEXP (x, 0, 0), from, to, 0, unique_copy); /* If this substitution failed, this whole thing fails. */ - if (GET_CODE (new) == CLOBBER - && XEXP (new, 0) == const0_rtx) - return new; + if (GET_CODE (new_rtx) == CLOBBER + && XEXP (new_rtx, 0) == const0_rtx) + return new_rtx; - SUBST (XVECEXP (x, 0, 0), new); + SUBST (XVECEXP (x, 0, 0), new_rtx); for (i = XVECLEN (x, 0) - 1; i >= 1; i--) { @@ -4350,14 +4350,14 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) && GET_CODE (dest) != CC0 && GET_CODE (dest) != PC) { - new = subst (dest, from, to, 0, unique_copy); + new_rtx = subst (dest, from, to, 0, unique_copy); /* If this substitution failed, this whole thing fails. */ - if (GET_CODE (new) == CLOBBER - && XEXP (new, 0) == const0_rtx) - return new; + if (GET_CODE (new_rtx) == CLOBBER + && XEXP (new_rtx, 0) == const0_rtx) + return new_rtx; - SUBST (SET_DEST (XVECEXP (x, 0, i)), new); + SUBST (SET_DEST (XVECEXP (x, 0, i)), new_rtx); } } } @@ -4390,33 +4390,33 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) { if (COMBINE_RTX_EQUAL_P (XVECEXP (x, i, j), from)) { - new = (unique_copy && n_occurrences + new_rtx = (unique_copy && n_occurrences ? copy_rtx (to) : to); n_occurrences++; } else { - new = subst (XVECEXP (x, i, j), from, to, 0, + new_rtx = subst (XVECEXP (x, i, j), from, to, 0, unique_copy); /* If this substitution failed, this whole thing fails. */ - if (GET_CODE (new) == CLOBBER - && XEXP (new, 0) == const0_rtx) - return new; + if (GET_CODE (new_rtx) == CLOBBER + && XEXP (new_rtx, 0) == const0_rtx) + return new_rtx; } - SUBST (XVECEXP (x, i, j), new); + SUBST (XVECEXP (x, i, j), new_rtx); } } else if (fmt[i] == 'e') { /* If this is a register being set, ignore it. */ - new = XEXP (x, i); + new_rtx = XEXP (x, i); if (in_dest && i == 0 && (((code == SUBREG || code == ZERO_EXTRACT) - && REG_P (new)) + && REG_P (new_rtx)) || code == STRICT_LOW_PART)) ; @@ -4457,7 +4457,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) return gen_rtx_CLOBBER (VOIDmode, const0_rtx); #endif - new = (unique_copy && n_occurrences ? copy_rtx (to) : to); + new_rtx = (unique_copy && n_occurrences ? copy_rtx (to) : to); n_occurrences++; } else @@ -4469,7 +4469,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) STRICT_LOW_PART, and ZERO_EXTRACT, which are the only things aside from REG and MEM that should appear in a SET_DEST. */ - new = subst (XEXP (x, i), from, to, + new_rtx = subst (XEXP (x, i), from, to, (((in_dest && (code == SUBREG || code == STRICT_LOW_PART || code == ZERO_EXTRACT)) @@ -4482,30 +4482,30 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) well as prevent accidents where two CLOBBERs are considered to be equal, thus producing an incorrect simplification. */ - if (GET_CODE (new) == CLOBBER && XEXP (new, 0) == const0_rtx) - return new; + if (GET_CODE (new_rtx) == CLOBBER && XEXP (new_rtx, 0) == const0_rtx) + return new_rtx; if (GET_CODE (x) == SUBREG - && (GET_CODE (new) == CONST_INT - || GET_CODE (new) == CONST_DOUBLE)) + && (GET_CODE (new_rtx) == CONST_INT + || GET_CODE (new_rtx) == CONST_DOUBLE)) { enum machine_mode mode = GET_MODE (x); - x = simplify_subreg (GET_MODE (x), new, + x = simplify_subreg (GET_MODE (x), new_rtx, GET_MODE (SUBREG_REG (x)), SUBREG_BYTE (x)); if (! x) x = gen_rtx_CLOBBER (mode, const0_rtx); } - else if (GET_CODE (new) == CONST_INT + else if (GET_CODE (new_rtx) == CONST_INT && GET_CODE (x) == ZERO_EXTEND) { x = simplify_unary_operation (ZERO_EXTEND, GET_MODE (x), - new, GET_MODE (XEXP (x, 0))); + new_rtx, GET_MODE (XEXP (x, 0))); gcc_assert (x); } else - SUBST (XEXP (x, i), new); + SUBST (XEXP (x, i), new_rtx); } } } @@ -5638,9 +5638,9 @@ simplify_set (rtx x) /* Attempt to simplify CC user. */ if (GET_CODE (pat) == SET) { - rtx new = simplify_rtx (SET_SRC (pat)); - if (new != NULL_RTX) - SUBST (SET_SRC (pat), new); + rtx new_rtx = simplify_rtx (SET_SRC (pat)); + if (new_rtx != NULL_RTX) + SUBST (SET_SRC (pat), new_rtx); } /* Convert X into a no-op move. */ @@ -6373,7 +6373,7 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, enum machine_mode pos_mode = word_mode; enum machine_mode extraction_mode = word_mode; enum machine_mode tmode = mode_for_size (len, MODE_INT, 1); - rtx new = 0; + rtx new_rtx = 0; rtx orig_pos_rtx = pos_rtx; HOST_WIDE_INT orig_pos; @@ -6397,11 +6397,11 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, (ashift X (const_int C)), where LEN > C. Extract the least significant (LEN - C) bits of X, giving an rtx whose mode is MODE, then shift it left C times. */ - new = make_extraction (mode, XEXP (inner, 0), + new_rtx = make_extraction (mode, XEXP (inner, 0), 0, 0, len - INTVAL (XEXP (inner, 1)), unsignedp, in_dest, in_compare); - if (new != 0) - return gen_rtx_ASHIFT (mode, new, XEXP (inner, 1)); + if (new_rtx != 0) + return gen_rtx_ASHIFT (mode, new_rtx, XEXP (inner, 1)); } inner_mode = GET_MODE (inner); @@ -6457,7 +6457,7 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, else offset = pos / BITS_PER_UNIT; - new = adjust_address_nv (inner, tmode, offset); + new_rtx = adjust_address_nv (inner, tmode, offset); } else if (REG_P (inner)) { @@ -6487,16 +6487,16 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, if (!validate_subreg (tmode, inner_mode, inner, final_word)) return NULL_RTX; - new = gen_rtx_SUBREG (tmode, inner, final_word); + new_rtx = gen_rtx_SUBREG (tmode, inner, final_word); } else - new = gen_lowpart (tmode, inner); + new_rtx = gen_lowpart (tmode, inner); } else - new = inner; + new_rtx = inner; } else - new = force_to_mode (inner, tmode, + new_rtx = force_to_mode (inner, tmode, len >= HOST_BITS_PER_WIDE_INT ? ~(unsigned HOST_WIDE_INT) 0 : ((unsigned HOST_WIDE_INT) 1 << len) - 1, @@ -6506,30 +6506,30 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, make a STRICT_LOW_PART unless we made a MEM. */ if (in_dest) - return (MEM_P (new) ? new - : (GET_CODE (new) != SUBREG + return (MEM_P (new_rtx) ? new_rtx + : (GET_CODE (new_rtx) != SUBREG ? gen_rtx_CLOBBER (tmode, const0_rtx) - : gen_rtx_STRICT_LOW_PART (VOIDmode, new))); + : gen_rtx_STRICT_LOW_PART (VOIDmode, new_rtx))); if (mode == tmode) - return new; + return new_rtx; - if (GET_CODE (new) == CONST_INT) - return gen_int_mode (INTVAL (new), mode); + if (GET_CODE (new_rtx) == CONST_INT) + return gen_int_mode (INTVAL (new_rtx), mode); /* If we know that no extraneous bits are set, and that the high bit is not set, convert the extraction to the cheaper of sign and zero extension, that are equivalent in these cases. */ if (flag_expensive_optimizations && (GET_MODE_BITSIZE (tmode) <= HOST_BITS_PER_WIDE_INT - && ((nonzero_bits (new, tmode) + && ((nonzero_bits (new_rtx, tmode) & ~(((unsigned HOST_WIDE_INT) GET_MODE_MASK (tmode)) >> 1)) == 0))) { - rtx temp = gen_rtx_ZERO_EXTEND (mode, new); - rtx temp1 = gen_rtx_SIGN_EXTEND (mode, new); + rtx temp = gen_rtx_ZERO_EXTEND (mode, new_rtx); + rtx temp1 = gen_rtx_SIGN_EXTEND (mode, new_rtx); /* Prefer ZERO_EXTENSION, since it gives more information to backends. */ @@ -6542,7 +6542,7 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, proper mode. */ return (gen_rtx_fmt_e (unsignedp ? ZERO_EXTEND : SIGN_EXTEND, - mode, new)); + mode, new_rtx)); } /* Unless this is a COMPARE or we have a funny memory reference, @@ -6746,12 +6746,12 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, pos_rtx = GEN_INT (pos); /* Make the required operation. See if we can use existing rtx. */ - new = gen_rtx_fmt_eee (unsignedp ? ZERO_EXTRACT : SIGN_EXTRACT, + new_rtx = gen_rtx_fmt_eee (unsignedp ? ZERO_EXTRACT : SIGN_EXTRACT, extraction_mode, inner, GEN_INT (len), pos_rtx); if (! in_dest) - new = gen_lowpart (mode, new); + new_rtx = gen_lowpart (mode, new_rtx); - return new; + return new_rtx; } /* See if X contains an ASHIFT of COUNT or more bits that can be commuted @@ -6827,7 +6827,7 @@ make_compound_operation (rtx x, enum rtx_code in_code) rtx rhs, lhs; enum rtx_code next_code; int i; - rtx new = 0; + rtx new_rtx = 0; rtx tem; const char *fmt; @@ -6852,8 +6852,8 @@ make_compound_operation (rtx x, enum rtx_code in_code) && INTVAL (XEXP (x, 1)) < HOST_BITS_PER_WIDE_INT && INTVAL (XEXP (x, 1)) >= 0) { - new = make_compound_operation (XEXP (x, 0), next_code); - new = gen_rtx_MULT (mode, new, + new_rtx = make_compound_operation (XEXP (x, 0), next_code); + new_rtx = gen_rtx_MULT (mode, new_rtx, GEN_INT ((HOST_WIDE_INT) 1 << INTVAL (XEXP (x, 1)))); } @@ -6870,8 +6870,8 @@ make_compound_operation (rtx x, enum rtx_code in_code) if (GET_CODE (XEXP (x, 0)) == LSHIFTRT && (i = exact_log2 (INTVAL (XEXP (x, 1)) + 1)) >= 0) { - new = make_compound_operation (XEXP (XEXP (x, 0), 0), next_code); - new = make_extraction (mode, new, 0, XEXP (XEXP (x, 0), 1), i, 1, + new_rtx = make_compound_operation (XEXP (XEXP (x, 0), 0), next_code); + new_rtx = make_extraction (mode, new_rtx, 0, XEXP (XEXP (x, 0), 1), i, 1, 0, in_code == COMPARE); } @@ -6881,9 +6881,9 @@ make_compound_operation (rtx x, enum rtx_code in_code) && GET_CODE (SUBREG_REG (XEXP (x, 0))) == LSHIFTRT && (i = exact_log2 (INTVAL (XEXP (x, 1)) + 1)) >= 0) { - new = make_compound_operation (XEXP (SUBREG_REG (XEXP (x, 0)), 0), + new_rtx = make_compound_operation (XEXP (SUBREG_REG (XEXP (x, 0)), 0), next_code); - new = make_extraction (GET_MODE (SUBREG_REG (XEXP (x, 0))), new, 0, + new_rtx = make_extraction (GET_MODE (SUBREG_REG (XEXP (x, 0))), new_rtx, 0, XEXP (SUBREG_REG (XEXP (x, 0)), 1), i, 1, 0, in_code == COMPARE); } @@ -6895,12 +6895,12 @@ make_compound_operation (rtx x, enum rtx_code in_code) && (i = exact_log2 (INTVAL (XEXP (x, 1)) + 1)) >= 0) { /* Apply the distributive law, and then try to make extractions. */ - new = gen_rtx_fmt_ee (GET_CODE (XEXP (x, 0)), mode, + new_rtx = gen_rtx_fmt_ee (GET_CODE (XEXP (x, 0)), mode, gen_rtx_AND (mode, XEXP (XEXP (x, 0), 0), XEXP (x, 1)), gen_rtx_AND (mode, XEXP (XEXP (x, 0), 1), XEXP (x, 1))); - new = make_compound_operation (new, in_code); + new_rtx = make_compound_operation (new_rtx, in_code); } /* If we are have (and (rotate X C) M) and C is larger than the number @@ -6911,8 +6911,8 @@ make_compound_operation (rtx x, enum rtx_code in_code) && (i = exact_log2 (INTVAL (XEXP (x, 1)) + 1)) >= 0 && i <= INTVAL (XEXP (XEXP (x, 0), 1))) { - new = make_compound_operation (XEXP (XEXP (x, 0), 0), next_code); - new = make_extraction (mode, new, + new_rtx = make_compound_operation (XEXP (XEXP (x, 0), 0), next_code); + new_rtx = make_extraction (mode, new_rtx, (GET_MODE_BITSIZE (mode) - INTVAL (XEXP (XEXP (x, 0), 1))), NULL_RTX, i, 1, 0, in_code == COMPARE); @@ -6945,7 +6945,7 @@ make_compound_operation (rtx x, enum rtx_code in_code) If it doesn't end up being a ZERO_EXTEND, we will ignore it unless we are in a COMPARE. */ else if ((i = exact_log2 (INTVAL (XEXP (x, 1)) + 1)) >= 0) - new = make_extraction (mode, + new_rtx = make_extraction (mode, make_compound_operation (XEXP (x, 0), next_code), 0, NULL_RTX, i, 1, 0, in_code == COMPARE); @@ -6954,7 +6954,7 @@ make_compound_operation (rtx x, enum rtx_code in_code) convert this into the appropriate bit extract. */ else if (in_code == COMPARE && (i = exact_log2 (INTVAL (XEXP (x, 1)))) >= 0) - new = make_extraction (mode, + new_rtx = make_extraction (mode, make_compound_operation (XEXP (x, 0), next_code), i, NULL_RTX, 1, 1, 0, 1); @@ -6969,7 +6969,7 @@ make_compound_operation (rtx x, enum rtx_code in_code) && mode_width <= HOST_BITS_PER_WIDE_INT && (nonzero_bits (XEXP (x, 0), mode) & (1 << (mode_width - 1))) == 0) { - new = gen_rtx_ASHIFTRT (mode, + new_rtx = gen_rtx_ASHIFTRT (mode, make_compound_operation (XEXP (x, 0), next_code), XEXP (x, 1)); @@ -6989,8 +6989,8 @@ make_compound_operation (rtx x, enum rtx_code in_code) && GET_CODE (XEXP (lhs, 1)) == CONST_INT && INTVAL (rhs) >= INTVAL (XEXP (lhs, 1))) { - new = make_compound_operation (XEXP (lhs, 0), next_code); - new = make_extraction (mode, new, + new_rtx = make_compound_operation (XEXP (lhs, 0), next_code); + new_rtx = make_extraction (mode, new_rtx, INTVAL (rhs) - INTVAL (XEXP (lhs, 1)), NULL_RTX, mode_width - INTVAL (rhs), code == LSHIFTRT, 0, in_code == COMPARE); @@ -7007,8 +7007,8 @@ make_compound_operation (rtx x, enum rtx_code in_code) && (OBJECT_P (SUBREG_REG (lhs)))) && GET_CODE (rhs) == CONST_INT && INTVAL (rhs) < HOST_BITS_PER_WIDE_INT - && (new = extract_left_shift (lhs, INTVAL (rhs))) != 0) - new = make_extraction (mode, make_compound_operation (new, next_code), + && (new_rtx = extract_left_shift (lhs, INTVAL (rhs))) != 0) + new_rtx = make_extraction (mode, make_compound_operation (new_rtx, next_code), 0, NULL_RTX, mode_width - INTVAL (rhs), code == LSHIFTRT, 0, in_code == COMPARE); @@ -7053,9 +7053,9 @@ make_compound_operation (rtx x, enum rtx_code in_code) break; } - if (new) + if (new_rtx) { - x = gen_lowpart (mode, new); + x = gen_lowpart (mode, new_rtx); code = GET_CODE (x); } @@ -7064,8 +7064,8 @@ make_compound_operation (rtx x, enum rtx_code in_code) for (i = 0; i < GET_RTX_LENGTH (code); i++) if (fmt[i] == 'e') { - new = make_compound_operation (XEXP (x, i), next_code); - SUBST (XEXP (x, i), new); + new_rtx = make_compound_operation (XEXP (x, i), next_code); + SUBST (XEXP (x, i), new_rtx); } /* If this is a commutative operation, the changes to the operands @@ -8074,16 +8074,16 @@ known_cond (rtx x, enum rtx_code cond, rtx reg, rtx val) else if (code == SUBREG) { enum machine_mode inner_mode = GET_MODE (SUBREG_REG (x)); - rtx new, r = known_cond (SUBREG_REG (x), cond, reg, val); + rtx new_rtx, r = known_cond (SUBREG_REG (x), cond, reg, val); if (SUBREG_REG (x) != r) { /* We must simplify subreg here, before we lose track of the original inner_mode. */ - new = simplify_subreg (GET_MODE (x), r, + new_rtx = simplify_subreg (GET_MODE (x), r, inner_mode, SUBREG_BYTE (x)); - if (new) - return new; + if (new_rtx) + return new_rtx; else SUBST (SUBREG_REG (x), r); } @@ -8099,16 +8099,16 @@ known_cond (rtx x, enum rtx_code cond, rtx reg, rtx val) else if (code == ZERO_EXTEND) { enum machine_mode inner_mode = GET_MODE (XEXP (x, 0)); - rtx new, r = known_cond (XEXP (x, 0), cond, reg, val); + rtx new_rtx, r = known_cond (XEXP (x, 0), cond, reg, val); if (XEXP (x, 0) != r) { /* We must simplify the zero_extend here, before we lose track of the original inner_mode. */ - new = simplify_unary_operation (ZERO_EXTEND, GET_MODE (x), + new_rtx = simplify_unary_operation (ZERO_EXTEND, GET_MODE (x), r, inner_mode); - if (new) - return new; + if (new_rtx) + return new_rtx; else SUBST (XEXP (x, 0), r); } @@ -8961,7 +8961,7 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode, enum rtx_code outer_op = UNKNOWN; HOST_WIDE_INT outer_const = 0; int complement_p = 0; - rtx new, x; + rtx new_rtx, x; /* Make sure and truncate the "natural" shift on the way in. We don't want to do this inside the loop as it makes it more difficult to @@ -9083,10 +9083,10 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode, case ZERO_EXTEND: case SIGN_EXTRACT: case ZERO_EXTRACT: - new = expand_compound_operation (varop); - if (new != varop) + new_rtx = expand_compound_operation (varop); + if (new_rtx != varop) { - varop = new; + varop = new_rtx; continue; } break; @@ -9101,12 +9101,12 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode, && (tmode = mode_for_size (GET_MODE_BITSIZE (mode) - count, MODE_INT, 1)) != BLKmode) { - new = adjust_address_nv (varop, tmode, + new_rtx = adjust_address_nv (varop, tmode, BYTES_BIG_ENDIAN ? 0 : count / BITS_PER_UNIT); varop = gen_rtx_fmt_e (code == ASHIFTRT ? SIGN_EXTEND - : ZERO_EXTEND, mode, new); + : ZERO_EXTEND, mode, new_rtx); count = 0; continue; } @@ -9327,10 +9327,10 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode, && GET_CODE (XEXP (varop, 0)) == CONST_INT && GET_CODE (XEXP (varop, 1)) != CONST_INT) { - rtx new = simplify_const_binary_operation (code, mode, + rtx new_rtx = simplify_const_binary_operation (code, mode, XEXP (varop, 0), GEN_INT (count)); - varop = gen_rtx_fmt_ee (code, mode, new, XEXP (varop, 1)); + varop = gen_rtx_fmt_ee (code, mode, new_rtx, XEXP (varop, 1)); count = 0; continue; } @@ -9384,12 +9384,12 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode, && !(code == ASHIFTRT && GET_CODE (varop) == XOR && 0 > trunc_int_for_mode (INTVAL (XEXP (varop, 1)), shift_mode)) - && (new = simplify_const_binary_operation (code, result_mode, + && (new_rtx = simplify_const_binary_operation (code, result_mode, XEXP (varop, 1), GEN_INT (count))) != 0 - && GET_CODE (new) == CONST_INT + && GET_CODE (new_rtx) == CONST_INT && merge_outer_ops (&outer_op, &outer_const, GET_CODE (varop), - INTVAL (new), result_mode, &complement_p)) + INTVAL (new_rtx), result_mode, &complement_p)) { varop = XEXP (varop, 0); continue; @@ -9512,12 +9512,12 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode, /* (ashift (plus foo C) N) is (plus (ashift foo N) C'). */ if (code == ASHIFT && GET_CODE (XEXP (varop, 1)) == CONST_INT - && (new = simplify_const_binary_operation (ASHIFT, result_mode, + && (new_rtx = simplify_const_binary_operation (ASHIFT, result_mode, XEXP (varop, 1), GEN_INT (count))) != 0 - && GET_CODE (new) == CONST_INT + && GET_CODE (new_rtx) == CONST_INT && merge_outer_ops (&outer_op, &outer_const, PLUS, - INTVAL (new), result_mode, &complement_p)) + INTVAL (new_rtx), result_mode, &complement_p)) { varop = XEXP (varop, 0); continue; @@ -9531,12 +9531,12 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode, if (code == LSHIFTRT && GET_CODE (XEXP (varop, 1)) == CONST_INT && mode_signbit_p (result_mode, XEXP (varop, 1)) - && (new = simplify_const_binary_operation (code, result_mode, + && (new_rtx = simplify_const_binary_operation (code, result_mode, XEXP (varop, 1), GEN_INT (count))) != 0 - && GET_CODE (new) == CONST_INT + && GET_CODE (new_rtx) == CONST_INT && merge_outer_ops (&outer_op, &outer_const, XOR, - INTVAL (new), result_mode, &complement_p)) + INTVAL (new_rtx), result_mode, &complement_p)) { varop = XEXP (varop, 0); continue; diff --git a/gcc/config/host-linux.c b/gcc/config/host-linux.c index f0666173b62..c94f822f701 100644 --- a/gcc/config/host-linux.c +++ b/gcc/config/host-linux.c @@ -84,6 +84,8 @@ # define TRY_EMPTY_VM_SPACE 0x8000000000 #elif defined(__sparc__) # define TRY_EMPTY_VM_SPACE 0x60000000 +#elif defined(__mc68000__) +# define TRY_EMPTY_VM_SPACE 0x40000000 #else # define TRY_EMPTY_VM_SPACE 0 #endif diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index b0733dd8364..ef6ba16b5a9 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -1778,6 +1778,8 @@ m32c_init_libfuncs (void) /* Addressing Modes */ +#define BIG_FB_ADJ 0 + /* Used by GO_IF_LEGITIMATE_ADDRESS. The r8c/m32c family supports a wide range of non-orthogonal addressing modes, including the ability to double-indirect on *some* of them. Not all insns @@ -1895,6 +1897,17 @@ m32c_legitimate_address_p (enum machine_mode mode, rtx x, int strict) return 0; } } + if (RTX_IS ("++rii")) + { + rtx reg = patternr[2]; + HOST_WIDE_INT offs = INTVAL (patternr[3]); + + /* Avoid reloads for addresses generated by + m32c_legitimize_reload_address being generated by + find_reloads_subreg_address. */ + if (REGNO (reg) == FB_REGNO && offs == -BIG_FB_ADJ) + return 1; + } return 0; } @@ -1942,8 +1955,6 @@ m32c_reg_ok_for_base_p (rtx x, int strict) frame, so the third case seems best. Note that we subtract the zero, but detect that in the addhi3 pattern. */ -#define BIG_FB_ADJ 0 - /* Implements LEGITIMIZE_ADDRESS. The only address we really have to worry about is frame base offsets, as $fb has a limited displacement range. We deal with this by attempting to reload $fb diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 214b6922b5c..88c7226d7a2 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1493,19 +1493,20 @@ rs6000_override_options (const char *default_cpu) {"power3", PROCESSOR_PPC630, POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_POWERPC64}, {"power4", PROCESSOR_POWER4, - POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_MFCRF | MASK_POWERPC64}, + POWERPC_BASE_MASK | MASK_POWERPC64 | MASK_PPC_GPOPT | MASK_PPC_GFXOPT + | MASK_MFCRF}, {"power5", PROCESSOR_POWER5, - POWERPC_BASE_MASK | MASK_POWERPC64 | MASK_PPC_GFXOPT + POWERPC_BASE_MASK | MASK_POWERPC64 | MASK_PPC_GPOPT | MASK_PPC_GFXOPT | MASK_MFCRF | MASK_POPCNTB}, {"power5+", PROCESSOR_POWER5, - POWERPC_BASE_MASK | MASK_POWERPC64 | MASK_PPC_GFXOPT + POWERPC_BASE_MASK | MASK_POWERPC64 | MASK_PPC_GPOPT | MASK_PPC_GFXOPT | MASK_MFCRF | MASK_POPCNTB | MASK_FPRND}, {"power6", PROCESSOR_POWER6, - POWERPC_7400_MASK | MASK_POWERPC64 | MASK_MFCRF | MASK_POPCNTB - | MASK_FPRND | MASK_CMPB | MASK_DFP }, + POWERPC_7400_MASK | MASK_POWERPC64 | MASK_PPC_GPOPT | MASK_MFCRF + | MASK_POPCNTB | MASK_FPRND | MASK_CMPB | MASK_DFP}, {"power6x", PROCESSOR_POWER6, - POWERPC_7400_MASK | MASK_POWERPC64 | MASK_MFCRF | MASK_POPCNTB - | MASK_FPRND | MASK_CMPB | MASK_MFPGPR | MASK_DFP }, + POWERPC_7400_MASK | MASK_POWERPC64 | MASK_PPC_GPOPT | MASK_MFCRF + | MASK_POPCNTB | MASK_FPRND | MASK_CMPB | MASK_DFP | MASK_MFPGPR}, {"powerpc", PROCESSOR_POWERPC, POWERPC_BASE_MASK}, {"powerpc64", PROCESSOR_POWERPC64, POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_POWERPC64}, @@ -12288,9 +12289,13 @@ print_operand (FILE *file, rtx x, int code) fprintf (file, "0,%s", reg_names[REGNO (tmp)]); else { - gcc_assert (GET_CODE (tmp) == PLUS - && REG_P (XEXP (tmp, 0)) - && REG_P (XEXP (tmp, 1))); + if (!GET_CODE (tmp) == PLUS + || !REG_P (XEXP (tmp, 0)) + || !REG_P (XEXP (tmp, 1))) + { + output_operand_lossage ("invalid %%y value, try using the 'Z' constraint"); + break; + } if (REGNO (XEXP (tmp, 0)) == 0) fprintf (file, "%s,%s", reg_names[ REGNO (XEXP (tmp, 1)) ], diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h index 5204847abc5..f8b798d327c 100644 --- a/gcc/config/sh/sh.h +++ b/gcc/config/sh/sh.h @@ -2501,6 +2501,19 @@ struct sh_args { goto LABEL; \ } \ } \ + /* FIXME: This is a temporary hack which should be removed. \ + When reload in progress, find_reloads_subreg_address tries to \ + make a new reload for some types of address. Unfortunately it \ + generates wrong code on SH. See PR36780. The following is to \ + avoid this issue. */ \ + if (!TARGET_SHMEDIA && reload_in_progress \ + && GET_CODE (X) == PLUS \ + && (GET_MODE_SIZE (MODE) == 4 || GET_MODE_SIZE (MODE) == 8) \ + && GET_CODE (XEXP ((X), 0)) == PLUS \ + && GET_CODE (XEXP (XEXP ((X), 0), 1)) == CONST_INT \ + && BASE_REGISTER_RTX_P (XEXP (XEXP ((X), 0), 0)) \ + && GET_CODE (XEXP ((X), 1)) == CONST_INT) \ + goto LABEL; \ } /* Try machine-dependent ways of modifying an illegitimate address diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index 837fd2e0484..6300054220a 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -8880,9 +8880,6 @@ label: /* ??? Should we have a special alias set for the GOT? */ insn = emit_move_insn (operands[0], mem); - set_unique_reg_note (insn, REG_EQUAL, - XVECEXP (XEXP (operands[1], 0), 0, 0)); - DONE; }") diff --git a/gcc/config/xtensa/t-linux b/gcc/config/xtensa/t-linux index 7d39351fa66..7d535e155b4 100644 --- a/gcc/config/xtensa/t-linux +++ b/gcc/config/xtensa/t-linux @@ -1 +1,3 @@ EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o + +SHLIB_MAPFILES += $(srcdir)/config/xtensa/libgcc-xtensa.ver diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 6e26d76daad..38a621df0d0 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -142,6 +142,7 @@ static section *xtensa_select_rtx_section (enum machine_mode, rtx, static bool xtensa_rtx_costs (rtx, int, int, int *); static tree xtensa_build_builtin_va_list (void); static bool xtensa_return_in_memory (const_tree, const_tree); +static rtx xtensa_function_value (const_tree, const_tree, bool); static tree xtensa_gimplify_va_arg_expr (tree, tree, tree *, tree *); static void xtensa_init_builtins (void); static tree xtensa_fold_builtin (tree, tree, bool); @@ -192,6 +193,8 @@ static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] = #undef TARGET_RETURN_IN_MEMORY #define TARGET_RETURN_IN_MEMORY xtensa_return_in_memory +#undef TARGET_FUNCTION_VALUE +#define TARGET_FUNCTION_VALUE xtensa_function_value #undef TARGET_SPLIT_COMPLEX_ARG #define TARGET_SPLIT_COMPLEX_ARG hook_bool_const_tree_true #undef TARGET_MUST_PASS_IN_STACK @@ -3163,6 +3166,17 @@ xtensa_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) > 4 * UNITS_PER_WORD); } +/* Worker function for TARGET_FUNCTION_VALUE. */ + +rtx +xtensa_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED, + bool outgoing) +{ + return gen_rtx_REG ((INTEGRAL_TYPE_P (valtype) + && TYPE_PRECISION (valtype) < BITS_PER_WORD) + ? SImode : TYPE_MODE (valtype), + outgoing ? GP_OUTGOING_RETURN : GP_RETURN); +} /* TRAMPOLINE_TEMPLATE: For Xtensa, the trampoline must perform an ENTRY instruction with a minimal stack frame in order to get some free diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h index eaef97e2094..920f9d2ef18 100644 --- a/gcc/config/xtensa/xtensa.h +++ b/gcc/config/xtensa/xtensa.h @@ -608,22 +608,6 @@ extern const enum reg_class xtensa_regno_to_class[FIRST_PSEUDO_REGISTER]; #define LIBCALL_OUTGOING_VALUE(MODE) \ XTENSA_LIBCALL_VALUE ((MODE), 1) -/* Define how to find the value returned by a function. - VALTYPE is the data type of the value (as a tree). - If the precise function being called is known, FUNC is its FUNCTION_DECL; - otherwise, FUNC is 0. */ -#define XTENSA_FUNCTION_VALUE(VALTYPE, FUNC, OUTGOINGP) \ - gen_rtx_REG ((INTEGRAL_TYPE_P (VALTYPE) \ - && TYPE_PRECISION (VALTYPE) < BITS_PER_WORD) \ - ? SImode: TYPE_MODE (VALTYPE), \ - OUTGOINGP ? GP_OUTGOING_RETURN : GP_RETURN) - -#define FUNCTION_VALUE(VALTYPE, FUNC) \ - XTENSA_FUNCTION_VALUE (VALTYPE, FUNC, 0) - -#define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) \ - XTENSA_FUNCTION_VALUE (VALTYPE, FUNC, 1) - /* A C expression that is nonzero if REGNO is the number of a hard register in which the values of called function may come back. A register whose use for returning values is limited to serving as diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 62d2335dde1..0e537b855c7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,16 @@ +2008-07-17 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/36855 + * semantics.c (trait_expr_value): Update __has_trivial_destructor + semantics to the current WP (N2691). + +2008-07-16 Dodji Seketeli <dseketel@redhat.com> + + PR c++/13699 + * name-lookup.c (lookup_extern_c_fun_binding_in_all_ns): New function. + (pushdecl_maybe_friend): Check if a redeclaration of extern C function + complies with exception specification constraints. + 2008-07-14 Jason Merrill <jason@redhat.com> * lex.c (init_reswords): Always set D_OBJC. @@ -14,8 +27,8 @@ PR c++/13101 * decl.c (grokdeclarator): Warn about initializing variables - of storage class 'extern' only after the type of the declarator - has been properly computed. + of storage class 'extern' only after the type of the declarator + has been properly computed. 2008-07-11 Dodji Seketeli <dseketel@redhat.com> diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index e42f60afba7..45899c535e6 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -50,6 +50,7 @@ static bool qualified_lookup_using_namespace (tree, tree, struct scope_binding *, int); static tree lookup_type_current_level (tree); static tree push_using_directive (tree); +static cxx_binding* lookup_extern_c_fun_binding_in_all_ns (tree); /* The :: namespace. */ @@ -763,6 +764,48 @@ pushdecl_maybe_friend (tree x, bool is_friend) } } + /* If x has C linkage-specification, (extern "C"), + lookup its binding, in case it's already bound to an object. + The lookup is done in all namespaces. + If we find an existing binding, make sure it has the same + exception specification as x, otherwise, bail in error [7.5, 7.6]. */ + if ((TREE_CODE (x) == FUNCTION_DECL) + && DECL_EXTERN_C_P (x) + /* We should ignore declarations happening in system headers. */ + && !DECL_IN_SYSTEM_HEADER (x)) + { + cxx_binding *function_binding = + lookup_extern_c_fun_binding_in_all_ns (x); + if (function_binding + && !DECL_IN_SYSTEM_HEADER (function_binding->value)) + { + tree previous = function_binding->value; + + /* In case either x or previous is declared to throw an exception, + make sure both exception speficications are equal. */ + if (decls_match (x, previous)) + { + tree x_exception_spec = NULL_TREE; + tree previous_exception_spec = NULL_TREE; + + x_exception_spec = + TYPE_RAISES_EXCEPTIONS (TREE_TYPE (x)); + previous_exception_spec = + TYPE_RAISES_EXCEPTIONS (TREE_TYPE (previous)); + if (!comp_except_specs (previous_exception_spec, + x_exception_spec, + true)) + { + pedwarn ("declaration of %q#D with C language linkage", x); + pedwarn ("conflicts with previous declaration %q+#D", + previous); + pedwarn ("due to different exception specifications"); + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node); + } + } + } + } + if (TREE_CODE (x) == FUNCTION_DECL || DECL_FUNCTION_TEMPLATE_P (x)) check_default_args (x); @@ -1831,6 +1874,39 @@ binding_for_name (cxx_scope *scope, tree name) return result; } +/* Walk through the bindings associated to the name of FUNCTION, + and return the first binding that declares a function with a + "C" linkage specification, a.k.a 'extern "C"'. + This function looks for the binding, regardless of which scope it + has been defined in. It basically looks in all the known scopes. + Note that this function does not lookup for bindings of builtin functions + or for functions declared in system headers. */ +static cxx_binding* +lookup_extern_c_fun_binding_in_all_ns (tree function) +{ + tree name; + cxx_binding *iter; + + gcc_assert (function && TREE_CODE (function) == FUNCTION_DECL); + + name = DECL_NAME (function); + gcc_assert (name && TREE_CODE (name) == IDENTIFIER_NODE); + + for (iter = IDENTIFIER_NAMESPACE_BINDINGS (name); + iter; + iter = iter->previous) + { + if (iter->value + && TREE_CODE (iter->value) == FUNCTION_DECL + && DECL_EXTERN_C_P (iter->value) + && !DECL_ARTIFICIAL (iter->value)) + { + return iter; + } + } + return NULL; +} + /* Insert another USING_DECL into the current binding level, returning this declaration. If this is a redeclaration, do nothing, and return NULL_TREE if this not in namespace scope (in namespace diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 17b1e5dee49..d2f56ea810a 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -4730,7 +4730,7 @@ trait_expr_value (cp_trait_kind kind, tree type1, tree type2) case CPTK_HAS_TRIVIAL_DESTRUCTOR: type1 = strip_array_types (type1); - return (pod_type_p (type1) + return (pod_type_p (type1) || type_code1 == REFERENCE_TYPE || (CLASS_TYPE_P (type1) && TYPE_HAS_TRIVIAL_DESTRUCTOR (type1))); diff --git a/gcc/cse.c b/gcc/cse.c index 86c0f5408da..273e590323b 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -913,18 +913,18 @@ make_new_qty (unsigned int reg, enum machine_mode mode) OLD is not changing; NEW is. */ static void -make_regs_eqv (unsigned int new, unsigned int old) +make_regs_eqv (unsigned int new_reg, unsigned int old_reg) { unsigned int lastr, firstr; - int q = REG_QTY (old); + int q = REG_QTY (old_reg); struct qty_table_elem *ent; ent = &qty_table[q]; /* Nothing should become eqv until it has a "non-invalid" qty number. */ - gcc_assert (REGNO_QTY_VALID_P (old)); + gcc_assert (REGNO_QTY_VALID_P (old_reg)); - REG_QTY (new) = q; + REG_QTY (new_reg) = q; firstr = ent->first_reg; lastr = ent->last_reg; @@ -937,19 +937,19 @@ make_regs_eqv (unsigned int new, unsigned int old) that not only can they not be allocated by the compiler, but they cannot be used in substitutions or canonicalizations either. */ - && (new >= FIRST_PSEUDO_REGISTER || REGNO_REG_CLASS (new) != NO_REGS) - && ((new < FIRST_PSEUDO_REGISTER && FIXED_REGNO_P (new)) - || (new >= FIRST_PSEUDO_REGISTER + && (new_reg >= FIRST_PSEUDO_REGISTER || REGNO_REG_CLASS (new_reg) != NO_REGS) + && ((new_reg < FIRST_PSEUDO_REGISTER && FIXED_REGNO_P (new_reg)) + || (new_reg >= FIRST_PSEUDO_REGISTER && (firstr < FIRST_PSEUDO_REGISTER - || (bitmap_bit_p (cse_ebb_live_out, new) + || (bitmap_bit_p (cse_ebb_live_out, new_reg) && !bitmap_bit_p (cse_ebb_live_out, firstr)) - || (bitmap_bit_p (cse_ebb_live_in, new) + || (bitmap_bit_p (cse_ebb_live_in, new_reg) && !bitmap_bit_p (cse_ebb_live_in, firstr)))))) { - reg_eqv_table[firstr].prev = new; - reg_eqv_table[new].next = firstr; - reg_eqv_table[new].prev = -1; - ent->first_reg = new; + reg_eqv_table[firstr].prev = new_reg; + reg_eqv_table[new_reg].next = firstr; + reg_eqv_table[new_reg].prev = -1; + ent->first_reg = new_reg; } else { @@ -959,15 +959,15 @@ make_regs_eqv (unsigned int new, unsigned int old) equivalent for anything. */ while (lastr < FIRST_PSEUDO_REGISTER && reg_eqv_table[lastr].prev >= 0 && (REGNO_REG_CLASS (lastr) == NO_REGS || ! FIXED_REGNO_P (lastr)) - && new >= FIRST_PSEUDO_REGISTER) + && new_reg >= FIRST_PSEUDO_REGISTER) lastr = reg_eqv_table[lastr].prev; - reg_eqv_table[new].next = reg_eqv_table[lastr].next; + reg_eqv_table[new_reg].next = reg_eqv_table[lastr].next; if (reg_eqv_table[lastr].next >= 0) - reg_eqv_table[reg_eqv_table[lastr].next].prev = new; + reg_eqv_table[reg_eqv_table[lastr].next].prev = new_reg; else - qty_table[q].last_reg = new; - reg_eqv_table[lastr].next = new; - reg_eqv_table[new].prev = lastr; + qty_table[q].last_reg = new_reg; + reg_eqv_table[lastr].next = new_reg; + reg_eqv_table[new_reg].prev = lastr; } } @@ -1584,7 +1584,7 @@ insert (rtx x, struct table_elt *classp, unsigned int hash, enum machine_mode mo static void merge_equiv_classes (struct table_elt *class1, struct table_elt *class2) { - struct table_elt *elt, *next, *new; + struct table_elt *elt, *next, *new_elt; /* Ensure we start with the head of the classes. */ class1 = class1->first_same_value; @@ -1628,8 +1628,8 @@ merge_equiv_classes (struct table_elt *class1, struct table_elt *class2) rehash_using_reg (exp); hash = HASH (exp, mode); } - new = insert (exp, class1, hash, mode); - new->in_memory = hash_arg_in_memory; + new_elt = insert (exp, class1, hash, mode); + new_elt->in_memory = hash_arg_in_memory; } } } @@ -2648,12 +2648,12 @@ validate_canon_reg (rtx *xloc, rtx insn) { if (*xloc) { - rtx new = canon_reg (*xloc, insn); + rtx new_rtx = canon_reg (*xloc, insn); /* If replacing pseudo with hard reg or vice versa, ensure the insn remains valid. Likewise if the insn has MATCH_DUPs. */ - gcc_assert (insn && new); - validate_change (insn, xloc, new, 1); + gcc_assert (insn && new_rtx); + validate_change (insn, xloc, new_rtx, 1); } } @@ -2948,7 +2948,7 @@ fold_rtx (rtx x, rtx insn) enum machine_mode mode; const char *fmt; int i; - rtx new = 0; + rtx new_rtx = 0; int changed = 0; /* Operands of X. */ @@ -2974,8 +2974,8 @@ fold_rtx (rtx x, rtx insn) { case MEM: case SUBREG: - if ((new = equiv_constant (x)) != NULL_RTX) - return new; + if ((new_rtx = equiv_constant (x)) != NULL_RTX) + return new_rtx; return x; case CONST: @@ -3150,7 +3150,7 @@ fold_rtx (rtx x, rtx insn) if (const_arg0 != 0 && GET_CODE (const_arg0) == CONST) is_const = 1, const_arg0 = XEXP (const_arg0, 0); - new = simplify_unary_operation (code, mode, + new_rtx = simplify_unary_operation (code, mode, const_arg0 ? const_arg0 : folded_arg0, mode_arg0); /* NEG of PLUS could be converted into MINUS, but that causes @@ -3158,12 +3158,12 @@ fold_rtx (rtx x, rtx insn) (CONST (MINUS (CONST_INT) (SYMBOL_REF))) which many ports mistakenly treat as LEGITIMATE_CONSTANT_P. FIXME: those ports should be fixed. */ - if (new != 0 && is_const - && GET_CODE (new) == PLUS - && (GET_CODE (XEXP (new, 0)) == SYMBOL_REF - || GET_CODE (XEXP (new, 0)) == LABEL_REF) - && GET_CODE (XEXP (new, 1)) == CONST_INT) - new = gen_rtx_CONST (mode, new); + if (new_rtx != 0 && is_const + && GET_CODE (new_rtx) == PLUS + && (GET_CODE (XEXP (new_rtx, 0)) == SYMBOL_REF + || GET_CODE (XEXP (new_rtx, 0)) == LABEL_REF) + && GET_CODE (XEXP (new_rtx, 1)) == CONST_INT) + new_rtx = gen_rtx_CONST (mode, new_rtx); } break; @@ -3324,7 +3324,7 @@ fold_rtx (rtx x, rtx insn) { rtx op0 = const_arg0 ? const_arg0 : folded_arg0; rtx op1 = const_arg1 ? const_arg1 : folded_arg1; - new = simplify_relational_operation (code, mode, mode_arg0, op0, op1); + new_rtx = simplify_relational_operation (code, mode, mode_arg0, op0, op1); } break; @@ -3560,7 +3560,7 @@ fold_rtx (rtx x, rtx insn) break; } - new = simplify_binary_operation (code, mode, + new_rtx = simplify_binary_operation (code, mode, const_arg0 ? const_arg0 : folded_arg0, const_arg1 ? const_arg1 : folded_arg1); break; @@ -3575,7 +3575,7 @@ fold_rtx (rtx x, rtx insn) case RTX_TERNARY: case RTX_BITFIELD_OPS: - new = simplify_ternary_operation (code, mode, mode_arg0, + new_rtx = simplify_ternary_operation (code, mode, mode_arg0, const_arg0 ? const_arg0 : folded_arg0, const_arg1 ? const_arg1 : folded_arg1, const_arg2 ? const_arg2 : XEXP (x, 2)); @@ -3585,7 +3585,7 @@ fold_rtx (rtx x, rtx insn) break; } - return new ? new : x; + return new_rtx ? new_rtx : x; } /* Return a constant value currently equivalent to X. @@ -3609,16 +3609,16 @@ equiv_constant (rtx x) if (GET_CODE (x) == SUBREG) { - rtx new; + rtx new_rtx; /* See if we previously assigned a constant value to this SUBREG. */ - if ((new = lookup_as_function (x, CONST_INT)) != 0 - || (new = lookup_as_function (x, CONST_DOUBLE)) != 0 - || (new = lookup_as_function (x, CONST_FIXED)) != 0) - return new; + if ((new_rtx = lookup_as_function (x, CONST_INT)) != 0 + || (new_rtx = lookup_as_function (x, CONST_DOUBLE)) != 0 + || (new_rtx = lookup_as_function (x, CONST_FIXED)) != 0) + return new_rtx; if (REG_P (SUBREG_REG (x)) - && (new = equiv_constant (SUBREG_REG (x))) != 0) + && (new_rtx = equiv_constant (SUBREG_REG (x))) != 0) return simplify_subreg (GET_MODE (x), SUBREG_REG (x), GET_MODE (SUBREG_REG (x)), SUBREG_BYTE (x)); @@ -4161,9 +4161,9 @@ cse_insn (rtx insn) { rtx dest = SET_DEST (sets[i].rtl); rtx src = SET_SRC (sets[i].rtl); - rtx new = canon_reg (src, insn); + rtx new_rtx = canon_reg (src, insn); - validate_change (insn, &SET_SRC (sets[i].rtl), new, 1); + validate_change (insn, &SET_SRC (sets[i].rtl), new_rtx, 1); if (GET_CODE (dest) == ZERO_EXTRACT) { @@ -4811,12 +4811,12 @@ cse_insn (rtx insn) else if (validate_unshare_change (insn, &SET_SRC (sets[i].rtl), trial, 0)) { - rtx new = canon_reg (SET_SRC (sets[i].rtl), insn); + rtx new_rtx = canon_reg (SET_SRC (sets[i].rtl), insn); /* The result of apply_change_group can be ignored; see canon_reg. */ - validate_change (insn, &SET_SRC (sets[i].rtl), new, 1); + validate_change (insn, &SET_SRC (sets[i].rtl), new_rtx, 1); apply_change_group (); break; @@ -5016,10 +5016,10 @@ cse_insn (rtx insn) and hope for the best. */ if (n_sets == 1) { - rtx new, note; + rtx new_rtx, note; - new = emit_jump_insn_before (gen_jump (XEXP (src, 0)), insn); - JUMP_LABEL (new) = XEXP (src, 0); + new_rtx = emit_jump_insn_before (gen_jump (XEXP (src, 0)), insn); + JUMP_LABEL (new_rtx) = XEXP (src, 0); LABEL_NUSES (XEXP (src, 0))++; /* Make sure to copy over REG_NON_LOCAL_GOTO. */ @@ -5027,11 +5027,11 @@ cse_insn (rtx insn) if (note) { XEXP (note, 1) = NULL_RTX; - REG_NOTES (new) = note; + REG_NOTES (new_rtx) = note; } delete_insn_and_edges (insn); - insn = new; + insn = new_rtx; } else INSN_CODE (insn) = -1; @@ -5674,11 +5674,11 @@ cse_process_notes_1 (rtx x, rtx object, bool *changed) case ZERO_EXTEND: case SUBREG: { - rtx new = cse_process_notes (XEXP (x, 0), object, changed); + rtx new_rtx = cse_process_notes (XEXP (x, 0), object, changed); /* We don't substitute VOIDmode constants into these rtx, since they would impede folding. */ - if (GET_MODE (new) != VOIDmode) - validate_change (object, &XEXP (x, 0), new, 0); + if (GET_MODE (new_rtx) != VOIDmode) + validate_change (object, &XEXP (x, 0), new_rtx, 0); return x; } @@ -5694,9 +5694,9 @@ cse_process_notes_1 (rtx x, rtx object, bool *changed) && (CONSTANT_P (ent->const_rtx) || REG_P (ent->const_rtx))) { - rtx new = gen_lowpart (GET_MODE (x), ent->const_rtx); - if (new) - return copy_rtx (new); + rtx new_rtx = gen_lowpart (GET_MODE (x), ent->const_rtx); + if (new_rtx) + return copy_rtx (new_rtx); } } @@ -5718,10 +5718,10 @@ cse_process_notes_1 (rtx x, rtx object, bool *changed) static rtx cse_process_notes (rtx x, rtx object, bool *changed) { - rtx new = cse_process_notes_1 (x, object, changed); - if (new != x) + rtx new_rtx = cse_process_notes_1 (x, object, changed); + if (new_rtx != x) *changed = true; - return new; + return new_rtx; } diff --git a/gcc/df-problems.c b/gcc/df-problems.c index 0c46bdaa496..abb34d0596a 100644 --- a/gcc/df-problems.c +++ b/gcc/df-problems.c @@ -3170,24 +3170,24 @@ df_kill_notes (rtx insn, rtx *old_dead_notes, rtx *old_unused_notes) static inline rtx df_set_note (enum reg_note note_type, rtx insn, rtx old, rtx reg) { - rtx this = old; + rtx curr = old; rtx prev = NULL; - while (this) - if (XEXP (this, 0) == reg) + while (curr) + if (XEXP (curr, 0) == reg) { if (prev) - XEXP (prev, 1) = XEXP (this, 1); + XEXP (prev, 1) = XEXP (curr, 1); else - old = XEXP (this, 1); - XEXP (this, 1) = REG_NOTES (insn); - REG_NOTES (insn) = this; + old = XEXP (curr, 1); + XEXP (curr, 1) = REG_NOTES (insn); + REG_NOTES (insn) = curr; return old; } else { - prev = this; - this = XEXP (this, 1); + prev = curr; + curr = XEXP (curr, 1); } /* Did not find the note. */ diff --git a/gcc/df-scan.c b/gcc/df-scan.c index 5818717651d..0ce48b5d1e0 100644 --- a/gcc/df-scan.c +++ b/gcc/df-scan.c @@ -1887,10 +1887,10 @@ df_insn_change_bb (rtx insn, basic_block new_bb) /* Helper function for df_ref_change_reg_with_loc. */ static void -df_ref_change_reg_with_loc_1 (struct df_reg_info *old, struct df_reg_info *new, +df_ref_change_reg_with_loc_1 (struct df_reg_info *old_df, struct df_reg_info *new_df, int new_regno, rtx loc) { - struct df_ref *the_ref = old->reg_chain; + struct df_ref *the_ref = old_df->reg_chain; while (the_ref) { @@ -1908,18 +1908,18 @@ df_ref_change_reg_with_loc_1 (struct df_reg_info *old, struct df_reg_info *new, if (prev_ref) prev_ref->next_reg = next_ref; else - old->reg_chain = next_ref; + old_df->reg_chain = next_ref; if (next_ref) next_ref->prev_reg = prev_ref; - old->n_refs--; + old_df->n_refs--; /* Put the ref into the new regno chain. */ the_ref->prev_reg = NULL; - the_ref->next_reg = new->reg_chain; - if (new->reg_chain) - new->reg_chain->prev_reg = the_ref; - new->reg_chain = the_ref; - new->n_refs++; + the_ref->next_reg = new_df->reg_chain; + if (new_df->reg_chain) + new_df->reg_chain->prev_reg = the_ref; + new_df->reg_chain = the_ref; + new_df->n_refs++; df_set_bb_dirty (DF_REF_BB (the_ref)); /* Need to resort the record that the ref was in because the diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index eecb4ca5bf4..4a4c9a3a4a1 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -4240,10 +4240,16 @@ The @code{deprecated} attribute can also be used for functions and variables (@pxref{Function Attributes}, @pxref{Variable Attributes}.) @item may_alias -Accesses to objects with types with this attribute are not subjected to -type-based alias analysis, but are instead assumed to be able to alias -any other type of objects, just like the @code{char} type. See -@option{-fstrict-aliasing} for more information on aliasing issues. +Accesses through pointers to types with this attribute are not subject +to type-based alias analysis, but are instead assumed to be able to alias +any other type of objects. In the context of 6.5/7 an lvalue expression +dereferencing such a pointer is treated like having a character type. +See @option{-fstrict-aliasing} for more information on aliasing issues. +This extension exists to support some vector APIs, in which pointers to +one vector type are permitted to alias pointers to a different vector type. + +Note that an object of a type with this attribute does not have any +special semantics. Example of use: diff --git a/gcc/dse.c b/gcc/dse.c index 71d34620110..4d5120160fa 100644 --- a/gcc/dse.c +++ b/gcc/dse.c @@ -1295,7 +1295,7 @@ record_store (rtx body, bb_info_t bb_info) { insn_info_t next = ptr->next_local_store; store_info_t s_info = ptr->store_rec; - bool delete = true; + bool del = true; /* Skip the clobbers. We delete the active insn if this insn shadows the set. To have been put on the active list, it @@ -1304,7 +1304,7 @@ record_store (rtx body, bb_info_t bb_info) s_info = s_info->next; if (s_info->alias_set != spill_alias_set) - delete = false; + del = false; else if (s_info->alias_set) { struct clear_alias_mode_holder *entry @@ -1317,7 +1317,7 @@ record_store (rtx body, bb_info_t bb_info) if ((GET_MODE (mem) == GET_MODE (s_info->mem)) && (GET_MODE (mem) == entry->mode)) { - delete = true; + del = true; s_info->positions_needed = (unsigned HOST_WIDE_INT) 0; } if (dump_file) @@ -1352,9 +1352,9 @@ record_store (rtx body, bb_info_t bb_info) /* An insn can be deleted if every position of every one of its s_infos is zero. */ if (s_info->positions_needed != (unsigned HOST_WIDE_INT) 0) - delete = false; + del = false; - if (delete) + if (del) { insn_info_t insn_to_delete = ptr; @@ -2080,7 +2080,7 @@ remove_useless_values (cselib_val *base) while (insn_info) { store_info_t store_info = insn_info->store_rec; - bool delete = false; + bool del = false; /* If ANY of the store_infos match the cselib group that is being deleted, then the insn can not be deleted. */ @@ -2089,13 +2089,13 @@ remove_useless_values (cselib_val *base) if ((store_info->group_id == -1) && (store_info->cse_base == base)) { - delete = true; + del = true; break; } store_info = store_info->next; } - if (delete) + if (del) { if (last) last->next_local_store = insn_info->next_local_store; diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c index ea19b793df5..43d57e9fa8f 100644 --- a/gcc/dwarf2asm.c +++ b/gcc/dwarf2asm.c @@ -730,11 +730,11 @@ splay_tree_compare_strings (splay_tree_key k1, splay_tree_key k2) /* Put X, a SYMBOL_REF, in memory. Return a SYMBOL_REF to the allocated memory. Differs from force_const_mem in that a single pool is used for the entire unit of translation, and the memory is not guaranteed to be - "near" the function in any interesting sense. PUBLIC controls whether + "near" the function in any interesting sense. IS_PUBLIC controls whether the symbol can be shared across the entire application (or DSO). */ static rtx -dw2_force_const_mem (rtx x, bool public) +dw2_force_const_mem (rtx x, bool is_public) { splay_tree_node node; const char *str; @@ -755,7 +755,7 @@ dw2_force_const_mem (rtx x, bool public) { tree id; - if (public && USE_LINKONCE_INDIRECT) + if (is_public && USE_LINKONCE_INDIRECT) { char *ref_name = XALLOCAVEC (char, strlen (str) + sizeof "DW.ref."); @@ -829,7 +829,7 @@ dw2_output_indirect_constants (void) reference is shared across the entire application (or DSO). */ void -dw2_asm_output_encoded_addr_rtx (int encoding, rtx addr, bool public, +dw2_asm_output_encoded_addr_rtx (int encoding, rtx addr, bool is_public, const char *comment, ...) { int size; @@ -870,7 +870,7 @@ dw2_asm_output_encoded_addr_rtx (int encoding, rtx addr, bool public, the constant pool for this function. Moreover, we'd like to share these constants across the entire unit of translation and even, if possible, across the entire application (or DSO). */ - addr = dw2_force_const_mem (addr, public); + addr = dw2_force_const_mem (addr, is_public); encoding &= ~DW_EH_PE_indirect; goto restart; } diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 658d50d25e4..65fa8e457ec 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -890,12 +890,12 @@ gen_reg_rtx (enum machine_mode mode) if (reg_rtx_no == crtl->emit.regno_pointer_align_length) { int old_size = crtl->emit.regno_pointer_align_length; - char *new; + char *tmp; rtx *new1; - new = XRESIZEVEC (char, crtl->emit.regno_pointer_align, old_size * 2); - memset (new + old_size, 0, old_size); - crtl->emit.regno_pointer_align = (unsigned char *) new; + tmp = XRESIZEVEC (char, crtl->emit.regno_pointer_align, old_size * 2); + memset (tmp + old_size, 0, old_size); + crtl->emit.regno_pointer_align = (unsigned char *) tmp; new1 = GGC_RESIZEVEC (rtx, regno_reg_rtx, old_size * 2); memset (new1 + old_size, 0, old_size * sizeof (rtx)); @@ -913,9 +913,9 @@ gen_reg_rtx (enum machine_mode mode) to the REG_OFFSET. */ static void -update_reg_offset (rtx new, rtx reg, int offset) +update_reg_offset (rtx new_rtx, rtx reg, int offset) { - REG_ATTRS (new) = get_reg_attrs (REG_EXPR (reg), + REG_ATTRS (new_rtx) = get_reg_attrs (REG_EXPR (reg), REG_OFFSET (reg) + offset); } @@ -926,10 +926,10 @@ rtx gen_rtx_REG_offset (rtx reg, enum machine_mode mode, unsigned int regno, int offset) { - rtx new = gen_rtx_REG (mode, regno); + rtx new_rtx = gen_rtx_REG (mode, regno); - update_reg_offset (new, reg, offset); - return new; + update_reg_offset (new_rtx, reg, offset); + return new_rtx; } /* Generate a new pseudo-register with the same attributes as REG, but @@ -938,10 +938,10 @@ gen_rtx_REG_offset (rtx reg, enum machine_mode mode, unsigned int regno, rtx gen_reg_rtx_offset (rtx reg, enum machine_mode mode, int offset) { - rtx new = gen_reg_rtx (mode); + rtx new_rtx = gen_reg_rtx (mode); - update_reg_offset (new, reg, offset); - return new; + update_reg_offset (new_rtx, reg, offset); + return new_rtx; } /* Adjust REG in-place so that it has mode MODE. It is assumed that the @@ -1372,18 +1372,18 @@ operand_subword (rtx op, unsigned int offset, int validate_address, enum machine /* Form a new MEM at the requested address. */ if (MEM_P (op)) { - rtx new = adjust_address_nv (op, word_mode, offset * UNITS_PER_WORD); + rtx new_rtx = adjust_address_nv (op, word_mode, offset * UNITS_PER_WORD); if (! validate_address) - return new; + return new_rtx; else if (reload_completed) { - if (! strict_memory_address_p (word_mode, XEXP (new, 0))) + if (! strict_memory_address_p (word_mode, XEXP (new_rtx, 0))) return 0; } else - return replace_equiv_address (new, XEXP (new, 0)); + return replace_equiv_address (new_rtx, XEXP (new_rtx, 0)); } /* Rest can be handled by simplify_subreg. */ @@ -1834,7 +1834,7 @@ set_mem_size (rtx mem, rtx size) static rtx change_address_1 (rtx memref, enum machine_mode mode, rtx addr, int validate) { - rtx new; + rtx new_rtx; gcc_assert (MEM_P (memref)); if (mode == VOIDmode) @@ -1856,9 +1856,9 @@ change_address_1 (rtx memref, enum machine_mode mode, rtx addr, int validate) if (rtx_equal_p (addr, XEXP (memref, 0)) && mode == GET_MODE (memref)) return memref; - new = gen_rtx_MEM (mode, addr); - MEM_COPY_ATTRIBUTES (new, memref); - return new; + new_rtx = gen_rtx_MEM (mode, addr); + MEM_COPY_ATTRIBUTES (new_rtx, memref); + return new_rtx; } /* Like change_address_1 with VALIDATE nonzero, but we are not saying in what @@ -1867,31 +1867,31 @@ change_address_1 (rtx memref, enum machine_mode mode, rtx addr, int validate) rtx change_address (rtx memref, enum machine_mode mode, rtx addr) { - rtx new = change_address_1 (memref, mode, addr, 1), size; - enum machine_mode mmode = GET_MODE (new); + rtx new_rtx = change_address_1 (memref, mode, addr, 1), size; + enum machine_mode mmode = GET_MODE (new_rtx); unsigned int align; size = mmode == BLKmode ? 0 : GEN_INT (GET_MODE_SIZE (mmode)); align = mmode == BLKmode ? BITS_PER_UNIT : GET_MODE_ALIGNMENT (mmode); /* If there are no changes, just return the original memory reference. */ - if (new == memref) + if (new_rtx == memref) { if (MEM_ATTRS (memref) == 0 || (MEM_EXPR (memref) == NULL && MEM_OFFSET (memref) == NULL && MEM_SIZE (memref) == size && MEM_ALIGN (memref) == align)) - return new; + return new_rtx; - new = gen_rtx_MEM (mmode, XEXP (memref, 0)); - MEM_COPY_ATTRIBUTES (new, memref); + new_rtx = gen_rtx_MEM (mmode, XEXP (memref, 0)); + MEM_COPY_ATTRIBUTES (new_rtx, memref); } - MEM_ATTRS (new) + MEM_ATTRS (new_rtx) = get_mem_attrs (MEM_ALIAS_SET (memref), 0, 0, size, align, mmode); - return new; + return new_rtx; } /* Return a memory reference like MEMREF, but with its mode changed @@ -1905,7 +1905,7 @@ adjust_address_1 (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset, int validate, int adjust) { rtx addr = XEXP (memref, 0); - rtx new; + rtx new_rtx; rtx memoffset = MEM_OFFSET (memref); rtx size = 0; unsigned int memalign = MEM_ALIGN (memref); @@ -1934,7 +1934,7 @@ adjust_address_1 (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset, addr = plus_constant (addr, offset); } - new = change_address_1 (memref, mode, addr, validate); + new_rtx = change_address_1 (memref, mode, addr, validate); /* Compute the new values of the memory attributes due to this adjustment. We add the offsets and update the alignment. */ @@ -1950,17 +1950,17 @@ adjust_address_1 (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset, (unsigned HOST_WIDE_INT) (offset & -offset) * BITS_PER_UNIT); /* We can compute the size in a number of ways. */ - if (GET_MODE (new) != BLKmode) - size = GEN_INT (GET_MODE_SIZE (GET_MODE (new))); + if (GET_MODE (new_rtx) != BLKmode) + size = GEN_INT (GET_MODE_SIZE (GET_MODE (new_rtx))); else if (MEM_SIZE (memref)) size = plus_constant (MEM_SIZE (memref), -offset); - MEM_ATTRS (new) = get_mem_attrs (MEM_ALIAS_SET (memref), MEM_EXPR (memref), - memoffset, size, memalign, GET_MODE (new)); + MEM_ATTRS (new_rtx) = get_mem_attrs (MEM_ALIAS_SET (memref), MEM_EXPR (memref), + memoffset, size, memalign, GET_MODE (new_rtx)); /* At some point, we should validate that this offset is within the object, if all the appropriate values are known. */ - return new; + return new_rtx; } /* Return a memory reference like MEMREF, but with its mode changed @@ -1983,9 +1983,9 @@ adjust_automodify_address_1 (rtx memref, enum machine_mode mode, rtx addr, rtx offset_address (rtx memref, rtx offset, unsigned HOST_WIDE_INT pow2) { - rtx new, addr = XEXP (memref, 0); + rtx new_rtx, addr = XEXP (memref, 0); - new = simplify_gen_binary (PLUS, Pmode, addr, offset); + new_rtx = simplify_gen_binary (PLUS, Pmode, addr, offset); /* At this point we don't know _why_ the address is invalid. It could have secondary memory references, multiplies or anything. @@ -1994,28 +1994,28 @@ offset_address (rtx memref, rtx offset, unsigned HOST_WIDE_INT pow2) being able to recognize the magic around pic_offset_table_rtx. This stuff is fragile, and is yet another example of why it is bad to expose PIC machinery too early. */ - if (! memory_address_p (GET_MODE (memref), new) + if (! memory_address_p (GET_MODE (memref), new_rtx) && GET_CODE (addr) == PLUS && XEXP (addr, 0) == pic_offset_table_rtx) { addr = force_reg (GET_MODE (addr), addr); - new = simplify_gen_binary (PLUS, Pmode, addr, offset); + new_rtx = simplify_gen_binary (PLUS, Pmode, addr, offset); } - update_temp_slot_address (XEXP (memref, 0), new); - new = change_address_1 (memref, VOIDmode, new, 1); + update_temp_slot_address (XEXP (memref, 0), new_rtx); + new_rtx = change_address_1 (memref, VOIDmode, new_rtx, 1); /* If there are no changes, just return the original memory reference. */ - if (new == memref) - return new; + if (new_rtx == memref) + return new_rtx; /* Update the alignment to reflect the offset. Reset the offset, which we don't know. */ - MEM_ATTRS (new) + MEM_ATTRS (new_rtx) = get_mem_attrs (MEM_ALIAS_SET (memref), MEM_EXPR (memref), 0, 0, MIN (MEM_ALIGN (memref), pow2 * BITS_PER_UNIT), - GET_MODE (new)); - return new; + GET_MODE (new_rtx)); + return new_rtx; } /* Return a memory reference like MEMREF, but with its address changed to @@ -2048,14 +2048,14 @@ replace_equiv_address_nv (rtx memref, rtx addr) rtx widen_memory_access (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset) { - rtx new = adjust_address_1 (memref, mode, offset, 1, 1); - tree expr = MEM_EXPR (new); - rtx memoffset = MEM_OFFSET (new); + rtx new_rtx = adjust_address_1 (memref, mode, offset, 1, 1); + tree expr = MEM_EXPR (new_rtx); + rtx memoffset = MEM_OFFSET (new_rtx); unsigned int size = GET_MODE_SIZE (mode); /* If there are no changes, just return the original memory reference. */ - if (new == memref) - return new; + if (new_rtx == memref) + return new_rtx; /* If we don't know what offset we were at within the expression, then we can't know if we've overstepped the bounds. */ @@ -2117,10 +2117,10 @@ widen_memory_access (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset) /* The widened memory may alias other stuff, so zap the alias set. */ /* ??? Maybe use get_alias_set on any remaining expression. */ - MEM_ATTRS (new) = get_mem_attrs (0, expr, memoffset, GEN_INT (size), - MEM_ALIGN (new), mode); + MEM_ATTRS (new_rtx) = get_mem_attrs (0, expr, memoffset, GEN_INT (size), + MEM_ALIGN (new_rtx), mode); - return new; + return new_rtx; } /* Return a newly created CODE_LABEL rtx with a unique label number. */ @@ -5464,27 +5464,27 @@ init_emit_once (int line_numbers) rtx emit_copy_of_insn_after (rtx insn, rtx after) { - rtx new, link; + rtx new_rtx, link; switch (GET_CODE (insn)) { case INSN: - new = emit_insn_after (copy_insn (PATTERN (insn)), after); + new_rtx = emit_insn_after (copy_insn (PATTERN (insn)), after); break; case JUMP_INSN: - new = emit_jump_insn_after (copy_insn (PATTERN (insn)), after); + new_rtx = emit_jump_insn_after (copy_insn (PATTERN (insn)), after); break; case CALL_INSN: - new = emit_call_insn_after (copy_insn (PATTERN (insn)), after); + new_rtx = emit_call_insn_after (copy_insn (PATTERN (insn)), after); if (CALL_INSN_FUNCTION_USAGE (insn)) - CALL_INSN_FUNCTION_USAGE (new) + CALL_INSN_FUNCTION_USAGE (new_rtx) = copy_insn (CALL_INSN_FUNCTION_USAGE (insn)); - SIBLING_CALL_P (new) = SIBLING_CALL_P (insn); - RTL_CONST_CALL_P (new) = RTL_CONST_CALL_P (insn); - RTL_PURE_CALL_P (new) = RTL_PURE_CALL_P (insn); - RTL_LOOPING_CONST_OR_PURE_CALL_P (new) + SIBLING_CALL_P (new_rtx) = SIBLING_CALL_P (insn); + RTL_CONST_CALL_P (new_rtx) = RTL_CONST_CALL_P (insn); + RTL_PURE_CALL_P (new_rtx) = RTL_PURE_CALL_P (insn); + RTL_LOOPING_CONST_OR_PURE_CALL_P (new_rtx) = RTL_LOOPING_CONST_OR_PURE_CALL_P (insn); break; @@ -5493,14 +5493,14 @@ emit_copy_of_insn_after (rtx insn, rtx after) } /* Update LABEL_NUSES. */ - mark_jump_label (PATTERN (new), new, 0); + mark_jump_label (PATTERN (new_rtx), new_rtx, 0); - INSN_LOCATOR (new) = INSN_LOCATOR (insn); + INSN_LOCATOR (new_rtx) = INSN_LOCATOR (insn); /* If the old insn is frame related, then so is the new one. This is primarily needed for IA-64 unwind info which marks epilogue insns, which may be duplicated by the basic block reordering code. */ - RTX_FRAME_RELATED_P (new) = RTX_FRAME_RELATED_P (insn); + RTX_FRAME_RELATED_P (new_rtx) = RTX_FRAME_RELATED_P (insn); /* Copy all REG_NOTES except REG_LABEL_OPERAND since mark_jump_label will make them. REG_LABEL_TARGETs are created there too, but are @@ -5509,14 +5509,14 @@ emit_copy_of_insn_after (rtx insn, rtx after) if (REG_NOTE_KIND (link) != REG_LABEL_OPERAND) { if (GET_CODE (link) == EXPR_LIST) - add_reg_note (new, REG_NOTE_KIND (link), + add_reg_note (new_rtx, REG_NOTE_KIND (link), copy_insn_1 (XEXP (link, 0))); else - add_reg_note (new, REG_NOTE_KIND (link), XEXP (link, 0)); + add_reg_note (new_rtx, REG_NOTE_KIND (link), XEXP (link, 0)); } - INSN_CODE (new) = INSN_CODE (insn); - return new; + INSN_CODE (new_rtx) = INSN_CODE (insn); + return new_rtx; } static GTY((deletable)) rtx hard_reg_clobbers [NUM_MACHINE_MODES][FIRST_PSEUDO_REGISTER]; diff --git a/gcc/except.c b/gcc/except.c index 1d9a73639b6..5118a53cfa3 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -419,30 +419,30 @@ init_eh_for_function (void) static struct eh_region * gen_eh_region (enum eh_region_type type, struct eh_region *outer) { - struct eh_region *new; + struct eh_region *new_eh; #ifdef ENABLE_CHECKING gcc_assert (doing_eh (0)); #endif /* Insert a new blank region as a leaf in the tree. */ - new = GGC_CNEW (struct eh_region); - new->type = type; - new->outer = outer; + new_eh = GGC_CNEW (struct eh_region); + new_eh->type = type; + new_eh->outer = outer; if (outer) { - new->next_peer = outer->inner; - outer->inner = new; + new_eh->next_peer = outer->inner; + outer->inner = new_eh; } else { - new->next_peer = cfun->eh->region_tree; - cfun->eh->region_tree = new; + new_eh->next_peer = cfun->eh->region_tree; + cfun->eh->region_tree = new_eh; } - new->region_number = ++cfun->eh->last_region_number; + new_eh->region_number = ++cfun->eh->last_region_number; - return new; + return new_eh; } struct eh_region * @@ -3047,19 +3047,19 @@ action_record_hash (const void *pentry) static int add_action_record (htab_t ar_hash, int filter, int next) { - struct action_record **slot, *new, tmp; + struct action_record **slot, *new_ar, tmp; tmp.filter = filter; tmp.next = next; slot = (struct action_record **) htab_find_slot (ar_hash, &tmp, INSERT); - if ((new = *slot) == NULL) + if ((new_ar = *slot) == NULL) { - new = XNEW (struct action_record); - new->offset = VARRAY_ACTIVE_SIZE (crtl->eh.action_record_data) + 1; - new->filter = filter; - new->next = next; - *slot = new; + new_ar = XNEW (struct action_record); + new_ar->offset = VARRAY_ACTIVE_SIZE (crtl->eh.action_record_data) + 1; + new_ar->filter = filter; + new_ar->next = next; + *slot = new_ar; /* The filter value goes in untouched. The link to the next record is a "self-relative" byte offset, or zero to indicate @@ -3072,7 +3072,7 @@ add_action_record (htab_t ar_hash, int filter, int next) push_sleb128 (&crtl->eh.action_record_data, next); } - return new->offset; + return new_ar->offset; } static int @@ -3550,7 +3550,7 @@ static void output_ttype (tree type, int tt_format, int tt_format_size) { rtx value; - bool public = true; + bool is_public = true; if (type == NULL_TREE) value = const0_rtx; @@ -3573,7 +3573,7 @@ output_ttype (tree type, int tt_format, int tt_format_size) node = varpool_node (type); if (node) varpool_mark_needed_node (node); - public = TREE_PUBLIC (type); + is_public = TREE_PUBLIC (type); } } else @@ -3588,7 +3588,7 @@ output_ttype (tree type, int tt_format, int tt_format_size) assemble_integer (value, tt_format_size, tt_format_size * BITS_PER_UNIT, 1); else - dw2_asm_output_encoded_addr_rtx (tt_format, value, public, NULL); + dw2_asm_output_encoded_addr_rtx (tt_format, value, is_public, NULL); } void diff --git a/gcc/explow.c b/gcc/explow.c index d573836d293..0c941d5b337 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -874,10 +874,10 @@ round_push (rtx size) if (GET_CODE (size) == CONST_INT) { - HOST_WIDE_INT new = (INTVAL (size) + align - 1) / align * align; + HOST_WIDE_INT new_size = (INTVAL (size) + align - 1) / align * align; - if (INTVAL (size) != new) - size = GEN_INT (new); + if (INTVAL (size) != new_size) + size = GEN_INT (new_size); } else { @@ -1136,10 +1136,10 @@ allocate_dynamic_stack_space (rtx size, rtx target, int known_align) if (GET_CODE (size) == CONST_INT) { - HOST_WIDE_INT new = INTVAL (size) / align * align; + HOST_WIDE_INT new_size = INTVAL (size) / align * align; - if (INTVAL (size) != new) - size = GEN_INT (new); + if (INTVAL (size) != new_size) + size = GEN_INT (new_size); } else { diff --git a/gcc/expmed.c b/gcc/expmed.c index bf045fee360..d5127b3c344 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -2050,7 +2050,7 @@ expand_shift (enum tree_code code, enum machine_mode mode, rtx shifted, optab lrotate_optab = rotl_optab; optab rrotate_optab = rotr_optab; enum machine_mode op1_mode; - int try; + int attempt; op1 = expand_normal (amount); op1_mode = GET_MODE (op1); @@ -2105,13 +2105,13 @@ expand_shift (enum tree_code code, enum machine_mode mode, rtx shifted, return shifted; } - for (try = 0; temp == 0 && try < 3; try++) + for (attempt = 0; temp == 0 && attempt < 3; attempt++) { enum optab_methods methods; - if (try == 0) + if (attempt == 0) methods = OPTAB_DIRECT; - else if (try == 1) + else if (attempt == 1) methods = OPTAB_WIDEN; else methods = OPTAB_LIB_WIDEN; diff --git a/gcc/final.c b/gcc/final.c index 7a87235321e..f27e4308741 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -1377,20 +1377,20 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED) static int asm_insn_count (rtx body) { - const char *template; + const char *templ; int count = 1; if (GET_CODE (body) == ASM_INPUT) - template = XSTR (body, 0); + templ = XSTR (body, 0); else - template = decode_asm_operands (body, NULL, NULL, NULL, NULL, NULL); + templ = decode_asm_operands (body, NULL, NULL, NULL, NULL, NULL); - if (!*template) + if (!*templ) return 0; - for (; *template; template++) - if (IS_ASM_LOGICAL_LINE_SEPARATOR (*template, template) - || *template == '\n') + for (; *templ; templ++) + if (IS_ASM_LOGICAL_LINE_SEPARATOR (*templ, templ) + || *templ == '\n') count++; return count; @@ -2039,7 +2039,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, { rtx body = PATTERN (insn); int insn_code_number; - const char *template; + const char *templ; #ifdef HAVE_conditional_execution /* Reset this early so it is correct for ASM statements. */ @@ -2556,12 +2556,12 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, #endif /* Find the proper template for this insn. */ - template = get_insn_template (insn_code_number, insn); + templ = get_insn_template (insn_code_number, insn); /* If the C code returns 0, it means that it is a jump insn which follows a deleted test insn, and that test insn needs to be reinserted. */ - if (template == 0) + if (templ == 0) { rtx prev; @@ -2584,12 +2584,12 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, /* If the template is the string "#", it means that this insn must be split. */ - if (template[0] == '#' && template[1] == '\0') + if (templ[0] == '#' && templ[1] == '\0') { - rtx new = try_split (body, insn, 0); + rtx new_rtx = try_split (body, insn, 0); /* If we didn't split the insn, go away. */ - if (new == insn && PATTERN (new) == body) + if (new_rtx == insn && PATTERN (new_rtx) == body) fatal_insn ("could not split insn", insn); #ifdef HAVE_ATTR_length @@ -2599,7 +2599,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, gcc_unreachable (); #endif - return new; + return new_rtx; } #ifdef TARGET_UNWIND_INFO @@ -2610,7 +2610,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, #endif /* Output assembler code from the template. */ - output_asm_insn (template, recog_data.operand); + output_asm_insn (templ, recog_data.operand); /* If necessary, report the effect that the instruction has on the unwind info. We've already done this for delay slots @@ -2739,11 +2739,11 @@ alter_subreg (rtx *xp) } else { - rtx new = simplify_subreg (GET_MODE (x), y, GET_MODE (y), + rtx new_rtx = simplify_subreg (GET_MODE (x), y, GET_MODE (y), SUBREG_BYTE (x)); - if (new != 0) - *xp = new; + if (new_rtx != 0) + *xp = new_rtx; else if (REG_P (y)) { /* Simplify_subreg can't handle some REG cases, but we have to. */ @@ -3097,7 +3097,7 @@ output_asm_operand_names (rtx *operands, int *oporder, int nops) of the operand, with no other punctuation. */ void -output_asm_insn (const char *template, rtx *operands) +output_asm_insn (const char *templ, rtx *operands) { const char *p; int c; @@ -3110,11 +3110,11 @@ output_asm_insn (const char *template, rtx *operands) /* An insn may return a null string template in a case where no assembler code is needed. */ - if (*template == 0) + if (*templ == 0) return; memset (opoutput, 0, sizeof opoutput); - p = template; + p = templ; putc ('\t', asm_out_file); #ifdef ASM_OUTPUT_OPCODE diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e36e8089c24..5febef3a63b 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2008-07-17 Tobias Burnus <burnus@net-b.de> + + PR fortran/36825 + PR fortran/36824 + * array.c (gfc_match_array_spec): Fix array-rank check. + * resolve.c (resolve_fl_derived): Fix constentness check + for the array dimensions. + 2008-07-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * Make-lang.in (gfortranspec.o): Fix dependencies. diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index c6bb5e857b9..1f41701ca96 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -437,7 +437,7 @@ gfc_match_array_spec (gfc_array_spec **asp) goto cleanup; } - if (as->rank > 7 + if (as->rank >= 7 && gfc_notify_std (GFC_STD_F2008, "Fortran 2008: Array " "specification at %C with more than 7 dimensions") == FAILURE) diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 273f2ae746b..a1baa9e8d75 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -7682,8 +7682,8 @@ resolve_fl_derived (gfc_symbol *sym) for (i = 0; i < c->as->rank; i++) { if (c->as->lower[i] == NULL - || !gfc_is_constant_expr (c->as->lower[i]) || (resolve_index_expr (c->as->lower[i]) == FAILURE) + || !gfc_is_constant_expr (c->as->lower[i]) || c->as->upper[i] == NULL || (resolve_index_expr (c->as->upper[i]) == FAILURE) || !gfc_is_constant_expr (c->as->upper[i])) diff --git a/gcc/fwprop.c b/gcc/fwprop.c index 6456b0eae02..fbe432974f4 100644 --- a/gcc/fwprop.c +++ b/gcc/fwprop.c @@ -184,26 +184,26 @@ canonicalize_address (rtx x) for a memory access in the given MODE. */ static bool -should_replace_address (rtx old, rtx new, enum machine_mode mode) +should_replace_address (rtx old_rtx, rtx new_rtx, enum machine_mode mode) { int gain; - if (rtx_equal_p (old, new) || !memory_address_p (mode, new)) + if (rtx_equal_p (old_rtx, new_rtx) || !memory_address_p (mode, new_rtx)) return false; /* Copy propagation is always ok. */ - if (REG_P (old) && REG_P (new)) + if (REG_P (old_rtx) && REG_P (new_rtx)) return true; /* Prefer the new address if it is less expensive. */ - gain = address_cost (old, mode) - address_cost (new, mode); + gain = address_cost (old_rtx, mode) - address_cost (new_rtx, mode); /* If the addresses have equivalent cost, prefer the new address if it has the highest `rtx_cost'. That has the potential of eliminating the most insns without additional costs, and it is the same that cse.c used to do. */ if (gain == 0) - gain = rtx_cost (new, SET) - rtx_cost (old, SET); + gain = rtx_cost (new_rtx, SET) - rtx_cost (old_rtx, SET); return (gain > 0); } @@ -244,7 +244,7 @@ enum { that is because there is no simplify_gen_* function for LO_SUM). */ static bool -propagate_rtx_1 (rtx *px, rtx old, rtx new, int flags) +propagate_rtx_1 (rtx *px, rtx old_rtx, rtx new_rtx, int flags) { rtx x = *px, tem = NULL_RTX, op0, op1, op2; enum rtx_code code = GET_CODE (x); @@ -265,9 +265,9 @@ propagate_rtx_1 (rtx *px, rtx old, rtx new, int flags) /* If X is OLD_RTX, return NEW_RTX. But not if replacing only within an address, and we are *not* inside one. */ - if (x == old) + if (x == old_rtx) { - *px = new; + *px = new_rtx; return can_appear; } @@ -277,7 +277,7 @@ propagate_rtx_1 (rtx *px, rtx old, rtx new, int flags) case RTX_UNARY: op0 = XEXP (x, 0); op_mode = GET_MODE (op0); - valid_ops &= propagate_rtx_1 (&op0, old, new, flags); + valid_ops &= propagate_rtx_1 (&op0, old_rtx, new_rtx, flags); if (op0 == XEXP (x, 0)) return true; tem = simplify_gen_unary (code, mode, op0, op_mode); @@ -287,8 +287,8 @@ propagate_rtx_1 (rtx *px, rtx old, rtx new, int flags) case RTX_COMM_ARITH: op0 = XEXP (x, 0); op1 = XEXP (x, 1); - valid_ops &= propagate_rtx_1 (&op0, old, new, flags); - valid_ops &= propagate_rtx_1 (&op1, old, new, flags); + valid_ops &= propagate_rtx_1 (&op0, old_rtx, new_rtx, flags); + valid_ops &= propagate_rtx_1 (&op1, old_rtx, new_rtx, flags); if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1)) return true; tem = simplify_gen_binary (code, mode, op0, op1); @@ -299,8 +299,8 @@ propagate_rtx_1 (rtx *px, rtx old, rtx new, int flags) op0 = XEXP (x, 0); op1 = XEXP (x, 1); op_mode = GET_MODE (op0) != VOIDmode ? GET_MODE (op0) : GET_MODE (op1); - valid_ops &= propagate_rtx_1 (&op0, old, new, flags); - valid_ops &= propagate_rtx_1 (&op1, old, new, flags); + valid_ops &= propagate_rtx_1 (&op0, old_rtx, new_rtx, flags); + valid_ops &= propagate_rtx_1 (&op1, old_rtx, new_rtx, flags); if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1)) return true; tem = simplify_gen_relational (code, mode, op_mode, op0, op1); @@ -312,9 +312,9 @@ propagate_rtx_1 (rtx *px, rtx old, rtx new, int flags) op1 = XEXP (x, 1); op2 = XEXP (x, 2); op_mode = GET_MODE (op0); - valid_ops &= propagate_rtx_1 (&op0, old, new, flags); - valid_ops &= propagate_rtx_1 (&op1, old, new, flags); - valid_ops &= propagate_rtx_1 (&op2, old, new, flags); + valid_ops &= propagate_rtx_1 (&op0, old_rtx, new_rtx, flags); + valid_ops &= propagate_rtx_1 (&op1, old_rtx, new_rtx, flags); + valid_ops &= propagate_rtx_1 (&op2, old_rtx, new_rtx, flags); if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1) && op2 == XEXP (x, 2)) return true; if (op_mode == VOIDmode) @@ -327,7 +327,7 @@ propagate_rtx_1 (rtx *px, rtx old, rtx new, int flags) if (code == SUBREG) { op0 = XEXP (x, 0); - valid_ops &= propagate_rtx_1 (&op0, old, new, flags); + valid_ops &= propagate_rtx_1 (&op0, old_rtx, new_rtx, flags); if (op0 == XEXP (x, 0)) return true; tem = simplify_gen_subreg (mode, op0, GET_MODE (SUBREG_REG (x)), @@ -336,7 +336,7 @@ propagate_rtx_1 (rtx *px, rtx old, rtx new, int flags) break; case RTX_OBJ: - if (code == MEM && x != new) + if (code == MEM && x != new_rtx) { rtx new_op0; op0 = XEXP (x, 0); @@ -346,7 +346,7 @@ propagate_rtx_1 (rtx *px, rtx old, rtx new, int flags) return true; op0 = new_op0 = targetm.delegitimize_address (op0); - valid_ops &= propagate_rtx_1 (&new_op0, old, new, + valid_ops &= propagate_rtx_1 (&new_op0, old_rtx, new_rtx, flags | PR_CAN_APPEAR); /* Dismiss transformation that we do not want to carry on. */ @@ -359,7 +359,7 @@ propagate_rtx_1 (rtx *px, rtx old, rtx new, int flags) canonicalize_address (new_op0); /* Copy propagations are always ok. Otherwise check the costs. */ - if (!(REG_P (old) && REG_P (new)) + if (!(REG_P (old_rtx) && REG_P (new_rtx)) && !should_replace_address (op0, new_op0, GET_MODE (x))) return true; @@ -374,8 +374,8 @@ propagate_rtx_1 (rtx *px, rtx old, rtx new, int flags) /* The only simplification we do attempts to remove references to op0 or make it constant -- in both cases, op0's invalidity will not make the result invalid. */ - propagate_rtx_1 (&op0, old, new, flags | PR_CAN_APPEAR); - valid_ops &= propagate_rtx_1 (&op1, old, new, flags); + propagate_rtx_1 (&op0, old_rtx, new_rtx, flags | PR_CAN_APPEAR); + valid_ops &= propagate_rtx_1 (&op1, old_rtx, new_rtx, flags); if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1)) return true; @@ -393,9 +393,9 @@ propagate_rtx_1 (rtx *px, rtx old, rtx new, int flags) else if (code == REG) { - if (rtx_equal_p (x, old)) + if (rtx_equal_p (x, old_rtx)) { - *px = new; + *px = new_rtx; return can_appear; } } @@ -438,23 +438,23 @@ varying_mem_p (rtx *body, void *data ATTRIBUTE_UNUSED) Otherwise, we accept simplifications that have a lower or equal cost. */ static rtx -propagate_rtx (rtx x, enum machine_mode mode, rtx old, rtx new) +propagate_rtx (rtx x, enum machine_mode mode, rtx old_rtx, rtx new_rtx) { rtx tem; bool collapsed; int flags; - if (REG_P (new) && REGNO (new) < FIRST_PSEUDO_REGISTER) + if (REG_P (new_rtx) && REGNO (new_rtx) < FIRST_PSEUDO_REGISTER) return NULL_RTX; flags = 0; - if (REG_P (new) || CONSTANT_P (new)) + if (REG_P (new_rtx) || CONSTANT_P (new_rtx)) flags |= PR_CAN_APPEAR; - if (!for_each_rtx (&new, varying_mem_p, NULL)) + if (!for_each_rtx (&new_rtx, varying_mem_p, NULL)) flags |= PR_HANDLE_MEM; tem = x; - collapsed = propagate_rtx_1 (&tem, old, copy_rtx (new), flags); + collapsed = propagate_rtx_1 (&tem, old_rtx, copy_rtx (new_rtx), flags); if (tem == x || !collapsed) return NULL_RTX; @@ -527,10 +527,15 @@ use_killed_between (struct df_ref *use, rtx def_insn, rtx target_insn) return true; /* Check if the reg in USE has only one definition. We already - know that this definition reaches use, or we wouldn't be here. */ + know that this definition reaches use, or we wouldn't be here. + However, this is invalid for hard registers because if they are + live at the beginning of the function it does not mean that we + have an uninitialized access. */ regno = DF_REF_REGNO (use); def = DF_REG_DEF_CHAIN (regno); - if (def && (def->next_reg == NULL)) + if (def + && def->next_reg == NULL + && regno >= FIRST_PSEUDO_REGISTER) return false; /* Check locally if we are in the same basic block. */ @@ -717,7 +722,7 @@ update_df (rtx insn, rtx *loc, struct df_ref **use_rec, enum df_ref_type type, performed. */ static bool -try_fwprop_subst (struct df_ref *use, rtx *loc, rtx new, rtx def_insn, bool set_reg_equal) +try_fwprop_subst (struct df_ref *use, rtx *loc, rtx new_rtx, rtx def_insn, bool set_reg_equal) { rtx insn = DF_REF_INSN (use); enum df_ref_type type = DF_REF_TYPE (use); @@ -731,11 +736,11 @@ try_fwprop_subst (struct df_ref *use, rtx *loc, rtx new, rtx def_insn, bool set_ fprintf (dump_file, "\nIn insn %d, replacing\n ", INSN_UID (insn)); print_inline_rtx (dump_file, *loc, 2); fprintf (dump_file, "\n with "); - print_inline_rtx (dump_file, new, 2); + print_inline_rtx (dump_file, new_rtx, 2); fprintf (dump_file, "\n"); } - validate_unshare_change (insn, loc, new, true); + validate_unshare_change (insn, loc, new_rtx, true); if (!verify_changes (0)) { if (dump_file) @@ -766,7 +771,7 @@ try_fwprop_subst (struct df_ref *use, rtx *loc, rtx new, rtx def_insn, bool set_ num_changes++; df_ref_remove (use); - if (!CONSTANT_P (new)) + if (!CONSTANT_P (new_rtx)) { struct df_insn_info *insn_info = DF_INSN_INFO_GET (def_insn); update_df (insn, loc, DF_INSN_INFO_USES (insn_info), type, flags); @@ -784,11 +789,11 @@ try_fwprop_subst (struct df_ref *use, rtx *loc, rtx new, rtx def_insn, bool set_ if (dump_file) fprintf (dump_file, " Setting REG_EQUAL note\n"); - set_unique_reg_note (insn, REG_EQUAL, copy_rtx (new)); + set_unique_reg_note (insn, REG_EQUAL, copy_rtx (new_rtx)); /* ??? Is this still necessary if we add the note through set_unique_reg_note? */ - if (!CONSTANT_P (new)) + if (!CONSTANT_P (new_rtx)) { struct df_insn_info *insn_info = DF_INSN_INFO_GET (def_insn); update_df (insn, loc, DF_INSN_INFO_USES (insn_info), @@ -845,7 +850,7 @@ forward_propagate_and_simplify (struct df_ref *use, rtx def_insn, rtx def_set) { rtx use_insn = DF_REF_INSN (use); rtx use_set = single_set (use_insn); - rtx src, reg, new, *loc; + rtx src, reg, new_rtx, *loc; bool set_reg_equal; enum machine_mode mode; @@ -888,10 +893,10 @@ forward_propagate_and_simplify (struct df_ref *use, rtx def_insn, rtx def_set) if (x != src) { rtx note = find_reg_note (use_insn, REG_EQUAL, NULL_RTX); - rtx old = note ? XEXP (note, 0) : SET_SRC (use_set); - rtx new = simplify_replace_rtx (old, src, x); - if (old != new) - set_unique_reg_note (use_insn, REG_EQUAL, copy_rtx (new)); + rtx old_rtx = note ? XEXP (note, 0) : SET_SRC (use_set); + rtx new_rtx = simplify_replace_rtx (old_rtx, src, x); + if (old_rtx != new_rtx) + set_unique_reg_note (use_insn, REG_EQUAL, copy_rtx (new_rtx)); } return false; } @@ -923,12 +928,12 @@ forward_propagate_and_simplify (struct df_ref *use, rtx def_insn, rtx def_set) else mode = GET_MODE (*loc); - new = propagate_rtx (*loc, mode, reg, src); + new_rtx = propagate_rtx (*loc, mode, reg, src); - if (!new) + if (!new_rtx) return false; - return try_fwprop_subst (use, loc, new, def_insn, set_reg_equal); + return try_fwprop_subst (use, loc, new_rtx, def_insn, set_reg_equal); } diff --git a/gcc/gcse.c b/gcc/gcse.c index 0955744855c..008544f0f64 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -2791,7 +2791,7 @@ find_avail_set (int regno, rtx insn) static int cprop_jump (basic_block bb, rtx setcc, rtx jump, rtx from, rtx src) { - rtx new, set_src, note_src; + rtx new_rtx, set_src, note_src; rtx set = pc_set (jump); rtx note = find_reg_equal_equiv_note (jump); @@ -2823,22 +2823,22 @@ cprop_jump (basic_block bb, rtx setcc, rtx jump, rtx from, rtx src) else setcc = NULL_RTX; - new = simplify_replace_rtx (set_src, from, src); + new_rtx = simplify_replace_rtx (set_src, from, src); /* If no simplification can be made, then try the next register. */ - if (rtx_equal_p (new, SET_SRC (set))) + if (rtx_equal_p (new_rtx, SET_SRC (set))) return 0; /* If this is now a no-op delete it, otherwise this must be a valid insn. */ - if (new == pc_rtx) + if (new_rtx == pc_rtx) delete_insn (jump); else { /* Ensure the value computed inside the jump insn to be equivalent to one computed by setcc. */ - if (setcc && modified_in_p (new, setcc)) + if (setcc && modified_in_p (new_rtx, setcc)) return 0; - if (! validate_unshare_change (jump, &SET_SRC (set), new, 0)) + if (! validate_unshare_change (jump, &SET_SRC (set), new_rtx, 0)) { /* When (some) constants are not valid in a comparison, and there are two registers to be replaced by constants before the entire @@ -2849,8 +2849,8 @@ cprop_jump (basic_block bb, rtx setcc, rtx jump, rtx from, rtx src) we need to attach a note to the branch itself to make this optimization work. */ - if (!rtx_equal_p (new, note_src)) - set_unique_reg_note (jump, REG_EQUAL, copy_rtx (new)); + if (!rtx_equal_p (new_rtx, note_src)) + set_unique_reg_note (jump, REG_EQUAL, copy_rtx (new_rtx)); return 0; } @@ -2881,7 +2881,7 @@ cprop_jump (basic_block bb, rtx setcc, rtx jump, rtx from, rtx src) /* If a conditional jump has been changed into unconditional jump, remove the jump and make the edge fallthru - this is always called in cfglayout mode. */ - if (new != pc_rtx && simplejump_p (jump)) + if (new_rtx != pc_rtx && simplejump_p (jump)) { edge e; edge_iterator ei; @@ -3306,7 +3306,7 @@ find_implicit_sets (void) { basic_block bb, dest; unsigned int count; - rtx cond, new; + rtx cond, new_rtx; count = 0; FOR_EACH_BB (bb) @@ -3327,9 +3327,9 @@ find_implicit_sets (void) if (dest && single_pred_p (dest) && dest != EXIT_BLOCK_PTR) { - new = gen_rtx_SET (VOIDmode, XEXP (cond, 0), + new_rtx = gen_rtx_SET (VOIDmode, XEXP (cond, 0), XEXP (cond, 1)); - implicit_sets[dest->index] = new; + implicit_sets[dest->index] = new_rtx; if (dump_file) { fprintf(dump_file, "Implicit set of reg %d in ", @@ -3539,7 +3539,7 @@ bypass_block (basic_block bb, rtx setcc, rtx jump) unsigned int regno = REGNO (reg_used->reg_rtx); basic_block dest, old_dest; struct expr *set; - rtx src, new; + rtx src, new_rtx; if (regno >= max_gcse_regno) continue; @@ -3560,7 +3560,7 @@ bypass_block (basic_block bb, rtx setcc, rtx jump) SET_DEST (PATTERN (setcc)), SET_SRC (PATTERN (setcc))); - new = simplify_replace_rtx (src, reg_used->reg_rtx, + new_rtx = simplify_replace_rtx (src, reg_used->reg_rtx, SET_SRC (set->expr)); /* Jump bypassing may have already placed instructions on @@ -3568,14 +3568,14 @@ bypass_block (basic_block bb, rtx setcc, rtx jump) has instructions associated with it, as these insns won't get executed if the incoming edge is redirected. */ - if (new == pc_rtx) + if (new_rtx == pc_rtx) { edest = FALLTHRU_EDGE (bb); dest = edest->insns.r ? NULL : edest->dest; } - else if (GET_CODE (new) == LABEL_REF) + else if (GET_CODE (new_rtx) == LABEL_REF) { - dest = BLOCK_FOR_INSN (XEXP (new, 0)); + dest = BLOCK_FOR_INSN (XEXP (new_rtx, 0)); /* Don't bypass edges containing instructions. */ edest = find_edge (bb, dest); if (edest && edest->insns.r) @@ -4336,7 +4336,7 @@ pre_insert_copies (void) static rtx gcse_emit_move_after (rtx src, rtx dest, rtx insn) { - rtx new; + rtx new_rtx; rtx set = single_set (insn), set2; rtx note; rtx eqv; @@ -4344,20 +4344,20 @@ gcse_emit_move_after (rtx src, rtx dest, rtx insn) /* This should never fail since we're creating a reg->reg copy we've verified to be valid. */ - new = emit_insn_after (gen_move_insn (dest, src), insn); + new_rtx = emit_insn_after (gen_move_insn (dest, src), insn); /* Note the equivalence for local CSE pass. */ - set2 = single_set (new); + set2 = single_set (new_rtx); if (!set2 || !rtx_equal_p (SET_DEST (set2), dest)) - return new; + return new_rtx; if ((note = find_reg_equal_equiv_note (insn))) eqv = XEXP (note, 0); else eqv = SET_SRC (set); - set_unique_reg_note (new, REG_EQUAL, copy_insn_1 (eqv)); + set_unique_reg_note (new_rtx, REG_EQUAL, copy_insn_1 (eqv)); - return new; + return new_rtx; } /* Delete redundant computations. @@ -5384,7 +5384,7 @@ update_ld_motion_stores (struct expr * expr) rtx pat = PATTERN (insn); rtx src = SET_SRC (pat); rtx reg = expr->reaching_reg; - rtx copy, new; + rtx copy, new_rtx; /* If we've already copied it, continue. */ if (expr->reaching_reg == src) @@ -5400,8 +5400,8 @@ update_ld_motion_stores (struct expr * expr) } copy = gen_move_insn ( reg, copy_rtx (SET_SRC (pat))); - new = emit_insn_before (copy, insn); - record_one_set (REGNO (reg), new); + new_rtx = emit_insn_before (copy, insn); + record_one_set (REGNO (reg), new_rtx); SET_SRC (pat) = reg; df_insn_rescan (insn); diff --git a/gcc/global.c b/gcc/global.c index 9c22e91f857..c47033e5754 100644 --- a/gcc/global.c +++ b/gcc/global.c @@ -978,7 +978,7 @@ find_reg (int num, HARD_REG_SET losers, int alt_regs_p, int accept_call_clobbere int i, best_reg, pass; HARD_REG_SET used, used1, used2; - enum reg_class class = (alt_regs_p + enum reg_class rclass = (alt_regs_p ? reg_alternate_class (allocno[num].reg) : reg_preferred_class (allocno[num].reg)); enum machine_mode mode = PSEUDO_REGNO_MODE (allocno[num].reg); @@ -995,7 +995,7 @@ find_reg (int num, HARD_REG_SET losers, int alt_regs_p, int accept_call_clobbere if (losers) IOR_HARD_REG_SET (used1, losers); - IOR_COMPL_HARD_REG_SET (used1, reg_class_contents[(int) class]); + IOR_COMPL_HARD_REG_SET (used1, reg_class_contents[(int) rclass]); #ifdef EH_RETURN_DATA_REGNO if (allocno[num].no_eh_reg) diff --git a/gcc/graph.c b/gcc/graph.c index e59adbc3677..643571b6af2 100644 --- a/gcc/graph.c +++ b/gcc/graph.c @@ -165,25 +165,25 @@ darkgrey\n shape: ellipse" : "white", } static void -draw_edge (FILE *fp, int from, int to, int bb_edge, int class) +draw_edge (FILE *fp, int from, int to, int bb_edge, int color_class) { const char * color; switch (graph_dump_format) { case vcg: color = ""; - if (class == 2) + if (color_class == 2) color = "color: red "; else if (bb_edge) color = "color: blue "; - else if (class == 3) + else if (color_class == 3) color = "color: green "; fprintf (fp, "edge: { sourcename: \"%s.%d\" targetname: \"%s.%d\" %s", current_function_name (), from, current_function_name (), to, color); - if (class) - fprintf (fp, "class: %d ", class); + if (color_class) + fprintf (fp, "class: %d ", color_class); fputs ("}\n", fp); break; case no_graph: diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 49cca65fe43..fd98969a355 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,7 @@ +2008-07-15 Jan Hubicka <jh@suse.cz> + + * lang.c (java_init_options): Enable unit-at-a-time by default. + 2008-07-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * Make-lang.in (jvspec.o): Fix dependencies. diff --git a/gcc/java/lang.c b/gcc/java/lang.c index c259da4f484..1d11b4f2e00 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -521,10 +521,6 @@ java_init_options (unsigned int argc ATTRIBUTE_UNUSED, /* Java requires left-to-right evaluation of subexpressions. */ flag_evaluation_order = 1; - /* Unit at a time is disabled for Java because it is considered - too expensive. */ - no_unit_at_a_time_default = 1; - jcf_path_init (); return CL_Java; diff --git a/gcc/lcm.c b/gcc/lcm.c index 6471bb08ebf..c5c2cfc5621 100644 --- a/gcc/lcm.c +++ b/gcc/lcm.c @@ -350,13 +350,13 @@ compute_laterin (struct edge_list *edge_list, sbitmap *earliest, static void compute_insert_delete (struct edge_list *edge_list, sbitmap *antloc, sbitmap *later, sbitmap *laterin, sbitmap *insert, - sbitmap *delete) + sbitmap *del) { int x; basic_block bb; FOR_EACH_BB (bb) - sbitmap_difference (delete[bb->index], antloc[bb->index], + sbitmap_difference (del[bb->index], antloc[bb->index], laterin[bb->index]); for (x = 0; x < NUM_EDGES (edge_list); x++) @@ -377,7 +377,7 @@ compute_insert_delete (struct edge_list *edge_list, sbitmap *antloc, struct edge_list * pre_edge_lcm (int n_exprs, sbitmap *transp, sbitmap *avloc, sbitmap *antloc, sbitmap *kill, - sbitmap **insert, sbitmap **delete) + sbitmap **insert, sbitmap **del) { sbitmap *antin, *antout, *earliest; sbitmap *avin, *avout; @@ -450,8 +450,8 @@ pre_edge_lcm (int n_exprs, sbitmap *transp, sbitmap_vector_free (earliest); *insert = sbitmap_vector_alloc (num_edges, n_exprs); - *delete = sbitmap_vector_alloc (last_basic_block, n_exprs); - compute_insert_delete (edge_list, antloc, later, laterin, *insert, *delete); + *del = sbitmap_vector_alloc (last_basic_block, n_exprs); + compute_insert_delete (edge_list, antloc, later, laterin, *insert, *del); sbitmap_vector_free (laterin); sbitmap_vector_free (later); @@ -460,7 +460,7 @@ pre_edge_lcm (int n_exprs, sbitmap *transp, if (dump_file) { dump_sbitmap_vector (dump_file, "pre_insert_map", "", *insert, num_edges); - dump_sbitmap_vector (dump_file, "pre_delete_map", "", *delete, + dump_sbitmap_vector (dump_file, "pre_delete_map", "", *del, last_basic_block); } #endif @@ -684,13 +684,13 @@ compute_nearerout (struct edge_list *edge_list, sbitmap *farthest, static void compute_rev_insert_delete (struct edge_list *edge_list, sbitmap *st_avloc, sbitmap *nearer, sbitmap *nearerout, - sbitmap *insert, sbitmap *delete) + sbitmap *insert, sbitmap *del) { int x; basic_block bb; FOR_EACH_BB (bb) - sbitmap_difference (delete[bb->index], st_avloc[bb->index], + sbitmap_difference (del[bb->index], st_avloc[bb->index], nearerout[bb->index]); for (x = 0; x < NUM_EDGES (edge_list); x++) @@ -711,7 +711,7 @@ compute_rev_insert_delete (struct edge_list *edge_list, sbitmap *st_avloc, struct edge_list * pre_edge_rev_lcm (int n_exprs, sbitmap *transp, sbitmap *st_avloc, sbitmap *st_antloc, sbitmap *kill, - sbitmap **insert, sbitmap **delete) + sbitmap **insert, sbitmap **del) { sbitmap *st_antin, *st_antout; sbitmap *st_avout, *st_avin, *farthest; @@ -790,9 +790,9 @@ pre_edge_rev_lcm (int n_exprs, sbitmap *transp, sbitmap_vector_free (farthest); *insert = sbitmap_vector_alloc (num_edges, n_exprs); - *delete = sbitmap_vector_alloc (last_basic_block, n_exprs); + *del = sbitmap_vector_alloc (last_basic_block, n_exprs); compute_rev_insert_delete (edge_list, st_avloc, nearer, nearerout, - *insert, *delete); + *insert, *del); sbitmap_vector_free (nearerout); sbitmap_vector_free (nearer); @@ -801,7 +801,7 @@ pre_edge_rev_lcm (int n_exprs, sbitmap *transp, if (dump_file) { dump_sbitmap_vector (dump_file, "pre_insert_map", "", *insert, num_edges); - dump_sbitmap_vector (dump_file, "pre_delete_map", "", *delete, + dump_sbitmap_vector (dump_file, "pre_delete_map", "", *del, last_basic_block); } #endif diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index e1c8e47cdc8..98b67700808 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -1984,11 +1984,11 @@ combine_regs (rtx usedreg, rtx setreg, int may_save_copy, int insn_number, True if REG's reg class either contains or is contained in CLASS. */ static int -reg_meets_class_p (int reg, enum reg_class class) +reg_meets_class_p (int reg, enum reg_class rclass) { - enum reg_class rclass = reg_preferred_class (reg); - return (reg_class_subset_p (rclass, class) - || reg_class_subset_p (class, rclass)); + enum reg_class rclass2 = reg_preferred_class (reg); + return (reg_class_subset_p (rclass2, rclass) + || reg_class_subset_p (rclass, rclass2)); } /* Update the class of QTYNO assuming that REG is being tied to it. */ @@ -2139,7 +2139,7 @@ wipe_dead_reg (rtx reg, int output_p) register is available. If not, return -1. */ static int -find_free_reg (enum reg_class class, enum machine_mode mode, int qtyno, +find_free_reg (enum reg_class rclass, enum machine_mode mode, int qtyno, int accept_call_clobbered, int just_try_suggested, int born_index, int dead_index) { @@ -2171,7 +2171,7 @@ find_free_reg (enum reg_class class, enum machine_mode mode, int qtyno, for (ins = born_index; ins < dead_index; ins++) IOR_HARD_REG_SET (used, regs_live_at[ins]); - IOR_COMPL_HARD_REG_SET (used, reg_class_contents[(int) class]); + IOR_COMPL_HARD_REG_SET (used, reg_class_contents[(int) rclass]); /* Don't use the frame pointer reg in local-alloc even if we may omit the frame pointer, because if we do that and then we @@ -2256,7 +2256,7 @@ find_free_reg (enum reg_class class, enum machine_mode mode, int qtyno, { /* Don't try the copy-suggested regs again. */ qty_phys_num_copy_sugg[qtyno] = 0; - return find_free_reg (class, mode, qtyno, accept_call_clobbered, 1, + return find_free_reg (rclass, mode, qtyno, accept_call_clobbered, 1, born_index, dead_index); } @@ -2274,7 +2274,7 @@ find_free_reg (enum reg_class class, enum machine_mode mode, int qtyno, optimize_size ? qty[qtyno].n_calls_crossed : qty[qtyno].freq_calls_crossed)) { - i = find_free_reg (class, mode, qtyno, 1, 0, born_index, dead_index); + i = find_free_reg (rclass, mode, qtyno, 1, 0, born_index, dead_index); if (i >= 0) caller_save_needed = 1; return i; diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c index 57205b51e61..fd3b7fe971f 100644 --- a/gcc/lower-subreg.c +++ b/gcc/lower-subreg.c @@ -577,7 +577,7 @@ resolve_reg_notes (rtx insn) pnote = ®_NOTES (insn); while (*pnote != NULL_RTX) { - bool delete = false; + bool del = false; note = *pnote; switch (REG_NOTE_KIND (note)) @@ -585,14 +585,14 @@ resolve_reg_notes (rtx insn) case REG_DEAD: case REG_UNUSED: if (resolve_reg_p (XEXP (note, 0))) - delete = true; + del = true; break; default: break; } - if (delete) + if (del) *pnote = XEXP (note, 1); else pnote = &XEXP (note, 1); diff --git a/gcc/mode-switching.c b/gcc/mode-switching.c index 23269b815dd..e6fd61d4fda 100644 --- a/gcc/mode-switching.c +++ b/gcc/mode-switching.c @@ -585,7 +585,7 @@ optimize_mode_switching (void) for (i = 0; i < max_num_modes; i++) { int current_mode[N_ENTITIES]; - sbitmap *delete; + sbitmap *del; sbitmap *insert; /* Set the anticipatable and computing arrays. */ @@ -612,7 +612,7 @@ optimize_mode_switching (void) FOR_EACH_BB (bb) sbitmap_not (kill[bb->index], transp[bb->index]); edge_list = pre_edge_lcm (n_entities, transp, comp, antic, - kill, &insert, &delete); + kill, &insert, &del); for (j = n_entities - 1; j >= 0; j--) { @@ -663,7 +663,7 @@ optimize_mode_switching (void) } FOR_EACH_BB_REVERSE (bb) - if (TEST_BIT (delete[bb->index], j)) + if (TEST_BIT (del[bb->index], j)) { make_preds_opaque (bb, j); /* Cancel the 'deleted' mode set. */ @@ -671,7 +671,7 @@ optimize_mode_switching (void) } } - sbitmap_vector_free (delete); + sbitmap_vector_free (del); sbitmap_vector_free (insert); clear_aux_for_edges (); free_edge_list (edge_list); diff --git a/gcc/optabs.c b/gcc/optabs.c index 6e8c6cf3d21..ee5bec11a41 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -1571,14 +1571,14 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, enum optab_methods next_methods = (methods == OPTAB_LIB || methods == OPTAB_LIB_WIDEN ? OPTAB_WIDEN : methods); - enum mode_class class; + enum mode_class mclass; enum machine_mode wider_mode; rtx libfunc; rtx temp; rtx entry_last = get_last_insn (); rtx last; - class = GET_MODE_CLASS (mode); + mclass = GET_MODE_CLASS (mode); /* If subtracting an integer constant, convert this into an addition of the negated constant. */ @@ -1609,7 +1609,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, && optab_handler (rotr_optab, mode)->insn_code != CODE_FOR_nothing) || (binoptab == rotr_optab && optab_handler (rotl_optab, mode)->insn_code != CODE_FOR_nothing)) - && class == MODE_INT) + && mclass == MODE_INT) { optab otheroptab = (binoptab == rotl_optab ? rotr_optab : rotl_optab); rtx newop1; @@ -1658,7 +1658,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, can open-code the operation. Check for a widening multiply at the wider mode as well. */ - if (CLASS_HAS_WIDER_MODES_P (class) + if (CLASS_HAS_WIDER_MODES_P (mclass) && methods != OPTAB_DIRECT && methods != OPTAB_LIB) for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode; @@ -1683,7 +1683,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, || binoptab == xor_optab || binoptab == add_optab || binoptab == sub_optab || binoptab == smul_optab || binoptab == ashl_optab) - && class == MODE_INT) + && mclass == MODE_INT) { no_extend = 1; xop0 = avoid_expensive_constant (mode, binoptab, @@ -1703,7 +1703,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, unsignedp, OPTAB_DIRECT); if (temp) { - if (class != MODE_INT + if (mclass != MODE_INT || !TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode), GET_MODE_BITSIZE (wider_mode))) { @@ -1734,7 +1734,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, /* These can be done a word at a time. */ if ((binoptab == and_optab || binoptab == ior_optab || binoptab == xor_optab) - && class == MODE_INT + && mclass == MODE_INT && GET_MODE_SIZE (mode) > UNITS_PER_WORD && optab_handler (binoptab, word_mode)->insn_code != CODE_FOR_nothing) { @@ -1785,7 +1785,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, /* Synthesize double word shifts from single word shifts. */ if ((binoptab == lshr_optab || binoptab == ashl_optab || binoptab == ashr_optab) - && class == MODE_INT + && mclass == MODE_INT && (GET_CODE (op1) == CONST_INT || !optimize_size) && GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD && optab_handler (binoptab, word_mode)->insn_code != CODE_FOR_nothing @@ -1855,7 +1855,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, /* Synthesize double word rotates from single word shifts. */ if ((binoptab == rotl_optab || binoptab == rotr_optab) - && class == MODE_INT + && mclass == MODE_INT && GET_CODE (op1) == CONST_INT && GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD && optab_handler (ashl_optab, word_mode)->insn_code != CODE_FOR_nothing @@ -1968,7 +1968,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, /* These can be done a word at a time by propagating carries. */ if ((binoptab == add_optab || binoptab == sub_optab) - && class == MODE_INT + && mclass == MODE_INT && GET_MODE_SIZE (mode) >= 2 * UNITS_PER_WORD && optab_handler (binoptab, word_mode)->insn_code != CODE_FOR_nothing) { @@ -2094,7 +2094,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, try using a signed widening multiply. */ if (binoptab == smul_optab - && class == MODE_INT + && mclass == MODE_INT && GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD && optab_handler (smul_optab, word_mode)->insn_code != CODE_FOR_nothing && optab_handler (add_optab, word_mode)->insn_code != CODE_FOR_nothing) @@ -2197,7 +2197,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, /* Look for a wider mode of the same class for which it appears we can do the operation. */ - if (CLASS_HAS_WIDER_MODES_P (class)) + if (CLASS_HAS_WIDER_MODES_P (mclass)) { for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode; @@ -2219,7 +2219,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, || binoptab == xor_optab || binoptab == add_optab || binoptab == sub_optab || binoptab == smul_optab || binoptab == ashl_optab) - && class == MODE_INT) + && mclass == MODE_INT) no_extend = 1; xop0 = widen_operand (xop0, wider_mode, mode, @@ -2233,7 +2233,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, unsignedp, methods); if (temp) { - if (class != MODE_INT + if (mclass != MODE_INT || !TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode), GET_MODE_BITSIZE (wider_mode))) { @@ -2327,12 +2327,12 @@ expand_twoval_unop (optab unoptab, rtx op0, rtx targ0, rtx targ1, int unsignedp) { enum machine_mode mode = GET_MODE (targ0 ? targ0 : targ1); - enum mode_class class; + enum mode_class mclass; enum machine_mode wider_mode; rtx entry_last = get_last_insn (); rtx last; - class = GET_MODE_CLASS (mode); + mclass = GET_MODE_CLASS (mode); if (!targ0) targ0 = gen_reg_rtx (mode); @@ -2374,7 +2374,7 @@ expand_twoval_unop (optab unoptab, rtx op0, rtx targ0, rtx targ1, /* It can't be done in this mode. Can we do it in a wider mode? */ - if (CLASS_HAS_WIDER_MODES_P (class)) + if (CLASS_HAS_WIDER_MODES_P (mclass)) { for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode; @@ -2420,12 +2420,12 @@ expand_twoval_binop (optab binoptab, rtx op0, rtx op1, rtx targ0, rtx targ1, int unsignedp) { enum machine_mode mode = GET_MODE (targ0 ? targ0 : targ1); - enum mode_class class; + enum mode_class mclass; enum machine_mode wider_mode; rtx entry_last = get_last_insn (); rtx last; - class = GET_MODE_CLASS (mode); + mclass = GET_MODE_CLASS (mode); if (!targ0) targ0 = gen_reg_rtx (mode); @@ -2491,7 +2491,7 @@ expand_twoval_binop (optab binoptab, rtx op0, rtx op1, rtx targ0, rtx targ1, /* It can't be done in this mode. Can we do it in a wider mode? */ - if (CLASS_HAS_WIDER_MODES_P (class)) + if (CLASS_HAS_WIDER_MODES_P (mclass)) { for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode; @@ -2591,8 +2591,8 @@ expand_simple_unop (enum machine_mode mode, enum rtx_code code, rtx op0, static rtx widen_clz (enum machine_mode mode, rtx op0, rtx target) { - enum mode_class class = GET_MODE_CLASS (mode); - if (CLASS_HAS_WIDER_MODES_P (class)) + enum mode_class mclass = GET_MODE_CLASS (mode); + if (CLASS_HAS_WIDER_MODES_P (mclass)) { enum machine_mode wider_mode; for (wider_mode = GET_MODE_WIDER_MODE (mode); @@ -2702,11 +2702,11 @@ expand_doubleword_clz (enum machine_mode mode, rtx op0, rtx target) static rtx widen_bswap (enum machine_mode mode, rtx op0, rtx target) { - enum mode_class class = GET_MODE_CLASS (mode); + enum mode_class mclass = GET_MODE_CLASS (mode); enum machine_mode wider_mode; rtx x, last; - if (!CLASS_HAS_WIDER_MODES_P (class)) + if (!CLASS_HAS_WIDER_MODES_P (mclass)) return NULL_RTX; for (wider_mode = GET_MODE_WIDER_MODE (mode); @@ -2767,8 +2767,8 @@ expand_doubleword_bswap (enum machine_mode mode, rtx op, rtx target) static rtx expand_parity (enum machine_mode mode, rtx op0, rtx target) { - enum mode_class class = GET_MODE_CLASS (mode); - if (CLASS_HAS_WIDER_MODES_P (class)) + enum mode_class mclass = GET_MODE_CLASS (mode); + if (CLASS_HAS_WIDER_MODES_P (mclass)) { enum machine_mode wider_mode; for (wider_mode = mode; wider_mode != VOIDmode; @@ -3116,7 +3116,7 @@ rtx expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target, int unsignedp) { - enum mode_class class = GET_MODE_CLASS (mode); + enum mode_class mclass = GET_MODE_CLASS (mode); enum machine_mode wider_mode; rtx temp; rtx libfunc; @@ -3163,7 +3163,7 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target, goto try_libcall; } - if (CLASS_HAS_WIDER_MODES_P (class)) + if (CLASS_HAS_WIDER_MODES_P (mclass)) for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode; wider_mode = GET_MODE_WIDER_MODE (wider_mode)) @@ -3180,14 +3180,14 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target, xop0 = widen_operand (xop0, wider_mode, mode, unsignedp, (unoptab == neg_optab || unoptab == one_cmpl_optab) - && class == MODE_INT); + && mclass == MODE_INT); temp = expand_unop (wider_mode, unoptab, xop0, NULL_RTX, unsignedp); if (temp) { - if (class != MODE_INT + if (mclass != MODE_INT || !TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode), GET_MODE_BITSIZE (wider_mode))) { @@ -3206,7 +3206,7 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target, /* These can be done a word at a time. */ if (unoptab == one_cmpl_optab - && class == MODE_INT + && mclass == MODE_INT && GET_MODE_SIZE (mode) > UNITS_PER_WORD && optab_handler (unoptab, word_mode)->insn_code != CODE_FOR_nothing) { @@ -3323,7 +3323,7 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target, /* It can't be done in this mode. Can we do it in a wider mode? */ - if (CLASS_HAS_WIDER_MODES_P (class)) + if (CLASS_HAS_WIDER_MODES_P (mclass)) { for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode; @@ -3343,7 +3343,7 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target, xop0 = widen_operand (xop0, wider_mode, mode, unsignedp, (unoptab == neg_optab || unoptab == one_cmpl_optab) - && class == MODE_INT); + && mclass == MODE_INT); temp = expand_unop (wider_mode, unoptab, xop0, NULL_RTX, unsignedp); @@ -3358,7 +3358,7 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target, if (temp) { - if (class != MODE_INT) + if (mclass != MODE_INT) { if (target == 0) target = gen_reg_rtx (mode); @@ -4191,7 +4191,7 @@ emit_cmp_and_jump_insn_1 (rtx x, rtx y, enum machine_mode mode, enum rtx_code comparison, int unsignedp, rtx label) { rtx test = gen_rtx_fmt_ee (comparison, mode, x, y); - enum mode_class class = GET_MODE_CLASS (mode); + enum mode_class mclass = GET_MODE_CLASS (mode); enum machine_mode wider_mode = mode; /* Try combined insns first. */ @@ -4238,7 +4238,7 @@ emit_cmp_and_jump_insn_1 (rtx x, rtx y, enum machine_mode mode, return; } - if (!CLASS_HAS_WIDER_MODES_P (class)) + if (!CLASS_HAS_WIDER_MODES_P (mclass)) break; wider_mode = GET_MODE_WIDER_MODE (wider_mode); diff --git a/gcc/postreload.c b/gcc/postreload.c index dcac71ba4d9..5f6fec1e953 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -518,7 +518,7 @@ reload_cse_simplify_operands (rtx insn, rtx testreg) for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) { - int class = (int) NO_REGS; + int rclass = (int) NO_REGS; if (! TEST_HARD_REG_BIT (equiv_regs[i], regno)) continue; @@ -552,13 +552,13 @@ reload_cse_simplify_operands (rtx insn, rtx testreg) break; case 'g': case 'r': - class = reg_class_subunion[(int) class][(int) GENERAL_REGS]; + rclass = reg_class_subunion[(int) rclass][(int) GENERAL_REGS]; break; default: - class + rclass = (reg_class_subunion - [(int) class] + [(int) rclass] [(int) REG_CLASS_FROM_CONSTRAINT ((unsigned char) c, p)]); break; @@ -568,7 +568,7 @@ reload_cse_simplify_operands (rtx insn, rtx testreg) alternative yet and the operand being replaced is not a cheap CONST_INT. */ if (op_alt_regno[i][j] == -1 - && reg_fits_class_p (testreg, class, 0, mode) + && reg_fits_class_p (testreg, rclass, 0, mode) && (GET_CODE (recog_data.operand[i]) != CONST_INT || (rtx_cost (recog_data.operand[i], SET) > rtx_cost (testreg, SET)))) @@ -577,7 +577,7 @@ reload_cse_simplify_operands (rtx insn, rtx testreg) op_alt_regno[i][j] = regno; } j++; - class = (int) NO_REGS; + rclass = (int) NO_REGS; break; } p += CONSTRAINT_LEN (c, p); @@ -144,10 +144,10 @@ add_neighbor (int alloc_no, int neighbor) if (adjlist == NULL || adjlist->index == ADJACENCY_VEC_LENGTH) { - adjacency_t *new = (adjacency_t *) pool_alloc (adjacency_pool); - new->index = 0; - new->next = adjlist; - adjlist = new; + adjacency_t *new_adj = (adjacency_t *) pool_alloc (adjacency_pool); + new_adj->index = 0; + new_adj->next = adjlist; + adjlist = new_adj; adjacency[alloc_no] = adjlist; } diff --git a/gcc/recog.c b/gcc/recog.c index 73d57647877..6d8b7eaec74 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -183,7 +183,7 @@ static int changes_allocated; static int num_changes = 0; /* Validate a proposed change to OBJECT. LOC is the location in the rtl - at which NEW will be placed. If OBJECT is zero, no validation is done, + at which NEW_RTX will be placed. If OBJECT is zero, no validation is done, the change is simply made. Two types of objects are supported: If OBJECT is a MEM, memory_address_p @@ -201,16 +201,16 @@ static int num_changes = 0; Otherwise, perform the change and return 1. */ static bool -validate_change_1 (rtx object, rtx *loc, rtx new, bool in_group, bool unshare) +validate_change_1 (rtx object, rtx *loc, rtx new_rtx, bool in_group, bool unshare) { rtx old = *loc; - if (old == new || rtx_equal_p (old, new)) + if (old == new_rtx || rtx_equal_p (old, new_rtx)) return 1; gcc_assert (in_group != 0 || num_changes == 0); - *loc = new; + *loc = new_rtx; /* Save the information describing this change. */ if (num_changes >= changes_allocated) @@ -253,18 +253,18 @@ validate_change_1 (rtx object, rtx *loc, rtx new, bool in_group, bool unshare) UNSHARE to false. */ bool -validate_change (rtx object, rtx *loc, rtx new, bool in_group) +validate_change (rtx object, rtx *loc, rtx new_rtx, bool in_group) { - return validate_change_1 (object, loc, new, in_group, false); + return validate_change_1 (object, loc, new_rtx, in_group, false); } /* Wrapper for validate_change_1 without the UNSHARE argument defaulting UNSHARE to true. */ bool -validate_unshare_change (rtx object, rtx *loc, rtx new, bool in_group) +validate_unshare_change (rtx object, rtx *loc, rtx new_rtx, bool in_group) { - return validate_change_1 (object, loc, new, in_group, true); + return validate_change_1 (object, loc, new_rtx, in_group, true); } @@ -525,7 +525,7 @@ validate_replace_rtx_1 (rtx *loc, rtx from, rtx to, rtx object) enum rtx_code code; enum machine_mode op0_mode = VOIDmode; int prev_changes = num_changes; - rtx new; + rtx new_rtx; if (!x) return; @@ -633,25 +633,25 @@ validate_replace_rtx_1 (rtx *loc, rtx from, rtx to, rtx object) case SIGN_EXTEND: if (GET_MODE (XEXP (x, 0)) == VOIDmode) { - new = simplify_gen_unary (code, GET_MODE (x), XEXP (x, 0), + new_rtx = simplify_gen_unary (code, GET_MODE (x), XEXP (x, 0), op0_mode); /* If any of the above failed, substitute in something that we know won't be recognized. */ - if (!new) - new = gen_rtx_CLOBBER (GET_MODE (x), const0_rtx); - validate_change (object, loc, new, 1); + if (!new_rtx) + new_rtx = gen_rtx_CLOBBER (GET_MODE (x), const0_rtx); + validate_change (object, loc, new_rtx, 1); } break; case SUBREG: /* All subregs possible to simplify should be simplified. */ - new = simplify_subreg (GET_MODE (x), SUBREG_REG (x), op0_mode, + new_rtx = simplify_subreg (GET_MODE (x), SUBREG_REG (x), op0_mode, SUBREG_BYTE (x)); /* Subregs of VOIDmode operands are incorrect. */ - if (!new && GET_MODE (SUBREG_REG (x)) == VOIDmode) - new = gen_rtx_CLOBBER (GET_MODE (x), const0_rtx); - if (new) - validate_change (object, loc, new, 1); + if (!new_rtx && GET_MODE (SUBREG_REG (x)) == VOIDmode) + new_rtx = gen_rtx_CLOBBER (GET_MODE (x), const0_rtx); + if (new_rtx) + validate_change (object, loc, new_rtx, 1); break; case ZERO_EXTRACT: case SIGN_EXTRACT: @@ -2200,7 +2200,7 @@ preprocess_constraints (void) struct funny_match { - int this, other; + int this_op, other; }; int @@ -2350,7 +2350,7 @@ constrain_operands (int strict) output op is the one that will be printed. */ if (val == 2 && strict > 0) { - funny_match[funny_match_index].this = opno; + funny_match[funny_match_index].this_op = opno; funny_match[funny_match_index++].other = match; } } @@ -2583,7 +2583,7 @@ constrain_operands (int strict) while (--funny_match_index >= 0) { recog_data.operand[funny_match[funny_match_index].other] - = recog_data.operand[funny_match[funny_match_index].this]; + = recog_data.operand[funny_match[funny_match_index].this_op]; } return 1; @@ -2987,7 +2987,7 @@ peephole2_optimize (void) prev = PREV_INSN (insn); if (INSN_P (insn)) { - rtx try, before_try, x; + rtx attempt, before_try, x; int match_len; rtx note; bool was_call = false; @@ -3008,13 +3008,13 @@ peephole2_optimize (void) substitution would lose the REG_FRAME_RELATED_EXPR that is attached. */ peep2_current_count = 0; - try = NULL; + attempt = NULL; } else /* Match the peephole. */ - try = peephole2_insns (PATTERN (insn), insn, &match_len); + attempt = peephole2_insns (PATTERN (insn), insn, &match_len); - if (try != NULL) + if (attempt != NULL) { /* If we are splitting a CALL_INSN, look for the CALL_INSN in SEQ and copy our CALL_INSN_FUNCTION_USAGE and other @@ -3032,7 +3032,7 @@ peephole2_optimize (void) continue; was_call = true; - new_insn = try; + new_insn = attempt; while (new_insn != NULL_RTX) { if (CALL_P (new_insn)) @@ -3080,8 +3080,9 @@ peephole2_optimize (void) REG_EH_REGION, NULL_RTX); /* Replace the old sequence with the new. */ - try = emit_insn_after_setloc (try, peep2_insn_data[i].insn, - INSN_LOCATOR (peep2_insn_data[i].insn)); + attempt = emit_insn_after_setloc (attempt, + peep2_insn_data[i].insn, + INSN_LOCATOR (peep2_insn_data[i].insn)); before_try = PREV_INSN (insn); delete_insn_chain (insn, peep2_insn_data[i].insn, false); @@ -3095,7 +3096,7 @@ peephole2_optimize (void) if (eh_edge->flags & (EDGE_EH | EDGE_ABNORMAL_CALL)) break; - for (x = try ; x != before_try ; x = PREV_INSN (x)) + for (x = attempt ; x != before_try ; x = PREV_INSN (x)) if (CALL_P (x) || (flag_non_call_exceptions && may_trap_p (PATTERN (x)) @@ -3145,7 +3146,7 @@ peephole2_optimize (void) bitmap_copy (live, peep2_insn_data[i].live_before); /* Update life information for the new sequence. */ - x = try; + x = attempt; do { if (INSN_P (x)) @@ -3169,7 +3170,7 @@ peephole2_optimize (void) /* If we generated a jump instruction, it won't have JUMP_LABEL set. Recompute after we're done. */ - for (x = try; x != before_try; x = PREV_INSN (x)) + for (x = attempt; x != before_try; x = PREV_INSN (x)) if (JUMP_P (x)) { do_rebuild_jump_labels = true; diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index 4b5e422e207..eb31bc835cf 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -713,18 +713,18 @@ replace_reg (rtx *reg, int regno) static void remove_regno_note (rtx insn, enum reg_note note, unsigned int regno) { - rtx *note_link, this; + rtx *note_link, this_rtx; note_link = ®_NOTES (insn); - for (this = *note_link; this; this = XEXP (this, 1)) - if (REG_NOTE_KIND (this) == note - && REG_P (XEXP (this, 0)) && REGNO (XEXP (this, 0)) == regno) + for (this_rtx = *note_link; this_rtx; this_rtx = XEXP (this_rtx, 1)) + if (REG_NOTE_KIND (this_rtx) == note + && REG_P (XEXP (this_rtx, 0)) && REGNO (XEXP (this_rtx, 0)) == regno) { - *note_link = XEXP (this, 1); + *note_link = XEXP (this_rtx, 1); return; } else - note_link = &XEXP (this, 1); + note_link = &XEXP (this_rtx, 1); gcc_unreachable (); } @@ -2355,7 +2355,7 @@ subst_stack_regs (rtx insn, stack regstack) is no longer needed once this has executed. */ static void -change_stack (rtx insn, stack old, stack new, enum emit_where where) +change_stack (rtx insn, stack old, stack new_stack, enum emit_where where) { int reg; int update_end = 0; @@ -2368,9 +2368,9 @@ change_stack (rtx insn, stack old, stack new, enum emit_where where) && starting_stack_p && where == EMIT_BEFORE) { - BLOCK_INFO (current_block)->stack_in = *new; + BLOCK_INFO (current_block)->stack_in = *new_stack; starting_stack_p = false; - *old = *new; + *old = *new_stack; return; } @@ -2386,7 +2386,7 @@ change_stack (rtx insn, stack old, stack new, enum emit_where where) /* Initialize partially dead variables. */ for (i = FIRST_STACK_REG; i < LAST_STACK_REG + 1; i++) - if (TEST_HARD_REG_BIT (new->reg_set, i) + if (TEST_HARD_REG_BIT (new_stack->reg_set, i) && !TEST_HARD_REG_BIT (old->reg_set, i)) { old->reg[++old->top] = i; @@ -2400,28 +2400,28 @@ change_stack (rtx insn, stack old, stack new, enum emit_where where) /* If the destination block's stack already has a specified layout and contains two or more registers, use a more intelligent algorithm to pop registers that minimizes the number number of fxchs below. */ - if (new->top > 0) + if (new_stack->top > 0) { bool slots[REG_STACK_SIZE]; int pops[REG_STACK_SIZE]; int next, dest, topsrc; /* First pass to determine the free slots. */ - for (reg = 0; reg <= new->top; reg++) - slots[reg] = TEST_HARD_REG_BIT (new->reg_set, old->reg[reg]); + for (reg = 0; reg <= new_stack->top; reg++) + slots[reg] = TEST_HARD_REG_BIT (new_stack->reg_set, old->reg[reg]); /* Second pass to allocate preferred slots. */ topsrc = -1; - for (reg = old->top; reg > new->top; reg--) - if (TEST_HARD_REG_BIT (new->reg_set, old->reg[reg])) + for (reg = old->top; reg > new_stack->top; reg--) + if (TEST_HARD_REG_BIT (new_stack->reg_set, old->reg[reg])) { dest = -1; - for (next = 0; next <= new->top; next++) - if (!slots[next] && new->reg[next] == old->reg[reg]) + for (next = 0; next <= new_stack->top; next++) + if (!slots[next] && new_stack->reg[next] == old->reg[reg]) { /* If this is a preference for the new top of stack, record the fact by remembering it's old->reg in topsrc. */ - if (next == new->top) + if (next == new_stack->top) topsrc = reg; slots[next] = true; dest = next; @@ -2438,18 +2438,18 @@ change_stack (rtx insn, stack old, stack new, enum emit_where where) slot is still unallocated, in which case we should place the top of stack there. */ if (topsrc != -1) - for (reg = 0; reg < new->top; reg++) + for (reg = 0; reg < new_stack->top; reg++) if (!slots[reg]) { pops[topsrc] = reg; - slots[new->top] = false; + slots[new_stack->top] = false; slots[reg] = true; break; } /* Third pass allocates remaining slots and emits pop insns. */ - next = new->top; - for (reg = old->top; reg > new->top; reg--) + next = new_stack->top; + for (reg = old->top; reg > new_stack->top; reg--) { dest = pops[reg]; if (dest == -1) @@ -2472,14 +2472,14 @@ change_stack (rtx insn, stack old, stack new, enum emit_where where) live = 0; for (reg = 0; reg <= old->top; reg++) - if (TEST_HARD_REG_BIT (new->reg_set, old->reg[reg])) + if (TEST_HARD_REG_BIT (new_stack->reg_set, old->reg[reg])) live++; next = live; while (old->top >= live) - if (TEST_HARD_REG_BIT (new->reg_set, old->reg[old->top])) + if (TEST_HARD_REG_BIT (new_stack->reg_set, old->reg[old->top])) { - while (TEST_HARD_REG_BIT (new->reg_set, old->reg[next])) + while (TEST_HARD_REG_BIT (new_stack->reg_set, old->reg[next])) next--; emit_pop_insn (insn, old, FP_MODE_REG (old->reg[next], DFmode), EMIT_BEFORE); @@ -2489,13 +2489,13 @@ change_stack (rtx insn, stack old, stack new, enum emit_where where) EMIT_BEFORE); } - if (new->top == -2) + if (new_stack->top == -2) { /* If the new block has never been processed, then it can inherit the old stack order. */ - new->top = old->top; - memcpy (new->reg, old->reg, sizeof (new->reg)); + new_stack->top = old->top; + memcpy (new_stack->reg, old->reg, sizeof (new_stack->reg)); } else { @@ -2505,10 +2505,10 @@ change_stack (rtx insn, stack old, stack new, enum emit_where where) /* By now, the only difference should be the order of the stack, not their depth or liveliness. */ - gcc_assert (hard_reg_set_equal_p (old->reg_set, new->reg_set)); - gcc_assert (old->top == new->top); + gcc_assert (hard_reg_set_equal_p (old->reg_set, new_stack->reg_set)); + gcc_assert (old->top == new_stack->top); - /* If the stack is not empty (new->top != -1), loop here emitting + /* If the stack is not empty (new_stack->top != -1), loop here emitting swaps until the stack is correct. The worst case number of swaps emitted is N + 2, where N is the @@ -2517,16 +2517,16 @@ change_stack (rtx insn, stack old, stack new, enum emit_where where) other regs. But since we never swap any other reg away from its correct slot, this algorithm will converge. */ - if (new->top != -1) + if (new_stack->top != -1) do { /* Swap the reg at top of stack into the position it is supposed to be in, until the correct top of stack appears. */ - while (old->reg[old->top] != new->reg[new->top]) + while (old->reg[old->top] != new_stack->reg[new_stack->top]) { - for (reg = new->top; reg >= 0; reg--) - if (new->reg[reg] == old->reg[old->top]) + for (reg = new_stack->top; reg >= 0; reg--) + if (new_stack->reg[reg] == old->reg[old->top]) break; gcc_assert (reg != -1); @@ -2539,8 +2539,8 @@ change_stack (rtx insn, stack old, stack new, enum emit_where where) incorrect reg to the top of stack, and let the while loop above fix it. */ - for (reg = new->top; reg >= 0; reg--) - if (new->reg[reg] != old->reg[reg]) + for (reg = new_stack->top; reg >= 0; reg--) + if (new_stack->reg[reg] != old->reg[reg]) { emit_swap_insn (insn, old, FP_MODE_REG (old->reg[reg], DFmode)); @@ -2551,7 +2551,7 @@ change_stack (rtx insn, stack old, stack new, enum emit_where where) /* At this point there must be no differences. */ for (reg = old->top; reg >= 0; reg--) - gcc_assert (old->reg[reg] == new->reg[reg]); + gcc_assert (old->reg[reg] == new_stack->reg[reg]); } if (update_end) diff --git a/gcc/regclass.c b/gcc/regclass.c index dab3377976c..386214dbe0d 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -738,7 +738,7 @@ init_fake_stack_mems (void) Only needed if secondary reloads are required for memory moves. */ int -memory_move_secondary_cost (enum machine_mode mode, enum reg_class class, int in) +memory_move_secondary_cost (enum machine_mode mode, enum reg_class rclass, int in) { enum reg_class altclass; int partial_cost = 0; @@ -747,17 +747,17 @@ memory_move_secondary_cost (enum machine_mode mode, enum reg_class class, int in rtx mem ATTRIBUTE_UNUSED = top_of_stack[(int) mode]; - altclass = secondary_reload_class (in ? 1 : 0, class, mode, mem); + altclass = secondary_reload_class (in ? 1 : 0, rclass, mode, mem); if (altclass == NO_REGS) return 0; if (in) - partial_cost = REGISTER_MOVE_COST (mode, altclass, class); + partial_cost = REGISTER_MOVE_COST (mode, altclass, rclass); else - partial_cost = REGISTER_MOVE_COST (mode, class, altclass); + partial_cost = REGISTER_MOVE_COST (mode, rclass, altclass); - if (class == altclass) + if (rclass == altclass) /* This isn't simply a copy-to-temporary situation. Can't guess what it is, so MEMORY_MOVE_COST really ought not to be calling here in that case. @@ -1087,23 +1087,23 @@ dump_regclass (FILE *dump) int i; for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++) { - int /* enum reg_class */ class; + int /* enum reg_class */ rclass; if (REG_N_REFS (i)) { fprintf (dump, " Register %i costs:", i); - for (class = 0; class < (int) N_REG_CLASSES; class++) - if (contains_reg_of_mode [(enum reg_class) class][PSEUDO_REGNO_MODE (i)] + for (rclass = 0; rclass < (int) N_REG_CLASSES; rclass++) + if (contains_reg_of_mode [(enum reg_class) rclass][PSEUDO_REGNO_MODE (i)] #ifdef FORBIDDEN_INC_DEC_CLASSES && (!in_inc_dec[i] - || !forbidden_inc_dec_class[(enum reg_class) class]) + || !forbidden_inc_dec_class[(enum reg_class) rclass]) #endif #ifdef CANNOT_CHANGE_MODE_CLASS - && ! invalid_mode_change_p (i, (enum reg_class) class, + && ! invalid_mode_change_p (i, (enum reg_class) rclass, PSEUDO_REGNO_MODE (i)) #endif ) - fprintf (dump, " %s:%i", reg_class_names[class], - costs[i].cost[(enum reg_class) class]); + fprintf (dump, " %s:%i", reg_class_names[rclass], + costs[i].cost[(enum reg_class) rclass]); fprintf (dump, " MEM:%i\n", costs[i].mem_cost); } } @@ -1382,7 +1382,7 @@ regclass (rtx f, int nregs) enum reg_class best = ALL_REGS, alt = NO_REGS; /* This is an enum reg_class, but we call it an int to save lots of casts. */ - int class; + int rclass; struct costs *p = &costs[i]; if (regno_reg_rtx[i] == NULL) @@ -1393,27 +1393,27 @@ regclass (rtx f, int nregs) if (optimize && !REG_N_REFS (i) && !REG_N_SETS (i)) continue; - for (class = (int) ALL_REGS - 1; class > 0; class--) + for (rclass = (int) ALL_REGS - 1; rclass > 0; rclass--) { /* Ignore classes that are too small for this operand or invalid for an operand that was auto-incremented. */ - if (!contains_reg_of_mode [class][PSEUDO_REGNO_MODE (i)] + if (!contains_reg_of_mode [rclass][PSEUDO_REGNO_MODE (i)] #ifdef FORBIDDEN_INC_DEC_CLASSES - || (in_inc_dec[i] && forbidden_inc_dec_class[class]) + || (in_inc_dec[i] && forbidden_inc_dec_class[rclass]) #endif #ifdef CANNOT_CHANGE_MODE_CLASS - || invalid_mode_change_p (i, (enum reg_class) class, + || invalid_mode_change_p (i, (enum reg_class) rclass, PSEUDO_REGNO_MODE (i)) #endif ) ; - else if (p->cost[class] < best_cost) + else if (p->cost[rclass] < best_cost) { - best_cost = p->cost[class]; - best = (enum reg_class) class; + best_cost = p->cost[rclass]; + best = (enum reg_class) rclass; } - else if (p->cost[class] == best_cost) - best = reg_class_subunion[(int) best][class]; + else if (p->cost[rclass] == best_cost) + best = reg_class_subunion[(int) best][rclass]; } /* If no register class is better than memory, use memory. */ @@ -1428,19 +1428,19 @@ regclass (rtx f, int nregs) will be doing it again later. */ if ((pass == 1 || dump_file) || ! flag_expensive_optimizations) - for (class = 0; class < N_REG_CLASSES; class++) - if (p->cost[class] < p->mem_cost - && (reg_class_size[(int) reg_class_subunion[(int) alt][class]] + for (rclass = 0; rclass < N_REG_CLASSES; rclass++) + if (p->cost[rclass] < p->mem_cost + && (reg_class_size[(int) reg_class_subunion[(int) alt][rclass]] > reg_class_size[(int) alt]) #ifdef FORBIDDEN_INC_DEC_CLASSES - && ! (in_inc_dec[i] && forbidden_inc_dec_class[class]) + && ! (in_inc_dec[i] && forbidden_inc_dec_class[rclass]) #endif #ifdef CANNOT_CHANGE_MODE_CLASS - && ! invalid_mode_change_p (i, (enum reg_class) class, + && ! invalid_mode_change_p (i, (enum reg_class) rclass, PSEUDO_REGNO_MODE (i)) #endif ) - alt = reg_class_subunion[(int) alt][class]; + alt = reg_class_subunion[(int) alt][rclass]; /* If we don't add any classes, nothing to try. */ if (alt == best) @@ -1517,7 +1517,7 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops, int alt_cost = 0; enum reg_class classes[MAX_RECOG_OPERANDS]; int allows_mem[MAX_RECOG_OPERANDS]; - int class; + int rclass; for (i = 0; i < n_ops; i++) { @@ -1617,17 +1617,17 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops, switch (recog_data.operand_type[i]) { case OP_INOUT: - for (class = 0; class < N_REG_CLASSES; class++) - pp->cost[class] = (intable[class][op_class] - + outtable[op_class][class]); + for (rclass = 0; rclass < N_REG_CLASSES; rclass++) + pp->cost[rclass] = (intable[rclass][op_class] + + outtable[op_class][rclass]); break; case OP_IN: - for (class = 0; class < N_REG_CLASSES; class++) - pp->cost[class] = intable[class][op_class]; + for (rclass = 0; rclass < N_REG_CLASSES; rclass++) + pp->cost[rclass] = intable[rclass][op_class]; break; case OP_OUT: - for (class = 0; class < N_REG_CLASSES; class++) - pp->cost[class] = outtable[op_class][class]; + for (rclass = 0; rclass < N_REG_CLASSES; rclass++) + pp->cost[rclass] = outtable[op_class][rclass]; break; } @@ -1861,17 +1861,17 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops, switch (recog_data.operand_type[i]) { case OP_INOUT: - for (class = 0; class < N_REG_CLASSES; class++) - pp->cost[class] = (intable[class][op_class] - + outtable[op_class][class]); + for (rclass = 0; rclass < N_REG_CLASSES; rclass++) + pp->cost[rclass] = (intable[rclass][op_class] + + outtable[op_class][rclass]); break; case OP_IN: - for (class = 0; class < N_REG_CLASSES; class++) - pp->cost[class] = intable[class][op_class]; + for (rclass = 0; rclass < N_REG_CLASSES; rclass++) + pp->cost[rclass] = intable[rclass][op_class]; break; case OP_OUT: - for (class = 0; class < N_REG_CLASSES; class++) - pp->cost[class] = outtable[op_class][class]; + for (rclass = 0; rclass < N_REG_CLASSES; rclass++) + pp->cost[rclass] = outtable[op_class][rclass]; break; } @@ -1949,9 +1949,9 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops, pp->mem_cost = MIN (pp->mem_cost, (qq->mem_cost + alt_cost) * scale); - for (class = 0; class < N_REG_CLASSES; class++) - pp->cost[class] = MIN (pp->cost[class], - (qq->cost[class] + alt_cost) * scale); + for (rclass = 0; rclass < N_REG_CLASSES; rclass++) + pp->cost[rclass] = MIN (pp->cost[rclass], + (qq->cost[rclass] + alt_cost) * scale); } } @@ -1978,7 +1978,7 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops, { unsigned int regno = REGNO (ops[!i]); enum machine_mode mode = GET_MODE (ops[!i]); - int class; + int rclass; if (regno >= FIRST_PSEUDO_REGISTER && reg_pref != 0 && reg_pref[regno].prefclass != NO_REGS) @@ -1991,15 +1991,15 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops, op_costs[i].cost[(unsigned char) pref] = -1; } else if (regno < FIRST_PSEUDO_REGISTER) - for (class = 0; class < N_REG_CLASSES; class++) - if (TEST_HARD_REG_BIT (reg_class_contents[class], regno) - && reg_class_size[class] == (unsigned) CLASS_MAX_NREGS (class, mode)) + for (rclass = 0; rclass < N_REG_CLASSES; rclass++) + if (TEST_HARD_REG_BIT (reg_class_contents[rclass], regno) + && reg_class_size[rclass] == (unsigned) CLASS_MAX_NREGS (rclass, mode)) { - if (reg_class_size[class] == 1) - op_costs[i].cost[class] = -1; - else if (in_hard_reg_set_p (reg_class_contents[class], + if (reg_class_size[rclass] == 1) + op_costs[i].cost[rclass] = -1; + else if (in_hard_reg_set_p (reg_class_contents[rclass], mode, regno)) - op_costs[i].cost[class] = -1; + op_costs[i].cost[rclass] = -1; } } } @@ -2010,7 +2010,7 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops, X must not be a pseudo. */ static int -copy_cost (rtx x, enum machine_mode mode, enum reg_class class, int to_p, +copy_cost (rtx x, enum machine_mode mode, enum reg_class rclass, int to_p, secondary_reload_info *prev_sri) { enum reg_class secondary_class = NO_REGS; @@ -2023,7 +2023,7 @@ copy_cost (rtx x, enum machine_mode mode, enum reg_class class, int to_p, return 0; /* Get the class we will actually use for a reload. */ - class = PREFERRED_RELOAD_CLASS (x, class); + rclass = PREFERRED_RELOAD_CLASS (x, rclass); /* If we need a secondary reload for an intermediate, the cost is that to load the input into the intermediate register, then @@ -2031,13 +2031,13 @@ copy_cost (rtx x, enum machine_mode mode, enum reg_class class, int to_p, sri.prev_sri = prev_sri; sri.extra_cost = 0; - secondary_class = targetm.secondary_reload (to_p, x, class, mode, &sri); + secondary_class = targetm.secondary_reload (to_p, x, rclass, mode, &sri); if (!move_cost[mode]) init_move_cost (mode); if (secondary_class != NO_REGS) - return (move_cost[mode][(int) secondary_class][(int) class] + return (move_cost[mode][(int) secondary_class][(int) rclass] + sri.extra_cost + copy_cost (x, mode, secondary_class, to_p, &sri)); @@ -2045,12 +2045,12 @@ copy_cost (rtx x, enum machine_mode mode, enum reg_class class, int to_p, cost to move between the register classes, and use 2 for everything else (constants). */ - if (MEM_P (x) || class == NO_REGS) - return sri.extra_cost + MEMORY_MOVE_COST (mode, class, to_p); + if (MEM_P (x) || rclass == NO_REGS) + return sri.extra_cost + MEMORY_MOVE_COST (mode, rclass, to_p); else if (REG_P (x)) return (sri.extra_cost - + move_cost[mode][(int) REGNO_REG_CLASS (REGNO (x))][(int) class]); + + move_cost[mode][(int) REGNO_REG_CLASS (REGNO (x))][(int) rclass]); else /* If this is a constant, we may eventually want to call rtx_cost here. */ @@ -2076,12 +2076,12 @@ record_address_regs (enum machine_mode mode, rtx x, int context, int scale) { enum rtx_code code = GET_CODE (x); - enum reg_class class; + enum reg_class rclass; if (context == 1) - class = INDEX_REG_CLASS; + rclass = INDEX_REG_CLASS; else - class = base_reg_class (mode, outer_code, index_code); + rclass = base_reg_class (mode, outer_code, index_code); switch (code) { @@ -2234,12 +2234,12 @@ record_address_regs (enum machine_mode mode, rtx x, int context, struct costs *pp = &costs[REGNO (x)]; int i; - pp->mem_cost += (MEMORY_MOVE_COST (Pmode, class, 1) * scale) / 2; + pp->mem_cost += (MEMORY_MOVE_COST (Pmode, rclass, 1) * scale) / 2; if (!move_cost[Pmode]) init_move_cost (Pmode); for (i = 0; i < N_REG_CLASSES; i++) - pp->cost[i] += (may_move_in_cost[Pmode][i][(int) class] * scale) / 2; + pp->cost[i] += (may_move_in_cost[Pmode][i][(int) rclass] * scale) / 2; } break; @@ -2627,7 +2627,7 @@ cannot_change_mode_set_regs (HARD_REG_SET *used, enum machine_mode from, bool invalid_mode_change_p (unsigned int regno, - enum reg_class class ATTRIBUTE_UNUSED, + enum reg_class rclass ATTRIBUTE_UNUSED, enum machine_mode from) { struct subregs_of_mode_node dummy, *node; @@ -2644,7 +2644,7 @@ invalid_mode_change_p (unsigned int regno, mask = 1 << (regno & 7); for (to = VOIDmode; to < NUM_MACHINE_MODES; to++) if (node->modes[to] & mask) - if (CANNOT_CHANGE_MODE_CLASS (from, to, class)) + if (CANNOT_CHANGE_MODE_CLASS (from, to, rclass)) return true; return false; diff --git a/gcc/regrename.c b/gcc/regrename.c index 8e48ad58a94..0ed810e6393 100644 --- a/gcc/regrename.c +++ b/gcc/regrename.c @@ -222,13 +222,13 @@ regrename_optimize (void) { int new_reg, best_new_reg; int n_uses; - struct du_chain *this = all_chains; + struct du_chain *this_du = all_chains; struct du_chain *tmp, *last; HARD_REG_SET this_unavailable; - int reg = REGNO (*this->loc); + int reg = REGNO (*this_du->loc); int i; - all_chains = this->next_chain; + all_chains = this_du->next_chain; best_new_reg = reg; @@ -256,7 +256,7 @@ regrename_optimize (void) count number of uses, and narrow the set of registers we can use for renaming. */ n_uses = 0; - for (last = this; last->next_use; last = last->next_use) + for (last = this_du; last->next_use; last = last->next_use) { n_uses++; IOR_COMPL_HARD_REG_SET (this_unavailable, @@ -268,16 +268,16 @@ regrename_optimize (void) IOR_COMPL_HARD_REG_SET (this_unavailable, reg_class_contents[last->cl]); - if (this->need_caller_save_reg) + if (this_du->need_caller_save_reg) IOR_HARD_REG_SET (this_unavailable, call_used_reg_set); - merge_overlapping_regs (bb, &this_unavailable, this); + merge_overlapping_regs (bb, &this_unavailable, this_du); /* Now potential_regs is a reasonable approximation, let's have a closer look at each register still in there. */ for (new_reg = 0; new_reg < FIRST_PSEUDO_REGISTER; new_reg++) { - int nregs = hard_regno_nregs[new_reg][GET_MODE (*this->loc)]; + int nregs = hard_regno_nregs[new_reg][GET_MODE (*this_du->loc)]; for (i = nregs - 1; i >= 0; --i) if (TEST_HARD_REG_BIT (this_unavailable, new_reg + i) @@ -302,7 +302,7 @@ regrename_optimize (void) /* See whether it accepts all modes that occur in definition and uses. */ - for (tmp = this; tmp; tmp = tmp->next_use) + for (tmp = this_du; tmp; tmp = tmp->next_use) if (! HARD_REGNO_MODE_OK (new_reg, GET_MODE (*tmp->loc)) || (tmp->need_caller_save_reg && ! (HARD_REGNO_CALL_PART_CLOBBERED @@ -333,7 +333,7 @@ regrename_optimize (void) continue; } - do_replace (this, best_new_reg); + do_replace (this_du, best_new_reg); tick[best_new_reg] = ++this_tick; df_set_regs_ever_live (best_new_reg, true); @@ -385,15 +385,15 @@ scan_rtx_reg (rtx insn, rtx *loc, enum reg_class cl, { if (type == OP_OUT) { - struct du_chain *this = XOBNEW (&rename_obstack, struct du_chain); - this->next_use = 0; - this->next_chain = open_chains; - this->loc = loc; - this->insn = insn; - this->cl = cl; - this->need_caller_save_reg = 0; - this->earlyclobber = earlyclobber; - open_chains = this; + struct du_chain *this_du = XOBNEW (&rename_obstack, struct du_chain); + this_du->next_use = 0; + this_du->next_chain = open_chains; + this_du->loc = loc; + this_du->insn = insn; + this_du->cl = cl; + this_du->need_caller_save_reg = 0; + this_du->earlyclobber = earlyclobber; + open_chains = this_du; } return; } @@ -403,7 +403,7 @@ scan_rtx_reg (rtx insn, rtx *loc, enum reg_class cl, for (p = &open_chains; *p;) { - struct du_chain *this = *p; + struct du_chain *this_du = *p; /* Check if the chain has been terminated if it has then skip to the next chain. @@ -412,18 +412,18 @@ scan_rtx_reg (rtx insn, rtx *loc, enum reg_class cl, the chain in Step 3, but are trying to hide in-out operands from terminate_write in Step 5. */ - if (*this->loc == cc0_rtx) - p = &this->next_chain; + if (*this_du->loc == cc0_rtx) + p = &this_du->next_chain; else { - int regno = REGNO (*this->loc); - int nregs = hard_regno_nregs[regno][GET_MODE (*this->loc)]; + int regno = REGNO (*this_du->loc); + int nregs = hard_regno_nregs[regno][GET_MODE (*this_du->loc)]; int exact_match = (regno == this_regno && nregs == this_nregs); if (regno + nregs <= this_regno || this_regno + this_nregs <= regno) { - p = &this->next_chain; + p = &this_du->next_chain; continue; } @@ -437,23 +437,23 @@ scan_rtx_reg (rtx insn, rtx *loc, enum reg_class cl, be replaced with, terminate the chain. */ if (cl != NO_REGS) { - this = XOBNEW (&rename_obstack, struct du_chain); - this->next_use = 0; - this->next_chain = (*p)->next_chain; - this->loc = loc; - this->insn = insn; - this->cl = cl; - this->need_caller_save_reg = 0; + this_du = XOBNEW (&rename_obstack, struct du_chain); + this_du->next_use = 0; + this_du->next_chain = (*p)->next_chain; + this_du->loc = loc; + this_du->insn = insn; + this_du->cl = cl; + this_du->need_caller_save_reg = 0; while (*p) p = &(*p)->next_use; - *p = this; + *p = this_du; return; } } if (action != terminate_overlapping_read || ! exact_match) { - struct du_chain *next = this->next_chain; + struct du_chain *next = this_du->next_chain; /* Whether the terminated chain can be used for renaming depends on the action and this being an exact match. @@ -462,12 +462,12 @@ scan_rtx_reg (rtx insn, rtx *loc, enum reg_class cl, if ((action == terminate_dead || action == terminate_write) && exact_match) { - this->next_chain = closed_chains; - closed_chains = this; + this_du->next_chain = closed_chains; + closed_chains = this_du; if (dump_file) fprintf (dump_file, "Closing chain %s at insn %d (%s)\n", - reg_names[REGNO (*this->loc)], INSN_UID (insn), + reg_names[REGNO (*this_du->loc)], INSN_UID (insn), scan_actions_name[(int) action]); } else @@ -475,13 +475,13 @@ scan_rtx_reg (rtx insn, rtx *loc, enum reg_class cl, if (dump_file) fprintf (dump_file, "Discarding chain %s at insn %d (%s)\n", - reg_names[REGNO (*this->loc)], INSN_UID (insn), + reg_names[REGNO (*this_du->loc)], INSN_UID (insn), scan_actions_name[(int) action]); } *p = next; } else - p = &this->next_chain; + p = &this_du->next_chain; } } } @@ -976,15 +976,15 @@ dump_def_use_chain (struct du_chain *chains) { while (chains) { - struct du_chain *this = chains; - int r = REGNO (*this->loc); - int nregs = hard_regno_nregs[r][GET_MODE (*this->loc)]; + struct du_chain *this_du = chains; + int r = REGNO (*this_du->loc); + int nregs = hard_regno_nregs[r][GET_MODE (*this_du->loc)]; fprintf (dump_file, "Register %s (%d):", reg_names[r], nregs); - while (this) + while (this_du) { - fprintf (dump_file, " %d [%s]", INSN_UID (this->insn), - reg_class_names[this->cl]); - this = this->next_use; + fprintf (dump_file, " %d [%s]", INSN_UID (this_du->insn), + reg_class_names[this_du->cl]); + this_du = this_du->next_use; } fprintf (dump_file, "\n"); chains = chains->next_chain; @@ -1365,17 +1365,17 @@ find_oldest_value_reg (enum reg_class cl, rtx reg, struct value_data *vd) for (i = vd->e[regno].oldest_regno; i != regno; i = vd->e[i].next_regno) { enum machine_mode oldmode = vd->e[i].mode; - rtx new; + rtx new_rtx; if (!in_hard_reg_set_p (reg_class_contents[cl], mode, i)) return NULL_RTX; - new = maybe_mode_change (oldmode, vd->e[regno].mode, mode, i, regno); - if (new) + new_rtx = maybe_mode_change (oldmode, vd->e[regno].mode, mode, i, regno); + if (new_rtx) { - ORIGINAL_REGNO (new) = ORIGINAL_REGNO (reg); - REG_ATTRS (new) = REG_ATTRS (reg); - return new; + ORIGINAL_REGNO (new_rtx) = ORIGINAL_REGNO (reg); + REG_ATTRS (new_rtx) = REG_ATTRS (reg); + return new_rtx; } } @@ -1389,14 +1389,14 @@ static bool replace_oldest_value_reg (rtx *loc, enum reg_class cl, rtx insn, struct value_data *vd) { - rtx new = find_oldest_value_reg (cl, *loc, vd); - if (new) + rtx new_rtx = find_oldest_value_reg (cl, *loc, vd); + if (new_rtx) { if (dump_file) fprintf (dump_file, "insn %u: replaced reg %u with %u\n", - INSN_UID (insn), REGNO (*loc), REGNO (new)); + INSN_UID (insn), REGNO (*loc), REGNO (new_rtx)); - validate_change (insn, loc, new, 1); + validate_change (insn, loc, new_rtx, 1); return true; } return false; @@ -1634,7 +1634,7 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd) unsigned int regno = REGNO (src); enum machine_mode mode = GET_MODE (src); unsigned int i; - rtx new; + rtx new_rtx; /* If we are accessing SRC in some mode other that what we set it in, make sure that the replacement is valid. */ @@ -1649,13 +1649,13 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd) register in the same class. */ if (REG_P (SET_DEST (set))) { - new = find_oldest_value_reg (REGNO_REG_CLASS (regno), src, vd); - if (new && validate_change (insn, &SET_SRC (set), new, 0)) + new_rtx = find_oldest_value_reg (REGNO_REG_CLASS (regno), src, vd); + if (new_rtx && validate_change (insn, &SET_SRC (set), new_rtx, 0)) { if (dump_file) fprintf (dump_file, "insn %u: replaced reg %u with %u\n", - INSN_UID (insn), regno, REGNO (new)); + INSN_UID (insn), regno, REGNO (new_rtx)); changed = true; goto did_replacement; } @@ -1665,18 +1665,18 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd) for (i = vd->e[regno].oldest_regno; i != regno; i = vd->e[i].next_regno) { - new = maybe_mode_change (vd->e[i].mode, vd->e[regno].mode, + new_rtx = maybe_mode_change (vd->e[i].mode, vd->e[regno].mode, mode, i, regno); - if (new != NULL_RTX) + if (new_rtx != NULL_RTX) { - if (validate_change (insn, &SET_SRC (set), new, 0)) + if (validate_change (insn, &SET_SRC (set), new_rtx, 0)) { - ORIGINAL_REGNO (new) = ORIGINAL_REGNO (src); - REG_ATTRS (new) = REG_ATTRS (src); + ORIGINAL_REGNO (new_rtx) = ORIGINAL_REGNO (src); + REG_ATTRS (new_rtx) = REG_ATTRS (src); if (dump_file) fprintf (dump_file, "insn %u: replaced reg %u with %u\n", - INSN_UID (insn), regno, REGNO (new)); + INSN_UID (insn), regno, REGNO (new_rtx)); changed = true; goto did_replacement; } @@ -1729,13 +1729,13 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd) if (replaced[i]) { int j; - rtx new; + rtx new_rtx; - new = *recog_data.operand_loc[i]; - recog_data.operand[i] = new; + new_rtx = *recog_data.operand_loc[i]; + recog_data.operand[i] = new_rtx; for (j = 0; j < recog_data.n_dups; j++) if (recog_data.dup_num[j] == i) - validate_unshare_change (insn, recog_data.dup_loc[j], new, 1); + validate_unshare_change (insn, recog_data.dup_loc[j], new_rtx, 1); any_replacements = true; } diff --git a/gcc/reload.c b/gcc/reload.c index 5a128f9fb81..a391c457191 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -319,7 +319,7 @@ push_secondary_reload (int in_p, rtx x, int opnum, int optional, enum machine_mode reload_mode, enum reload_type type, enum insn_code *picode, secondary_reload_info *prev_sri) { - enum reg_class class = NO_REGS; + enum reg_class rclass = NO_REGS; enum reg_class scratch_class; enum machine_mode mode = reload_mode; enum insn_code icode = CODE_FOR_nothing; @@ -362,15 +362,15 @@ push_secondary_reload (int in_p, rtx x, int opnum, int optional, sri.icode = CODE_FOR_nothing; sri.prev_sri = prev_sri; - class = targetm.secondary_reload (in_p, x, reload_class, reload_mode, &sri); + rclass = targetm.secondary_reload (in_p, x, reload_class, reload_mode, &sri); icode = sri.icode; /* If we don't need any secondary registers, done. */ - if (class == NO_REGS && icode == CODE_FOR_nothing) + if (rclass == NO_REGS && icode == CODE_FOR_nothing) return -1; - if (class != NO_REGS) - t_reload = push_secondary_reload (in_p, x, opnum, optional, class, + if (rclass != NO_REGS) + t_reload = push_secondary_reload (in_p, x, opnum, optional, rclass, reload_mode, type, &t_icode, &sri); /* If we will be using an insn, the secondary reload is for a @@ -392,7 +392,7 @@ push_secondary_reload (int in_p, rtx x, int opnum, int optional, an icode to reload from an intermediate tertiary reload register. We should probably have a new field in struct reload to tag a chain of scratch operand reloads onto. */ - gcc_assert (class == NO_REGS); + gcc_assert (rclass == NO_REGS); scratch_constraint = insn_data[(int) icode].operand[2].constraint; gcc_assert (*scratch_constraint == '='); @@ -404,7 +404,7 @@ push_secondary_reload (int in_p, rtx x, int opnum, int optional, : REG_CLASS_FROM_CONSTRAINT ((unsigned char) letter, scratch_constraint)); - class = scratch_class; + rclass = scratch_class; mode = insn_data[(int) icode].operand[2].mode; } @@ -422,21 +422,21 @@ push_secondary_reload (int in_p, rtx x, int opnum, int optional, Allow this when a reload_in/out pattern is being used. I.e. assume that the generated code handles this case. */ - gcc_assert (!in_p || class != reload_class || icode != CODE_FOR_nothing + gcc_assert (!in_p || rclass != reload_class || icode != CODE_FOR_nothing || t_icode != CODE_FOR_nothing); /* See if we can reuse an existing secondary reload. */ for (s_reload = 0; s_reload < n_reloads; s_reload++) if (rld[s_reload].secondary_p - && (reg_class_subset_p (class, rld[s_reload].class) - || reg_class_subset_p (rld[s_reload].class, class)) + && (reg_class_subset_p (rclass, rld[s_reload].rclass) + || reg_class_subset_p (rld[s_reload].rclass, rclass)) && ((in_p && rld[s_reload].inmode == mode) || (! in_p && rld[s_reload].outmode == mode)) && ((in_p && rld[s_reload].secondary_in_reload == t_reload) || (! in_p && rld[s_reload].secondary_out_reload == t_reload)) && ((in_p && rld[s_reload].secondary_in_icode == t_icode) || (! in_p && rld[s_reload].secondary_out_icode == t_icode)) - && (SMALL_REGISTER_CLASS_P (class) || SMALL_REGISTER_CLASSES) + && (SMALL_REGISTER_CLASS_P (rclass) || SMALL_REGISTER_CLASSES) && MERGABLE_RELOADS (secondary_type, rld[s_reload].when_needed, opnum, rld[s_reload].opnum)) { @@ -445,8 +445,8 @@ push_secondary_reload (int in_p, rtx x, int opnum, int optional, if (! in_p) rld[s_reload].outmode = mode; - if (reg_class_subset_p (class, rld[s_reload].class)) - rld[s_reload].class = class; + if (reg_class_subset_p (rclass, rld[s_reload].rclass)) + rld[s_reload].rclass = rclass; rld[s_reload].opnum = MIN (rld[s_reload].opnum, opnum); rld[s_reload].optional &= optional; @@ -467,7 +467,7 @@ push_secondary_reload (int in_p, rtx x, int opnum, int optional, way reloads are output. */ if (in_p && icode == CODE_FOR_nothing - && SECONDARY_MEMORY_NEEDED (class, reload_class, mode)) + && SECONDARY_MEMORY_NEEDED (rclass, reload_class, mode)) { get_secondary_mem (x, reload_mode, opnum, type); @@ -479,7 +479,7 @@ push_secondary_reload (int in_p, rtx x, int opnum, int optional, /* We need to make a new secondary reload for this register class. */ rld[s_reload].in = rld[s_reload].out = 0; - rld[s_reload].class = class; + rld[s_reload].rclass = rclass; rld[s_reload].inmode = in_p ? mode : VOIDmode; rld[s_reload].outmode = ! in_p ? mode : VOIDmode; @@ -503,7 +503,7 @@ push_secondary_reload (int in_p, rtx x, int opnum, int optional, #ifdef SECONDARY_MEMORY_NEEDED if (! in_p && icode == CODE_FOR_nothing - && SECONDARY_MEMORY_NEEDED (reload_class, class, mode)) + && SECONDARY_MEMORY_NEEDED (reload_class, rclass, mode)) get_secondary_mem (x, mode, opnum, type); #endif } @@ -516,7 +516,7 @@ push_secondary_reload (int in_p, rtx x, int opnum, int optional, register and a scratch register is needed, we return the class of the intermediate register. */ enum reg_class -secondary_reload_class (bool in_p, enum reg_class class, +secondary_reload_class (bool in_p, enum reg_class rclass, enum machine_mode mode, rtx x) { enum insn_code icode; @@ -524,13 +524,13 @@ secondary_reload_class (bool in_p, enum reg_class class, sri.icode = CODE_FOR_nothing; sri.prev_sri = NULL; - class = targetm.secondary_reload (in_p, x, class, mode, &sri); + rclass = targetm.secondary_reload (in_p, x, rclass, mode, &sri); icode = sri.icode; /* If there are no secondary reloads at all, we return NO_REGS. If an intermediate register is needed, we return its class. */ - if (icode == CODE_FOR_nothing || class != NO_REGS) - return class; + if (icode == CODE_FOR_nothing || rclass != NO_REGS) + return rclass; /* No intermediate register is needed, but we have a special reload pattern, which we assume for now needs a scratch register. */ @@ -547,7 +547,7 @@ scratch_reload_class (enum insn_code icode) { const char *scratch_constraint; char scratch_letter; - enum reg_class class; + enum reg_class rclass; gcc_assert (insn_data[(int) icode].n_operands == 3); scratch_constraint = insn_data[(int) icode].operand[2].constraint; @@ -558,10 +558,10 @@ scratch_reload_class (enum insn_code icode) scratch_letter = *scratch_constraint; if (scratch_letter == 'r') return GENERAL_REGS; - class = REG_CLASS_FROM_CONSTRAINT ((unsigned char) scratch_letter, + rclass = REG_CLASS_FROM_CONSTRAINT ((unsigned char) scratch_letter, scratch_constraint); - gcc_assert (class != NO_REGS); - return class; + gcc_assert (rclass != NO_REGS); + return rclass; } #ifdef SECONDARY_MEMORY_NEEDED @@ -660,24 +660,24 @@ find_valid_class (enum machine_mode outer ATTRIBUTE_UNUSED, unsigned int dest_regno ATTRIBUTE_UNUSED) { int best_cost = -1; - int class; + int rclass; int regno; enum reg_class best_class = NO_REGS; enum reg_class dest_class ATTRIBUTE_UNUSED = REGNO_REG_CLASS (dest_regno); unsigned int best_size = 0; int cost; - for (class = 1; class < N_REG_CLASSES; class++) + for (rclass = 1; rclass < N_REG_CLASSES; rclass++) { int bad = 0; int good = 0; for (regno = 0; regno < FIRST_PSEUDO_REGISTER - n && ! bad; regno++) - if (TEST_HARD_REG_BIT (reg_class_contents[class], regno)) + if (TEST_HARD_REG_BIT (reg_class_contents[rclass], regno)) { if (HARD_REGNO_MODE_OK (regno, inner)) { good = 1; - if (! TEST_HARD_REG_BIT (reg_class_contents[class], regno + n) + if (! TEST_HARD_REG_BIT (reg_class_contents[rclass], regno + n) || ! HARD_REGNO_MODE_OK (regno + n, outer)) bad = 1; } @@ -685,15 +685,15 @@ find_valid_class (enum machine_mode outer ATTRIBUTE_UNUSED, if (bad || !good) continue; - cost = REGISTER_MOVE_COST (outer, class, dest_class); + cost = REGISTER_MOVE_COST (outer, rclass, dest_class); - if ((reg_class_size[class] > best_size + if ((reg_class_size[rclass] > best_size && (best_cost < 0 || best_cost >= cost)) || best_cost > cost) { - best_class = class; - best_size = reg_class_size[class]; - best_cost = REGISTER_MOVE_COST (outer, class, dest_class); + best_class = rclass; + best_size = reg_class_size[rclass]; + best_cost = REGISTER_MOVE_COST (outer, rclass, dest_class); } } @@ -704,14 +704,14 @@ find_valid_class (enum machine_mode outer ATTRIBUTE_UNUSED, /* Return the number of a previously made reload that can be combined with a new one, or n_reloads if none of the existing reloads can be used. - OUT, CLASS, TYPE and OPNUM are the same arguments as passed to + OUT, RCLASS, TYPE and OPNUM are the same arguments as passed to push_reload, they determine the kind of the new reload that we try to combine. P_IN points to the corresponding value of IN, which can be modified by this function. DONT_SHARE is nonzero if we can't share any input-only reload for IN. */ static int -find_reusable_reload (rtx *p_in, rtx out, enum reg_class class, +find_reusable_reload (rtx *p_in, rtx out, enum reg_class rclass, enum reload_type type, int opnum, int dont_share) { rtx in = *p_in; @@ -732,18 +732,18 @@ find_reusable_reload (rtx *p_in, rtx out, enum reg_class class, than we otherwise would. */ for (i = 0; i < n_reloads; i++) - if ((reg_class_subset_p (class, rld[i].class) - || reg_class_subset_p (rld[i].class, class)) + if ((reg_class_subset_p (rclass, rld[i].rclass) + || reg_class_subset_p (rld[i].rclass, rclass)) /* If the existing reload has a register, it must fit our class. */ && (rld[i].reg_rtx == 0 - || TEST_HARD_REG_BIT (reg_class_contents[(int) class], + || TEST_HARD_REG_BIT (reg_class_contents[(int) rclass], true_regnum (rld[i].reg_rtx))) && ((in != 0 && MATCHES (rld[i].in, in) && ! dont_share && (out == 0 || rld[i].out == 0 || MATCHES (rld[i].out, out))) || (out != 0 && MATCHES (rld[i].out, out) && (in == 0 || rld[i].in == 0 || MATCHES (rld[i].in, in)))) && (rld[i].out == 0 || ! earlyclobber_operand_p (rld[i].out)) - && (SMALL_REGISTER_CLASS_P (class) || SMALL_REGISTER_CLASSES) + && (SMALL_REGISTER_CLASS_P (rclass) || SMALL_REGISTER_CLASSES) && MERGABLE_RELOADS (type, rld[i].when_needed, opnum, rld[i].opnum)) return i; @@ -753,12 +753,12 @@ find_reusable_reload (rtx *p_in, rtx out, enum reg_class class, the preincrementation as happening before any ref in this insn to that register. */ for (i = 0; i < n_reloads; i++) - if ((reg_class_subset_p (class, rld[i].class) - || reg_class_subset_p (rld[i].class, class)) + if ((reg_class_subset_p (rclass, rld[i].rclass) + || reg_class_subset_p (rld[i].rclass, rclass)) /* If the existing reload has a register, it must fit our class. */ && (rld[i].reg_rtx == 0 - || TEST_HARD_REG_BIT (reg_class_contents[(int) class], + || TEST_HARD_REG_BIT (reg_class_contents[(int) rclass], true_regnum (rld[i].reg_rtx))) && out == 0 && rld[i].out == 0 && rld[i].in != 0 && ((REG_P (in) @@ -768,7 +768,7 @@ find_reusable_reload (rtx *p_in, rtx out, enum reg_class class, && GET_RTX_CLASS (GET_CODE (in)) == RTX_AUTOINC && MATCHES (XEXP (in, 0), rld[i].in))) && (rld[i].out == 0 || ! earlyclobber_operand_p (rld[i].out)) - && (SMALL_REGISTER_CLASS_P (class) || SMALL_REGISTER_CLASSES) + && (SMALL_REGISTER_CLASS_P (rclass) || SMALL_REGISTER_CLASSES) && MERGABLE_RELOADS (type, rld[i].when_needed, opnum, rld[i].opnum)) { @@ -878,7 +878,7 @@ can_reload_into (rtx in, int regno, enum machine_mode mode) If IN and OUT are both nonzero, it means the same register must be used to reload both IN and OUT. - CLASS is a register class required for the reloaded data. + RCLASS is a register class required for the reloaded data. INMODE is the machine mode that the instruction requires for the reg that replaces IN and OUTMODE is likewise for OUT. @@ -904,7 +904,7 @@ can_reload_into (rtx in, int regno, enum machine_mode mode) int push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, - enum reg_class class, enum machine_mode inmode, + enum reg_class rclass, enum machine_mode inmode, enum machine_mode outmode, int strict_low, int optional, int opnum, enum reload_type type) { @@ -1003,7 +1003,7 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, if (in != 0 && GET_CODE (in) == SUBREG && (subreg_lowpart_p (in) || strict_low) #ifdef CANNOT_CHANGE_MODE_CLASS - && !CANNOT_CHANGE_MODE_CLASS (GET_MODE (SUBREG_REG (in)), inmode, class) + && !CANNOT_CHANGE_MODE_CLASS (GET_MODE (SUBREG_REG (in)), inmode, rclass) #endif && (CONSTANT_P (SUBREG_REG (in)) || GET_CODE (SUBREG_REG (in)) == PLUS @@ -1043,8 +1043,8 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, != (int) hard_regno_nregs[REGNO (SUBREG_REG (in))] [GET_MODE (SUBREG_REG (in))])) || ! HARD_REGNO_MODE_OK (subreg_regno (in), inmode))) - || (secondary_reload_class (1, class, inmode, in) != NO_REGS - && (secondary_reload_class (1, class, GET_MODE (SUBREG_REG (in)), + || (secondary_reload_class (1, rclass, inmode, in) != NO_REGS + && (secondary_reload_class (1, rclass, GET_MODE (SUBREG_REG (in)), SUBREG_REG (in)) == NO_REGS)) #ifdef CANNOT_CHANGE_MODE_CLASS @@ -1079,7 +1079,7 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, if (in != 0 && reload_inner_reg_of_subreg (in, inmode, 0)) { - enum reg_class in_class = class; + enum reg_class in_class = rclass; if (REG_P (SUBREG_REG (in))) in_class @@ -1109,7 +1109,7 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, if (out != 0 && GET_CODE (out) == SUBREG && (subreg_lowpart_p (out) || strict_low) #ifdef CANNOT_CHANGE_MODE_CLASS - && !CANNOT_CHANGE_MODE_CLASS (GET_MODE (SUBREG_REG (out)), outmode, class) + && !CANNOT_CHANGE_MODE_CLASS (GET_MODE (SUBREG_REG (out)), outmode, rclass) #endif && (CONSTANT_P (SUBREG_REG (out)) || strict_low @@ -1136,8 +1136,8 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, != (int) hard_regno_nregs[REGNO (SUBREG_REG (out))] [GET_MODE (SUBREG_REG (out))])) || ! HARD_REGNO_MODE_OK (subreg_regno (out), outmode))) - || (secondary_reload_class (0, class, outmode, out) != NO_REGS - && (secondary_reload_class (0, class, GET_MODE (SUBREG_REG (out)), + || (secondary_reload_class (0, rclass, outmode, out) != NO_REGS + && (secondary_reload_class (0, rclass, GET_MODE (SUBREG_REG (out)), SUBREG_REG (out)) == NO_REGS)) #ifdef CANNOT_CHANGE_MODE_CLASS @@ -1211,10 +1211,10 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, /* Narrow down the class of register wanted if that is desirable on this machine for efficiency. */ { - enum reg_class preferred_class = class; + enum reg_class preferred_class = rclass; if (in != 0) - preferred_class = PREFERRED_RELOAD_CLASS (in, class); + preferred_class = PREFERRED_RELOAD_CLASS (in, rclass); /* Output reloads may need analogous treatment, different in detail. */ #ifdef PREFERRED_OUTPUT_RELOAD_CLASS @@ -1225,7 +1225,7 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, /* Discard what the target said if we cannot do it. */ if (preferred_class != NO_REGS || (optional && type == RELOAD_FOR_OUTPUT)) - class = preferred_class; + rclass = preferred_class; } /* Make sure we use a class that can handle the actual pseudo @@ -1234,14 +1234,14 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, can handle SImode, QImode needs a smaller class. */ #ifdef LIMIT_RELOAD_CLASS if (in_subreg_loc) - class = LIMIT_RELOAD_CLASS (inmode, class); + rclass = LIMIT_RELOAD_CLASS (inmode, rclass); else if (in != 0 && GET_CODE (in) == SUBREG) - class = LIMIT_RELOAD_CLASS (GET_MODE (SUBREG_REG (in)), class); + rclass = LIMIT_RELOAD_CLASS (GET_MODE (SUBREG_REG (in)), rclass); if (out_subreg_loc) - class = LIMIT_RELOAD_CLASS (outmode, class); + rclass = LIMIT_RELOAD_CLASS (outmode, rclass); if (out != 0 && GET_CODE (out) == SUBREG) - class = LIMIT_RELOAD_CLASS (GET_MODE (SUBREG_REG (out)), class); + rclass = LIMIT_RELOAD_CLASS (GET_MODE (SUBREG_REG (out)), rclass); #endif /* Verify that this class is at least possible for the mode that @@ -1265,7 +1265,7 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, } for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) if (HARD_REGNO_MODE_OK (i, mode) - && in_hard_reg_set_p (reg_class_contents[(int) class], mode, i)) + && in_hard_reg_set_p (reg_class_contents[(int) rclass], mode, i)) break; if (i == FIRST_PSEUDO_REGISTER) { @@ -1290,10 +1290,10 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, /* Optional output reloads are always OK even if we have no register class, since the function of these reloads is only to have spill_reg_store etc. set, so that the storing insn can be deleted later. */ - gcc_assert (class != NO_REGS + gcc_assert (rclass != NO_REGS || (optional != 0 && type == RELOAD_FOR_OUTPUT)); - i = find_reusable_reload (&in, out, class, type, opnum, dont_share); + i = find_reusable_reload (&in, out, rclass, type, opnum, dont_share); if (i == n_reloads) { @@ -1303,11 +1303,11 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, if (in != 0) secondary_in_reload - = push_secondary_reload (1, in, opnum, optional, class, inmode, type, + = push_secondary_reload (1, in, opnum, optional, rclass, inmode, type, &secondary_in_icode, NULL); if (out != 0 && GET_CODE (out) != SCRATCH) secondary_out_reload - = push_secondary_reload (0, out, opnum, optional, class, outmode, + = push_secondary_reload (0, out, opnum, optional, rclass, outmode, type, &secondary_out_icode, NULL); /* We found no existing reload suitable for re-use. @@ -1320,14 +1320,14 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, || (GET_CODE (in) == SUBREG && REG_P (SUBREG_REG (in)))) && reg_or_subregno (in) < FIRST_PSEUDO_REGISTER && SECONDARY_MEMORY_NEEDED (REGNO_REG_CLASS (reg_or_subregno (in)), - class, inmode)) + rclass, inmode)) get_secondary_mem (in, inmode, opnum, type); #endif i = n_reloads; rld[i].in = in; rld[i].out = out; - rld[i].class = class; + rld[i].rclass = rclass; rld[i].inmode = inmode; rld[i].outmode = outmode; rld[i].reg_rtx = 0; @@ -1351,7 +1351,7 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, && (REG_P (out) || (GET_CODE (out) == SUBREG && REG_P (SUBREG_REG (out)))) && reg_or_subregno (out) < FIRST_PSEUDO_REGISTER - && SECONDARY_MEMORY_NEEDED (class, + && SECONDARY_MEMORY_NEEDED (rclass, REGNO_REG_CLASS (reg_or_subregno (out)), outmode)) get_secondary_mem (out, outmode, opnum, type); @@ -1411,8 +1411,8 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, rld[i].out = out; rld[i].out_reg = outloc ? *outloc : 0; } - if (reg_class_subset_p (class, rld[i].class)) - rld[i].class = class; + if (reg_class_subset_p (rclass, rld[i].rclass)) + rld[i].rclass = rclass; rld[i].optional &= optional; if (MERGE_TO_OTHER (type, rld[i].when_needed, opnum, rld[i].opnum)) @@ -1484,7 +1484,7 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, { rld[i].reg_rtx = find_dummy_reload (in, out, inloc, outloc, inmode, outmode, - rld[i].class, i, + rld[i].rclass, i, earlyclobber_operand_p (out)); /* If the outgoing register already contains the same value @@ -1561,7 +1561,7 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, for (offs = 0; offs < nregs; offs++) if (fixed_regs[regno + offs] - || ! TEST_HARD_REG_BIT (reg_class_contents[(int) class], + || ! TEST_HARD_REG_BIT (reg_class_contents[(int) rclass], regno + offs)) break; @@ -1730,8 +1730,8 @@ combine_reloads (void) && rld[i].when_needed != RELOAD_FOR_OUTPUT_ADDRESS && rld[i].when_needed != RELOAD_FOR_OUTADDR_ADDRESS && rld[i].when_needed != RELOAD_OTHER - && (CLASS_MAX_NREGS (rld[i].class, rld[i].inmode) - == CLASS_MAX_NREGS (rld[output_reload].class, + && (CLASS_MAX_NREGS (rld[i].rclass, rld[i].inmode) + == CLASS_MAX_NREGS (rld[output_reload].rclass, rld[output_reload].outmode)) && rld[i].inc == 0 && rld[i].reg_rtx == 0 @@ -1744,11 +1744,11 @@ combine_reloads (void) secondary_memlocs_elim[(int) rld[output_reload].outmode][rld[output_reload].opnum])) #endif && (SMALL_REGISTER_CLASSES - ? (rld[i].class == rld[output_reload].class) - : (reg_class_subset_p (rld[i].class, - rld[output_reload].class) - || reg_class_subset_p (rld[output_reload].class, - rld[i].class))) + ? (rld[i].rclass == rld[output_reload].rclass) + : (reg_class_subset_p (rld[i].rclass, + rld[output_reload].rclass) + || reg_class_subset_p (rld[output_reload].rclass, + rld[i].rclass))) && (MATCHES (rld[i].in, rld[output_reload].out) /* Args reversed because the first arg seems to be the one that we imagine being modified @@ -1766,7 +1766,7 @@ combine_reloads (void) rld[output_reload].out)))) && ! reload_inner_reg_of_subreg (rld[i].in, rld[i].inmode, rld[i].when_needed != RELOAD_FOR_INPUT) - && (reg_class_size[(int) rld[i].class] + && (reg_class_size[(int) rld[i].rclass] || SMALL_REGISTER_CLASSES) /* We will allow making things slightly worse by combining an input and an output, but no worse than that. */ @@ -1799,9 +1799,9 @@ combine_reloads (void) = secondary_memlocs_elim[(int) rld[output_reload].outmode][rld[output_reload].opnum]; #endif /* If required, minimize the register class. */ - if (reg_class_subset_p (rld[output_reload].class, - rld[i].class)) - rld[i].class = rld[output_reload].class; + if (reg_class_subset_p (rld[output_reload].rclass, + rld[i].rclass)) + rld[i].rclass = rld[output_reload].rclass; /* Transfer all replacements from the old reload to the combined. */ for (j = 0; j < n_replacements; j++) @@ -1835,7 +1835,7 @@ combine_reloads (void) rld[output_reload].out) && (regno = REGNO (XEXP (note, 0))) < FIRST_PSEUDO_REGISTER && HARD_REGNO_MODE_OK (regno, rld[output_reload].outmode) - && TEST_HARD_REG_BIT (reg_class_contents[(int) rld[output_reload].class], + && TEST_HARD_REG_BIT (reg_class_contents[(int) rld[output_reload].rclass], regno) && (hard_regno_nregs[regno][rld[output_reload].outmode] <= hard_regno_nregs[regno][GET_MODE (XEXP (note, 0))]) @@ -1843,10 +1843,10 @@ combine_reloads (void) won't want this register. */ && ((secondary_out = rld[output_reload].secondary_out_reload) == -1 || (!(TEST_HARD_REG_BIT - (reg_class_contents[(int) rld[secondary_out].class], regno)) + (reg_class_contents[(int) rld[secondary_out].rclass], regno)) && ((secondary_out = rld[secondary_out].secondary_out_reload) == -1 || !(TEST_HARD_REG_BIT - (reg_class_contents[(int) rld[secondary_out].class], + (reg_class_contents[(int) rld[secondary_out].rclass], regno))))) && !fixed_regs[regno] /* Check that a former pseudo is valid; see find_dummy_reload. */ @@ -1867,7 +1867,7 @@ combine_reloads (void) If so, return the register rtx that proves acceptable. INLOC and OUTLOC are locations where IN and OUT appear in the insn. - CLASS is the register class required for the reload. + RCLASS is the register class required for the reload. If FOR_REAL is >= 0, it is the number of the reload, and in some cases when it can be discovered that OUT doesn't need @@ -1884,7 +1884,7 @@ combine_reloads (void) static rtx find_dummy_reload (rtx real_in, rtx real_out, rtx *inloc, rtx *outloc, enum machine_mode inmode, enum machine_mode outmode, - enum reg_class class, int for_real, int earlyclobber) + enum reg_class rclass, int for_real, int earlyclobber) { rtx in = real_in; rtx out = real_out; @@ -1927,9 +1927,9 @@ find_dummy_reload (rtx real_in, rtx real_out, rtx *inloc, rtx *outloc, /* Narrow down the reg class, the same way push_reload will; otherwise we might find a dummy now, but push_reload won't. */ { - enum reg_class preferred_class = PREFERRED_RELOAD_CLASS (in, class); + enum reg_class preferred_class = PREFERRED_RELOAD_CLASS (in, rclass); if (preferred_class != NO_REGS) - class = preferred_class; + rclass = preferred_class; } /* See if OUT will do. */ @@ -1960,7 +1960,7 @@ find_dummy_reload (rtx real_in, rtx real_out, rtx *inloc, rtx *outloc, unsigned int i; for (i = 0; i < nwords; i++) - if (! TEST_HARD_REG_BIT (reg_class_contents[(int) class], + if (! TEST_HARD_REG_BIT (reg_class_contents[(int) rclass], regno + i)) break; @@ -2028,7 +2028,7 @@ find_dummy_reload (rtx real_in, rtx real_out, rtx *inloc, rtx *outloc, unsigned int i; for (i = 0; i < nwords; i++) - if (! TEST_HARD_REG_BIT (reg_class_contents[(int) class], + if (! TEST_HARD_REG_BIT (reg_class_contents[(int) rclass], regno + i)) break; @@ -4184,7 +4184,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, && rld[i].out == 0) { rld[i].reg_rtx - = find_equiv_reg (rld[i].in, insn, rld[i].class, -1, + = find_equiv_reg (rld[i].in, insn, rld[i].rclass, -1, static_reload_reg_p, 0, rld[i].inmode); /* Prevent generation of insn to load the value because the one we found already has the value. */ @@ -4453,7 +4453,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, if (i != j && rld[j].in != 0 && rld[j].out == 0 && rld[j].when_needed == rld[i].when_needed && MATCHES (rld[i].in, rld[j].in) - && rld[i].class == rld[j].class + && rld[i].rclass == rld[j].rclass && !rld[i].nocombine && !rld[j].nocombine && rld[i].reg_rtx == rld[j].reg_rtx) { @@ -4482,7 +4482,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, > GET_MODE_SIZE (rld[i].inmode))) ? rld[i].outmode : rld[i].inmode; - rld[i].nregs = CLASS_MAX_NREGS (rld[i].class, rld[i].mode); + rld[i].nregs = CLASS_MAX_NREGS (rld[i].rclass, rld[i].mode); } /* Special case a simple move with an input reload and a @@ -4499,14 +4499,14 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, unsigned int regno = REGNO (dest); if (regno < FIRST_PSEUDO_REGISTER - && TEST_HARD_REG_BIT (reg_class_contents[rld[i].class], regno) + && TEST_HARD_REG_BIT (reg_class_contents[rld[i].rclass], regno) && HARD_REGNO_MODE_OK (regno, rld[i].mode)) { int nr = hard_regno_nregs[regno][rld[i].mode]; int ok = 1, nri; for (nri = 1; nri < nr; nri ++) - if (! TEST_HARD_REG_BIT (reg_class_contents[rld[i].class], regno + nri)) + if (! TEST_HARD_REG_BIT (reg_class_contents[rld[i].rclass], regno + nri)) ok = 0; if (ok) @@ -5916,14 +5916,14 @@ find_reloads_address_1 (enum machine_mode mode, rtx x, int context, is larger than the class size, then reload the whole SUBREG. */ else { - enum reg_class class = context_reg_class; - if ((unsigned) CLASS_MAX_NREGS (class, GET_MODE (SUBREG_REG (x))) - > reg_class_size[class]) + enum reg_class rclass = context_reg_class; + if ((unsigned) CLASS_MAX_NREGS (rclass, GET_MODE (SUBREG_REG (x))) + > reg_class_size[rclass]) { x = find_reloads_subreg_address (x, 0, opnum, ADDR_TYPE (type), ind_levels, insn); - push_reload (x, NULL_RTX, loc, (rtx*) 0, class, + push_reload (x, NULL_RTX, loc, (rtx*) 0, rclass, GET_MODE (x), VOIDmode, 0, 0, opnum, type); return 1; } @@ -5954,7 +5954,7 @@ find_reloads_address_1 (enum machine_mode mode, rtx x, int context, } /* X, which is found at *LOC, is a part of an address that needs to be - reloaded into a register of class CLASS. If X is a constant, or if + reloaded into a register of class RCLASS. If X is a constant, or if X is a PLUS that contains a constant, check that the constant is a legitimate operand and that we are supposed to be able to load it into the register. @@ -5969,13 +5969,13 @@ find_reloads_address_1 (enum machine_mode mode, rtx x, int context, supports. */ static void -find_reloads_address_part (rtx x, rtx *loc, enum reg_class class, +find_reloads_address_part (rtx x, rtx *loc, enum reg_class rclass, enum machine_mode mode, int opnum, enum reload_type type, int ind_levels) { if (CONSTANT_P (x) && (! LEGITIMATE_CONSTANT_P (x) - || PREFERRED_RELOAD_CLASS (x, class) == NO_REGS)) + || PREFERRED_RELOAD_CLASS (x, rclass) == NO_REGS)) { x = force_const_mem (mode, x); find_reloads_address (mode, &x, XEXP (x, 0), &XEXP (x, 0), @@ -5985,7 +5985,7 @@ find_reloads_address_part (rtx x, rtx *loc, enum reg_class class, else if (GET_CODE (x) == PLUS && CONSTANT_P (XEXP (x, 1)) && (! LEGITIMATE_CONSTANT_P (XEXP (x, 1)) - || PREFERRED_RELOAD_CLASS (XEXP (x, 1), class) == NO_REGS)) + || PREFERRED_RELOAD_CLASS (XEXP (x, 1), rclass) == NO_REGS)) { rtx tem; @@ -5995,7 +5995,7 @@ find_reloads_address_part (rtx x, rtx *loc, enum reg_class class, opnum, type, ind_levels, 0); } - push_reload (x, NULL_RTX, loc, (rtx*) 0, class, + push_reload (x, NULL_RTX, loc, (rtx*) 0, rclass, mode, VOIDmode, 0, 0, opnum, type); } @@ -6600,7 +6600,7 @@ refers_to_mem_for_reload_p (rtx x) /* Check the insns before INSN to see if there is a suitable register containing the same value as GOAL. - If OTHER is -1, look for a register in class CLASS. + If OTHER is -1, look for a register in class RCLASS. Otherwise, just see if register number OTHER shares GOAL's value. Return an rtx for the register found, or zero if none is found. @@ -6626,7 +6626,7 @@ refers_to_mem_for_reload_p (rtx x) as if it were a constant except that sp is required to be unchanging. */ rtx -find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other, +find_equiv_reg (rtx goal, rtx insn, enum reg_class rclass, int other, short *reload_reg_p, int goalreg, enum machine_mode mode) { rtx p = insn; @@ -6772,7 +6772,7 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other, } else if ((unsigned) valueno >= FIRST_PSEUDO_REGISTER) continue; - else if (!in_hard_reg_set_p (reg_class_contents[(int) class], + else if (!in_hard_reg_set_p (reg_class_contents[(int) rclass], mode, valueno)) continue; value = valtry; @@ -7262,7 +7262,7 @@ debug_reload_to_stream (FILE *f) fprintf (f, "\n\t"); } - fprintf (f, "%s, ", reg_class_names[(int) rld[r].class]); + fprintf (f, "%s, ", reg_class_names[(int) rld[r].rclass]); fprintf (f, "%s (opnum = %d)", reload_when_needed_name[(int) rld[r].when_needed], diff --git a/gcc/reload.h b/gcc/reload.h index bfa7e6a8996..3873f5c9746 100644 --- a/gcc/reload.h +++ b/gcc/reload.h @@ -83,7 +83,7 @@ struct reload rtx out; /* The class of registers to reload into. */ - enum reg_class class; + enum reg_class rclass; /* The mode this operand should have when reloaded, on input. */ enum machine_mode inmode; diff --git a/gcc/reload1.c b/gcc/reload1.c index f449ffa9c32..f28b01c2714 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -1637,8 +1637,8 @@ reload_reg_class_lower (const void *r1p, const void *r2p) return t; /* Count all solitary classes before non-solitary ones. */ - t = ((reg_class_size[(int) rld[r2].class] == 1) - - (reg_class_size[(int) rld[r1].class] == 1)); + t = ((reg_class_size[(int) rld[r2].rclass] == 1) + - (reg_class_size[(int) rld[r1].rclass] == 1)); if (t != 0) return t; @@ -1648,7 +1648,7 @@ reload_reg_class_lower (const void *r1p, const void *r2p) return t; /* Consider reloads in order of increasing reg-class number. */ - t = (int) rld[r1].class - (int) rld[r2].class; + t = (int) rld[r1].rclass - (int) rld[r2].rclass; if (t != 0) return t; @@ -1777,7 +1777,7 @@ find_reg (struct insn_chain *chain, int order) COPY_HARD_REG_SET (not_usable, bad_spill_regs); IOR_HARD_REG_SET (not_usable, bad_spill_regs_global); - IOR_COMPL_HARD_REG_SET (not_usable, reg_class_contents[rl->class]); + IOR_COMPL_HARD_REG_SET (not_usable, reg_class_contents[rl->rclass]); CLEAR_HARD_REG_SET (used_by_other_reload); for (k = 0; k < order; k++) @@ -1918,7 +1918,7 @@ find_reload_regs (struct insn_chain *chain) { if (dump_file) fprintf (dump_file, "reload failure for reload %d\n", r); - spill_failure (chain->insn, rld[r].class); + spill_failure (chain->insn, rld[r].rclass); failure = 1; return; } @@ -1976,16 +1976,16 @@ delete_caller_save_insns (void) INSN should be one of the insns which needed this particular spill reg. */ static void -spill_failure (rtx insn, enum reg_class class) +spill_failure (rtx insn, enum reg_class rclass) { if (asm_noperands (PATTERN (insn)) >= 0) error_for_asm (insn, "can't find a register in class %qs while " "reloading %<asm%>", - reg_class_names[class]); + reg_class_names[rclass]); else { error ("unable to find a register to spill in class %qs", - reg_class_names[class]); + reg_class_names[rclass]); if (dump_file) { @@ -2394,7 +2394,7 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn, enum rtx_code code = GET_CODE (x); struct elim_table *ep; int regno; - rtx new; + rtx new_rtx; int i, j; const char *fmt; int copied = 0; @@ -2523,15 +2523,15 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn, && reg_equiv_constant[REGNO (new0)] != 0) new0 = reg_equiv_constant[REGNO (new0)]; - new = form_sum (new0, new1); + new_rtx = form_sum (new0, new1); /* As above, if we are not inside a MEM we do not want to turn a PLUS into something else. We might try to do so here for an addition of 0 if we aren't optimizing. */ - if (! mem_mode && GET_CODE (new) != PLUS) - return gen_rtx_PLUS (GET_MODE (x), new, const0_rtx); + if (! mem_mode && GET_CODE (new_rtx) != PLUS) + return gen_rtx_PLUS (GET_MODE (x), new_rtx, const0_rtx); else - return new; + return new_rtx; } } return x; @@ -2588,8 +2588,8 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn, /* If we have something in XEXP (x, 0), the usual case, eliminate it. */ if (XEXP (x, 0)) { - new = eliminate_regs_1 (XEXP (x, 0), mem_mode, insn, true); - if (new != XEXP (x, 0)) + new_rtx = eliminate_regs_1 (XEXP (x, 0), mem_mode, insn, true); + if (new_rtx != XEXP (x, 0)) { /* If this is a REG_DEAD note, it is not valid anymore. Using the eliminated version could result in creating a @@ -2599,7 +2599,7 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn, ? eliminate_regs_1 (XEXP (x, 1), mem_mode, insn, true) : NULL_RTX); - x = gen_rtx_EXPR_LIST (REG_NOTE_KIND (x), new, XEXP (x, 1)); + x = gen_rtx_EXPR_LIST (REG_NOTE_KIND (x), new_rtx, XEXP (x, 1)); } } @@ -2611,10 +2611,10 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn, strictly needed, but it simplifies the code. */ if (XEXP (x, 1)) { - new = eliminate_regs_1 (XEXP (x, 1), mem_mode, insn, true); - if (new != XEXP (x, 1)) + new_rtx = eliminate_regs_1 (XEXP (x, 1), mem_mode, insn, true); + if (new_rtx != XEXP (x, 1)) return - gen_rtx_fmt_ee (GET_CODE (x), GET_MODE (x), XEXP (x, 0), new); + gen_rtx_fmt_ee (GET_CODE (x), GET_MODE (x), XEXP (x, 0), new_rtx); } return x; @@ -2636,13 +2636,13 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn, if (GET_CODE (XEXP (x, 1)) == PLUS && XEXP (XEXP (x, 1), 0) == XEXP (x, 0)) { - rtx new = eliminate_regs_1 (XEXP (XEXP (x, 1), 1), mem_mode, + rtx new_rtx = eliminate_regs_1 (XEXP (XEXP (x, 1), 1), mem_mode, insn, true); - if (new != XEXP (XEXP (x, 1), 1)) + if (new_rtx != XEXP (XEXP (x, 1), 1)) return gen_rtx_fmt_ee (code, GET_MODE (x), XEXP (x, 0), gen_rtx_PLUS (GET_MODE (x), - XEXP (x, 0), new)); + XEXP (x, 0), new_rtx)); } return x; @@ -2660,9 +2660,9 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn, case POPCOUNT: case PARITY: case BSWAP: - new = eliminate_regs_1 (XEXP (x, 0), mem_mode, insn, false); - if (new != XEXP (x, 0)) - return gen_rtx_fmt_e (code, GET_MODE (x), new); + new_rtx = eliminate_regs_1 (XEXP (x, 0), mem_mode, insn, false); + if (new_rtx != XEXP (x, 0)) + return gen_rtx_fmt_e (code, GET_MODE (x), new_rtx); return x; case SUBREG: @@ -2678,17 +2678,17 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn, && reg_equiv_memory_loc != 0 && reg_equiv_memory_loc[REGNO (SUBREG_REG (x))] != 0) { - new = SUBREG_REG (x); + new_rtx = SUBREG_REG (x); } else - new = eliminate_regs_1 (SUBREG_REG (x), mem_mode, insn, false); + new_rtx = eliminate_regs_1 (SUBREG_REG (x), mem_mode, insn, false); - if (new != SUBREG_REG (x)) + if (new_rtx != SUBREG_REG (x)) { int x_size = GET_MODE_SIZE (GET_MODE (x)); - int new_size = GET_MODE_SIZE (GET_MODE (new)); + int new_size = GET_MODE_SIZE (GET_MODE (new_rtx)); - if (MEM_P (new) + if (MEM_P (new_rtx) && ((x_size < new_size #ifdef WORD_REGISTER_OPERATIONS /* On these machines, combine can create rtl of the form @@ -2704,9 +2704,9 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn, ) || x_size == new_size) ) - return adjust_address_nv (new, GET_MODE (x), SUBREG_BYTE (x)); + return adjust_address_nv (new_rtx, GET_MODE (x), SUBREG_BYTE (x)); else - return gen_rtx_SUBREG (GET_MODE (x), new, SUBREG_BYTE (x)); + return gen_rtx_SUBREG (GET_MODE (x), new_rtx, SUBREG_BYTE (x)); } return x; @@ -2722,9 +2722,9 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn, case USE: /* Handle insn_list USE that a call to a pure function may generate. */ - new = eliminate_regs_1 (XEXP (x, 0), 0, insn, false); - if (new != XEXP (x, 0)) - return gen_rtx_USE (GET_MODE (x), new); + new_rtx = eliminate_regs_1 (XEXP (x, 0), 0, insn, false); + if (new_rtx != XEXP (x, 0)) + return gen_rtx_USE (GET_MODE (x), new_rtx); return x; case CLOBBER: @@ -2743,21 +2743,21 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn, { if (*fmt == 'e') { - new = eliminate_regs_1 (XEXP (x, i), mem_mode, insn, false); - if (new != XEXP (x, i) && ! copied) + new_rtx = eliminate_regs_1 (XEXP (x, i), mem_mode, insn, false); + if (new_rtx != XEXP (x, i) && ! copied) { x = shallow_copy_rtx (x); copied = 1; } - XEXP (x, i) = new; + XEXP (x, i) = new_rtx; } else if (*fmt == 'E') { int copied_vec = 0; for (j = 0; j < XVECLEN (x, i); j++) { - new = eliminate_regs_1 (XVECEXP (x, i, j), mem_mode, insn, false); - if (new != XVECEXP (x, i, j) && ! copied_vec) + new_rtx = eliminate_regs_1 (XVECEXP (x, i, j), mem_mode, insn, false); + if (new_rtx != XVECEXP (x, i, j) && ! copied_vec) { rtvec new_v = gen_rtvec_v (XVECLEN (x, i), XVEC (x, i)->elem); @@ -2769,7 +2769,7 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn, XVEC (x, i) = new_v; copied_vec = 1; } - XVECEXP (x, i, j) = new; + XVECEXP (x, i, j) = new_rtx; } } } @@ -5474,7 +5474,7 @@ allocate_reload_reg (struct insn_chain *chain ATTRIBUTE_UNUSED, int r, for (count = 0; count < n_spills; count++) { - int class = (int) rld[r].class; + int rclass = (int) rld[r].rclass; int regnum; i++; @@ -5491,7 +5491,7 @@ allocate_reload_reg (struct insn_chain *chain ATTRIBUTE_UNUSED, int r, && free_for_value_p (regnum, rld[r].mode, rld[r].opnum, rld[r].when_needed, rld[r].in, rld[r].out, r, 1))) - && TEST_HARD_REG_BIT (reg_class_contents[class], regnum) + && TEST_HARD_REG_BIT (reg_class_contents[rclass], regnum) && HARD_REGNO_MODE_OK (regnum, rld[r].mode) /* Look first for regs to share, then for unshared. But don't share regs used for inherited reloads; they are @@ -5521,7 +5521,7 @@ allocate_reload_reg (struct insn_chain *chain ATTRIBUTE_UNUSED, int r, while (nr > 1) { int regno = regnum + nr - 1; - if (!(TEST_HARD_REG_BIT (reg_class_contents[class], regno) + if (!(TEST_HARD_REG_BIT (reg_class_contents[rclass], regno) && spill_reg_order[regno] >= 0 && reload_reg_free_p (regno, rld[r].opnum, rld[r].when_needed))) @@ -5647,7 +5647,7 @@ choose_reload_regs (struct insn_chain *chain) { max_group_size = MAX (rld[j].nregs, max_group_size); group_class - = reg_class_superunion[(int) rld[j].class][(int) group_class]; + = reg_class_superunion[(int) rld[j].rclass][(int) group_class]; } save_reload_reg_rtx[j] = rld[j].reg_rtx; @@ -5793,7 +5793,7 @@ choose_reload_regs (struct insn_chain *chain) #endif ) { - enum reg_class class = rld[r].class, last_class; + enum reg_class rclass = rld[r].rclass, last_class; rtx last_reg = reg_last_reload_reg[regno]; enum machine_mode need_mode; @@ -5814,18 +5814,18 @@ choose_reload_regs (struct insn_chain *chain) && reg_reloaded_contents[i] == regno && TEST_HARD_REG_BIT (reg_reloaded_valid, i) && HARD_REGNO_MODE_OK (i, rld[r].mode) - && (TEST_HARD_REG_BIT (reg_class_contents[(int) class], i) + && (TEST_HARD_REG_BIT (reg_class_contents[(int) rclass], i) /* Even if we can't use this register as a reload register, we might use it for reload_override_in, if copying it to the desired class is cheap enough. */ - || ((REGISTER_MOVE_COST (mode, last_class, class) - < MEMORY_MOVE_COST (mode, class, 1)) - && (secondary_reload_class (1, class, mode, + || ((REGISTER_MOVE_COST (mode, last_class, rclass) + < MEMORY_MOVE_COST (mode, rclass, 1)) + && (secondary_reload_class (1, rclass, mode, last_reg) == NO_REGS) #ifdef SECONDARY_MEMORY_NEEDED - && ! SECONDARY_MEMORY_NEEDED (last_class, class, + && ! SECONDARY_MEMORY_NEEDED (last_class, rclass, mode) #endif )) @@ -5857,7 +5857,7 @@ choose_reload_regs (struct insn_chain *chain) bad_for_class = 0; for (k = 0; k < nr; k++) - bad_for_class |= ! TEST_HARD_REG_BIT (reg_class_contents[(int) rld[r].class], + bad_for_class |= ! TEST_HARD_REG_BIT (reg_class_contents[(int) rld[r].rclass], i+k); /* We found a register that contains the @@ -5939,7 +5939,7 @@ choose_reload_regs (struct insn_chain *chain) || REG_P (rld[r].in) || MEM_P (rld[r].in)) && (rld[r].nregs == max_group_size - || ! reg_classes_intersect_p (rld[r].class, group_class))) + || ! reg_classes_intersect_p (rld[r].rclass, group_class))) search_equiv = rld[r].in; /* If this is an output reload from a simple move insn, look if an equivalence for the input is available. */ @@ -5956,7 +5956,7 @@ choose_reload_regs (struct insn_chain *chain) if (search_equiv) { rtx equiv - = find_equiv_reg (search_equiv, insn, rld[r].class, + = find_equiv_reg (search_equiv, insn, rld[r].rclass, -1, NULL, 0, rld[r].mode); int regno = 0; @@ -5997,7 +5997,7 @@ choose_reload_regs (struct insn_chain *chain) { regs_used |= TEST_HARD_REG_BIT (reload_reg_used_at_all, i); - bad_for_class |= ! TEST_HARD_REG_BIT (reg_class_contents[(int) rld[r].class], + bad_for_class |= ! TEST_HARD_REG_BIT (reg_class_contents[(int) rld[r].rclass], i); } @@ -6135,9 +6135,9 @@ choose_reload_regs (struct insn_chain *chain) || rld[s].optional) continue; - if ((rld[s].class != rld[r].class - && reg_classes_intersect_p (rld[r].class, - rld[s].class)) + if ((rld[s].rclass != rld[r].rclass + && reg_classes_intersect_p (rld[r].rclass, + rld[s].rclass)) || rld[s].nregs < rld[r].nregs) break; } @@ -6818,7 +6818,7 @@ emit_input_reload_insns (struct insn_chain *chain, struct reload *rl, sri.icode = CODE_FOR_nothing; sri.prev_sri = NULL; - new_class = targetm.secondary_reload (1, real_oldequiv, rl->class, + new_class = targetm.secondary_reload (1, real_oldequiv, rl->rclass, mode, &sri); if (new_class == NO_REGS && sri.icode == CODE_FOR_nothing) @@ -7008,7 +7008,7 @@ emit_output_reload_insns (struct insn_chain *chain, struct reload *rl, && reg_equiv_mem[REGNO (old)] != 0) real_old = reg_equiv_mem[REGNO (old)]; - if (secondary_reload_class (0, rl->class, mode, real_old) != NO_REGS) + if (secondary_reload_class (0, rl->rclass, mode, real_old) != NO_REGS) { rtx second_reloadreg = reloadreg; reloadreg = rld[secondary_reload].reg_rtx; diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index d569ff04b2b..fb4a5df7dc8 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -2470,32 +2470,32 @@ replace_rtx (rtx x, rtx from, rtx to) if (GET_CODE (x) == SUBREG) { - rtx new = replace_rtx (SUBREG_REG (x), from, to); + rtx new_rtx = replace_rtx (SUBREG_REG (x), from, to); - if (GET_CODE (new) == CONST_INT) + if (GET_CODE (new_rtx) == CONST_INT) { - x = simplify_subreg (GET_MODE (x), new, + x = simplify_subreg (GET_MODE (x), new_rtx, GET_MODE (SUBREG_REG (x)), SUBREG_BYTE (x)); gcc_assert (x); } else - SUBREG_REG (x) = new; + SUBREG_REG (x) = new_rtx; return x; } else if (GET_CODE (x) == ZERO_EXTEND) { - rtx new = replace_rtx (XEXP (x, 0), from, to); + rtx new_rtx = replace_rtx (XEXP (x, 0), from, to); - if (GET_CODE (new) == CONST_INT) + if (GET_CODE (new_rtx) == CONST_INT) { x = simplify_unary_operation (ZERO_EXTEND, GET_MODE (x), - new, GET_MODE (XEXP (x, 0))); + new_rtx, GET_MODE (XEXP (x, 0))); gcc_assert (x); } else - XEXP (x, 0) = new; + XEXP (x, 0) = new_rtx; return x; } @@ -3692,12 +3692,12 @@ nonzero_bits1 (const_rtx x, enum machine_mode mode, const_rtx known_x, { unsigned HOST_WIDE_INT nonzero_for_hook = nonzero; - rtx new = rtl_hooks.reg_nonzero_bits (x, mode, known_x, + rtx new_rtx = rtl_hooks.reg_nonzero_bits (x, mode, known_x, known_mode, known_ret, &nonzero_for_hook); - if (new) - nonzero_for_hook &= cached_nonzero_bits (new, mode, known_x, + if (new_rtx) + nonzero_for_hook &= cached_nonzero_bits (new_rtx, mode, known_x, known_mode, known_ret); return nonzero_for_hook; @@ -4177,12 +4177,12 @@ num_sign_bit_copies1 (const_rtx x, enum machine_mode mode, const_rtx known_x, { unsigned int copies_for_hook = 1, copies = 1; - rtx new = rtl_hooks.reg_num_sign_bit_copies (x, mode, known_x, + rtx new_rtx = rtl_hooks.reg_num_sign_bit_copies (x, mode, known_x, known_mode, known_ret, &copies_for_hook); - if (new) - copies = cached_num_sign_bit_copies (new, mode, known_x, + if (new_rtx) + copies = cached_num_sign_bit_copies (new_rtx, mode, known_x, known_mode, known_ret); if (copies > 1 || copies_for_hook > 1) diff --git a/gcc/rtlhooks.c b/gcc/rtlhooks.c index 432b286c1d8..25fbc094830 100644 --- a/gcc/rtlhooks.c +++ b/gcc/rtlhooks.c @@ -141,7 +141,7 @@ gen_lowpart_if_possible (enum machine_mode mode, rtx x) { /* This is the only other case we handle. */ int offset = 0; - rtx new; + rtx new_rtx; if (WORDS_BIG_ENDIAN) offset = (MAX (GET_MODE_SIZE (GET_MODE (x)), UNITS_PER_WORD) @@ -152,11 +152,11 @@ gen_lowpart_if_possible (enum machine_mode mode, rtx x) offset -= (MIN (UNITS_PER_WORD, GET_MODE_SIZE (mode)) - MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (x)))); - new = adjust_address_nv (x, mode, offset); - if (! memory_address_p (mode, XEXP (new, 0))) + new_rtx = adjust_address_nv (x, mode, offset); + if (! memory_address_p (mode, XEXP (new_rtx, 0))) return 0; - return new; + return new_rtx; } else if (mode != GET_MODE (x) && GET_MODE (x) != VOIDmode && validate_subreg (mode, GET_MODE (x), x, diff --git a/gcc/sched-ebb.c b/gcc/sched-ebb.c index 58a89346cf0..25b97c395d1 100644 --- a/gcc/sched-ebb.c +++ b/gcc/sched-ebb.c @@ -357,7 +357,7 @@ static void add_deps_for_risky_insns (rtx head, rtx tail) { rtx insn, prev; - int class; + int classification; rtx last_jump = NULL_RTX; rtx next_tail = NEXT_INSN (tail); basic_block last_block = NULL, bb; @@ -372,9 +372,9 @@ add_deps_for_risky_insns (rtx head, rtx tail) } else if (INSN_P (insn) && last_jump != NULL_RTX) { - class = haifa_classify_insn (insn); + classification = haifa_classify_insn (insn); prev = last_jump; - switch (class) + switch (classification) { case PFREE_CANDIDATE: if (flag_schedule_speculative_load) diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c index abb2c8d6f6c..28f528302ff 100644 --- a/gcc/sched-rgn.c +++ b/gcc/sched-rgn.c @@ -2388,10 +2388,10 @@ static struct deps *bb_deps; static rtx concat_INSN_LIST (rtx copy, rtx old) { - rtx new = old; + rtx new_rtx = old; for (; copy ; copy = XEXP (copy, 1)) - new = alloc_INSN_LIST (XEXP (copy, 0), new); - return new; + new_rtx = alloc_INSN_LIST (XEXP (copy, 0), new_rtx); + return new_rtx; } static void diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 2b48ea60370..17654611e1a 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -163,12 +163,12 @@ variable_size (tree size) #endif /* Return the machine mode to use for a nonscalar of SIZE bits. The - mode must be in class CLASS, and have exactly that many value bits; + mode must be in class MCLASS, and have exactly that many value bits; it may have padding as well. If LIMIT is nonzero, modes of wider than MAX_FIXED_MODE_SIZE will not be used. */ enum machine_mode -mode_for_size (unsigned int size, enum mode_class class, int limit) +mode_for_size (unsigned int size, enum mode_class mclass, int limit) { enum machine_mode mode; @@ -176,7 +176,7 @@ mode_for_size (unsigned int size, enum mode_class class, int limit) return BLKmode; /* Get the first mode which has this size, in the specified class. */ - for (mode = GET_CLASS_NARROWEST_MODE (class); mode != VOIDmode; + for (mode = GET_CLASS_NARROWEST_MODE (mclass); mode != VOIDmode; mode = GET_MODE_WIDER_MODE (mode)) if (GET_MODE_PRECISION (mode) == size) return mode; @@ -187,7 +187,7 @@ mode_for_size (unsigned int size, enum mode_class class, int limit) /* Similar, except passed a tree node. */ enum machine_mode -mode_for_size_tree (const_tree size, enum mode_class class, int limit) +mode_for_size_tree (const_tree size, enum mode_class mclass, int limit) { unsigned HOST_WIDE_INT uhwi; unsigned int ui; @@ -198,20 +198,20 @@ mode_for_size_tree (const_tree size, enum mode_class class, int limit) ui = uhwi; if (uhwi != ui) return BLKmode; - return mode_for_size (ui, class, limit); + return mode_for_size (ui, mclass, limit); } /* Similar, but never return BLKmode; return the narrowest mode that contains at least the requested number of value bits. */ enum machine_mode -smallest_mode_for_size (unsigned int size, enum mode_class class) +smallest_mode_for_size (unsigned int size, enum mode_class mclass) { enum machine_mode mode; /* Get the first mode which has at least this size, in the specified class. */ - for (mode = GET_CLASS_NARROWEST_MODE (class); mode != VOIDmode; + for (mode = GET_CLASS_NARROWEST_MODE (mclass); mode != VOIDmode; mode = GET_MODE_WIDER_MODE (mode)) if (GET_MODE_PRECISION (mode) >= size) return mode; diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 1cb561480b8..4064ad47411 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -581,7 +581,7 @@ default_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x ATTRIBUTE_UNUSED, enum machine_mode reload_mode ATTRIBUTE_UNUSED, secondary_reload_info *sri) { - enum reg_class class = NO_REGS; + enum reg_class rclass = NO_REGS; if (sri->prev_sri && sri->prev_sri->t_icode != CODE_FOR_nothing) { @@ -590,13 +590,13 @@ default_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x ATTRIBUTE_UNUSED, } #ifdef SECONDARY_INPUT_RELOAD_CLASS if (in_p) - class = SECONDARY_INPUT_RELOAD_CLASS (reload_class, reload_mode, x); + rclass = SECONDARY_INPUT_RELOAD_CLASS (reload_class, reload_mode, x); #endif #ifdef SECONDARY_OUTPUT_RELOAD_CLASS if (! in_p) - class = SECONDARY_OUTPUT_RELOAD_CLASS (reload_class, reload_mode, x); + rclass = SECONDARY_OUTPUT_RELOAD_CLASS (reload_class, reload_mode, x); #endif - if (class != NO_REGS) + if (rclass != NO_REGS) { enum insn_code icode = (in_p ? reload_in_optab[(int) reload_mode] : reload_out_optab[(int) reload_mode]); @@ -648,19 +648,19 @@ default_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x ATTRIBUTE_UNUSED, if (reg_class_subset_p (reload_class, insn_class)) { - gcc_assert (scratch_class == class); - class = NO_REGS; + gcc_assert (scratch_class == rclass); + rclass = NO_REGS; } else - class = insn_class; + rclass = insn_class; } - if (class == NO_REGS) + if (rclass == NO_REGS) sri->icode = icode; else sri->t_icode = icode; } - return class; + return rclass; } bool diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3e7162570e1..528a1114b30 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,43 @@ +2008-07-17 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/36855 + * g++.dg/ext/has_trivial_destructor.C: Rename to... + * g++.dg/ext/has_trivial_destructor-1.C: ... this. + * g++.dg/ext/has_trivial_destructor-2.C: New. + +2008-07-17 Paolo Bonzini <bonzini@gnu.org> + + PR rtl-optimization/36753 + * gcc.target/i386/pr36753.c: New. + +2008-07-17 Tobias Burnus <burnus@net-b.de> + + PR fortran/36825 + PR fortran/36824 + * gfortran.dg/rank_2.f90: Add additional array-rank test. + * gfortran.dg/array_4.f90: New. + +2008-07-17 H.J. Lu <hongjiu.lu@intel.com> + + PR testsuite/36443 + * objc.dg/gnu-encoding/gnu-encoding.exp: Temporarily unset + GCC_EXEC_PREFIX from environment when running $HOSTCC. + +2008-07-16 Dodji Seketeli <dseketel@redhat.com> + + PR c++/13699 + * g++.dg/lookup/extern-c-redecl.C: New test. + +2008-07-15 Richard Guenther <rguenther@suse.de> + + PR middle-end/36369 + * gcc.dg/Wstrict-aliasing-bogus-ref-all.c: New testcase. + +2008-07-15 Andrew Pinski <andrew_pinski@playstation.sony.com> + + PR target/31568 + * gcc.target/powerpc/asm-y.c: New testcase. + 2008-07-14 Eric Botcazou <ebotcazou@adacore.com> * case_optimization1.ad[sb]: New test. diff --git a/gcc/testsuite/g++.dg/ext/has_trivial_destructor.C b/gcc/testsuite/g++.dg/ext/has_trivial_destructor.C deleted file mode 100644 index 719f05fd7a5..00000000000 --- a/gcc/testsuite/g++.dg/ext/has_trivial_destructor.C +++ /dev/null @@ -1,86 +0,0 @@ -// { dg-do "run" } -#include <cassert> - -struct A -{ - double a; - double b; -}; - -union U -{ - double a; - double b; -}; - -struct B -{ - ~B() { } -}; - -struct C -: public B { }; - -struct D -: public A { }; - -template<typename T> - bool - f() - { return __has_trivial_destructor(T); } - -template<typename T> - class My - { - public: - bool - f() - { return !!__has_trivial_destructor(T); } - }; - -template<typename T> - class My2 - { - public: - static const bool trait = __has_trivial_destructor(T); - }; - -template<typename T> - const bool My2<T>::trait; - -template<typename T, bool b = __has_trivial_destructor(T)> - struct My3_help - { static const bool trait = b; }; - -template<typename T, bool b> - const bool My3_help<T, b>::trait; - -template<typename T> - class My3 - { - public: - bool - f() - { return My3_help<T>::trait; } - }; - -#define PTEST(T) (__has_trivial_destructor(T) && f<T>() \ - && My<T>().f() && My2<T>::trait && My3<T>().f()) - -#define NTEST(T) (!__has_trivial_destructor(T) && !f<T>() \ - && !My<T>().f() && !My2<T>::trait && !My3<T>().f()) - -int main() -{ - assert (PTEST (int)); - assert (NTEST (int (int))); - assert (NTEST (void)); - assert (PTEST (A)); - assert (PTEST (U)); - assert (NTEST (B)); - assert (NTEST (C)); - assert (PTEST (D)); - assert (PTEST (D[])); - - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20080704-1.c b/gcc/testsuite/gcc.c-torture/compile/20080704-1.c index 9ca457cb952..b5e38b4ba60 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20080704-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/20080704-1.c @@ -1,5 +1,5 @@ /* This code used to crash fold_convert due to PRE - wanting to fold_convert from a REA_TYPE to an INTEGER_TYPE. */ + wanting to fold_convert from a REAL_TYPE to an INTEGER_TYPE. */ typedef unsigned int uint32_t; union double_union { diff --git a/gcc/testsuite/gfortran.dg/rank_2.f90 b/gcc/testsuite/gfortran.dg/rank_2.f90 index b7d75dbeae4..cd52cc446e2 100644 --- a/gcc/testsuite/gfortran.dg/rank_2.f90 +++ b/gcc/testsuite/gfortran.dg/rank_2.f90 @@ -5,4 +5,8 @@ ! Fortran 2008 allows 15 dimensions (including co-array ranks) ! integer :: a(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ! { dg-error "more than 7 dimensions" } + +! PR fortran/36825: +integer,parameter :: N=10 +complex,dimension(-N:N,-N:N,0:1,0:1,-N:N,-N:N,0:1,0:1) :: P ! { dg-error "more than 7 dimensions" } end diff --git a/gcc/testsuite/objc.dg/gnu-encoding/gnu-encoding.exp b/gcc/testsuite/objc.dg/gnu-encoding/gnu-encoding.exp index dc4d9245a32..75d1dcf6316 100644 --- a/gcc/testsuite/objc.dg/gnu-encoding/gnu-encoding.exp +++ b/gcc/testsuite/objc.dg/gnu-encoding/gnu-encoding.exp @@ -37,8 +37,20 @@ set generator_src "$srcdir/$subdir/struct-layout-encoding-1_generate.c" set generator_src "$generator_src $srcdir/$subdir/generate-random.c" set generator_src "$generator_src $srcdir/$subdir/generate-random_r.c" set generator_cmd "-o $generator $generator_src" +# Temporarily unset GCC_EXEC_PREFIX from environment, as that might +# confuse the $HOSTCC. +set orig_gcc_exec_prefix_saved 0 +if [info exists env(GCC_EXEC_PREFIX)] { + set orig_gcc_exec_prefix "$env(GCC_EXEC_PREFIX)" + set orig_gcc_exec_prefix_saved 1 + unsetenv GCC_EXEC_PREFIX +} set status [remote_exec build "$HOSTCC $HOSTCFLAGS $generator_cmd"] set status [lindex $status 0] +if { $orig_gcc_exec_prefix_saved } { + set orig_gcc_exec_prefix_saved 0 + setenv GCC_EXEC_PREFIX "$orig_gcc_exec_prefix" +} if { $status == 0 } then { file delete -force $tstobjdir file mkdir $tstobjdir diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 07290bc48c4..efa934fb853 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -193,8 +193,13 @@ pre_expr_eq (const void *p1, const void *p2) switch (e1->kind) { case CONSTANT: - return expressions_equal_p (PRE_EXPR_CONSTANT (e1), - PRE_EXPR_CONSTANT (e2)); + { + tree const0 = PRE_EXPR_CONSTANT (e1); + tree const1 = PRE_EXPR_CONSTANT (e2); + return TREE_TYPE (const1) == TREE_TYPE (const0) + && expressions_equal_p (const0, const1); + } + break; case NAME: return PRE_EXPR_NAME (e1) == PRE_EXPR_NAME (e2); case NARY: @@ -316,8 +321,9 @@ get_or_alloc_expr_for_name (tree name) result_id = lookup_expression_id (result); if (result_id != 0) { - pool_free (pre_expr_pool, result); - result = expression_for_id (result_id); + pre_expr newresult = expression_for_id (result_id); + pool_free (pre_expr_pool, result); + result = newresult; return result; } get_or_alloc_expression_id (result); @@ -994,8 +1000,9 @@ get_or_alloc_expr_for_constant (tree constant) result_id = lookup_expression_id (newexpr); if (result_id != 0) { - pool_free (pre_expr_pool, newexpr); - newexpr = expression_for_id (result_id); + pre_expr newresult = expression_for_id (result_id); + pool_free (pre_expr_pool, newexpr); + newexpr = newresult; return newexpr; } value_id = get_or_alloc_constant_value_id (constant); @@ -1009,7 +1016,7 @@ get_or_alloc_expr_for_constant (tree constant) a constant. */ static tree -get_constant_for_value_id (unsigned int v) +get_constant_for_value_id (unsigned int v, tree type) { if (value_id_constant_p (v)) { @@ -1020,7 +1027,8 @@ get_constant_for_value_id (unsigned int v) FOR_EACH_EXPR_ID_IN_SET (exprset, i, bi) { pre_expr expr = expression_for_id (i); - if (expr->kind == CONSTANT) + if (expr->kind == CONSTANT + && TREE_TYPE (PRE_EXPR_CONSTANT (expr)) == type) return PRE_EXPR_CONSTANT (expr); } } @@ -1064,8 +1072,10 @@ fully_constant_expression (pre_expr e) pre_expr rep1 = get_or_alloc_expr_for (naryop1); unsigned int vrep0 = get_expr_value_id (rep0); unsigned int vrep1 = get_expr_value_id (rep1); - tree const0 = get_constant_for_value_id (vrep0); - tree const1 = get_constant_for_value_id (vrep1); + tree const0 = get_constant_for_value_id (vrep0, + TREE_TYPE (nary->op[0])); + tree const1 = get_constant_for_value_id (vrep1, + TREE_TYPE (nary->op[1])); tree result = NULL; if (const0 && const1) { @@ -1087,7 +1097,8 @@ fully_constant_expression (pre_expr e) tree naryop0 = nary->op[0]; pre_expr rep0 = get_or_alloc_expr_for (naryop0); unsigned int vrep0 = get_expr_value_id (rep0); - tree const0 = get_constant_for_value_id (vrep0); + tree const0 = get_constant_for_value_id (vrep0, + TREE_TYPE (nary->op[0])); tree result = NULL; if (const0) { @@ -2599,9 +2610,14 @@ static tree find_or_generate_expression (basic_block block, pre_expr expr, tree stmts, tree domstmt) { - pre_expr leader = bitmap_find_leader (AVAIL_OUT (block), - get_expr_value_id (expr), domstmt); + pre_expr leader; tree genop = NULL; + + if (expr->kind == CONSTANT) + return PRE_EXPR_CONSTANT (expr); + + leader = bitmap_find_leader (AVAIL_OUT (block), + get_expr_value_id (expr), domstmt); if (leader) { if (leader->kind == NAME) @@ -2705,14 +2721,10 @@ create_expression_by_pieces (basic_block block, pre_expr expr, tree stmts, stmts, domstmt); if (!genop1 || !genop2) return NULL_TREE; + genop1 = fold_convert (TREE_TYPE (nary->op[0]), genop1); - /* Ensure op2 is a sizetype for POINTER_PLUS_EXPR. It - may be a constant with the wrong type. */ - if (nary->opcode == POINTER_PLUS_EXPR) - genop2 = fold_convert (sizetype, genop2); - else - genop2 = fold_convert (TREE_TYPE (nary->op[1]), genop2); + genop2 = fold_convert (TREE_TYPE (nary->op[1]), genop2); folded = fold_build2 (nary->opcode, nary->type, genop1, genop2); @@ -3141,9 +3153,16 @@ do_regular_insertion (basic_block block, basic_block dom) } eprime = fully_constant_expression (eprime); - vprime = get_expr_value_id (eprime); - edoubleprime = bitmap_find_leader (AVAIL_OUT (bprime), - vprime, NULL_TREE); + if (eprime->kind == CONSTANT) + { + edoubleprime = eprime; + } + else + { + vprime = get_expr_value_id (eprime); + edoubleprime = bitmap_find_leader (AVAIL_OUT (bprime), + vprime, NULL_TREE); + } if (edoubleprime == NULL) { avail[bprime->index] = eprime; @@ -3275,9 +3294,17 @@ do_partial_partial_insertion (basic_block block, basic_block dom) } eprime = fully_constant_expression (eprime); - vprime = get_expr_value_id (eprime); - edoubleprime = bitmap_find_leader (AVAIL_OUT (bprime), - vprime, NULL_TREE); + if (eprime->kind == CONSTANT) + { + edoubleprime = eprime; + } + else + { + vprime = get_expr_value_id (eprime); + edoubleprime = bitmap_find_leader (AVAIL_OUT (bprime), + vprime, NULL_TREE); + } + if (edoubleprime == NULL) { by_all = false; diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index f1318656b9b..69945a5c3c7 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -2582,6 +2582,8 @@ expressions_equal_p (tree e1, tree e2) te1 = TREE_TYPE (e1); te2 = TREE_TYPE (e2); + if (te1 != te2) + return false; if (TREE_CODE (e1) == TREE_LIST && TREE_CODE (e2) == TREE_LIST) { diff --git a/gcc/tree.c b/gcc/tree.c index 0bb9fd9367f..6441ae6ef33 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -5499,6 +5499,11 @@ build_pointer_type_for_mode (tree to_type, enum machine_mode mode, if (to_type == error_mark_node) return error_mark_node; + /* If the pointed-to type has the may_alias attribute set, force + a TYPE_REF_CAN_ALIAS_ALL pointer to be generated. */ + if (lookup_attribute ("may_alias", TYPE_ATTRIBUTES (to_type))) + can_alias_all = true; + /* In some cases, languages will have things that aren't a POINTER_TYPE (such as a RECORD_TYPE for fat pointers in Ada) as TYPE_POINTER_TO. In that case, return that type without regard to the rest of our @@ -5555,6 +5560,14 @@ build_reference_type_for_mode (tree to_type, enum machine_mode mode, { tree t; + if (to_type == error_mark_node) + return error_mark_node; + + /* If the pointed-to type has the may_alias attribute set, force + a TYPE_REF_CAN_ALIAS_ALL pointer to be generated. */ + if (lookup_attribute ("may_alias", TYPE_ATTRIBUTES (to_type))) + can_alias_all = true; + /* In some cases, languages will have things that aren't a REFERENCE_TYPE (such as a RECORD_TYPE for fat pointers in Ada) as TYPE_REFERENCE_TO. In that case, return that type without regard to the rest of our diff --git a/gcc/varasm.c b/gcc/varasm.c index 49cdda4c9a5..ad2421298ba 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -470,9 +470,9 @@ static int section_entry_eq (const void *p1, const void *p2) { const section *old = (const section *) p1; - const char *new = (const char *) p2; + const char *new_name = (const char *) p2; - return strcmp (old->named.name, new) == 0; + return strcmp (old->named.name, new_name) == 0; } static hashval_t @@ -498,9 +498,9 @@ static int object_block_entry_eq (const void *p1, const void *p2) { const struct object_block *old = (const struct object_block *) p1; - const section *new = (const section *) p2; + const section *new_section = (const section *) p2; - return old->sect == new; + return old->sect == new_section; } static hashval_t diff --git a/gcc/varpool.c b/gcc/varpool.c index 4149c1d1d21..c2410f664f5 100644 --- a/gcc/varpool.c +++ b/gcc/varpool.c @@ -357,7 +357,13 @@ varpool_assemble_decl (struct varpool_node *node) && (TREE_CODE (decl) != VAR_DECL || !DECL_HAS_VALUE_EXPR_P (decl))) { assemble_variable (decl, 0, 1, 0); - return TREE_ASM_WRITTEN (decl); + if (TREE_ASM_WRITTEN (decl)) + { + node->next_needed = varpool_assembled_nodes_queue; + varpool_assembled_nodes_queue = node; + node->finalized = 1; + return true; + } } return false; @@ -423,12 +429,7 @@ varpool_assemble_pending_decls (void) varpool_nodes_queue = varpool_nodes_queue->next_needed; if (varpool_assemble_decl (node)) - { - changed = true; - node->next_needed = varpool_assembled_nodes_queue; - varpool_assembled_nodes_queue = node; - node->finalized = 1; - } + changed = true; else node->next_needed = NULL; } @@ -438,6 +439,26 @@ varpool_assemble_pending_decls (void) return changed; } +/* Remove all elements from the queue so we can re-use it for debug output. */ +void +varpool_empty_needed_queue (void) +{ + /* EH might mark decls as needed during expansion. This should be safe since + we don't create references to new function, but it should not be used + elsewhere. */ + varpool_analyze_pending_decls (); + + while (varpool_nodes_queue) + { + struct varpool_node *node = varpool_nodes_queue; + varpool_nodes_queue = varpool_nodes_queue->next_needed; + node->next_needed = NULL; + } + /* varpool_nodes_queue is now empty, clear the pointer to the last element + in the queue. */ + varpool_last_needed_node = NULL; +} + /* Output all variables enqueued to be assembled. */ void varpool_output_debug_info (void) diff --git a/libffi/ChangeLog b/libffi/ChangeLog index 05188245ea4..850bbd4b35b 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,8 @@ +2008-07-16 Kaz Kojima <kkojima@gcc.gnu.org> + + * src/sh/ffi.c (ffi_prep_closure_loc): Turn INSN into an unsigned + int. + 2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * configure: Regenerate. diff --git a/libffi/src/sh/ffi.c b/libffi/src/sh/ffi.c index 0cb8c72ccf6..850fde0a022 100644 --- a/libffi/src/sh/ffi.c +++ b/libffi/src/sh/ffi.c @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Kaz Kojima + ffi.c - Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 + Kaz Kojima SuperH Foreign Function Interface @@ -459,7 +460,7 @@ ffi_prep_closure_loc (ffi_closure* closure, void *codeloc) { unsigned int *tramp; - unsigned short insn; + unsigned int insn; FFI_ASSERT (cif->abi == FFI_GCC_SYSV); diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 671b48bde76..ded506b0636 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2008-07-16 Jakub Jelinek <jakub@redhat.com> + + * team.c (gomp_team_end): Free team immediately if it has + just one thread. + 2008-07-08 David Edelsohn <edelsohn@gnu.org> * testsuite/libgomp.c++/c++.exp: Append multilib library path. diff --git a/libgomp/team.c b/libgomp/team.c index 18b02e72f90..224236c6604 100644 --- a/libgomp/team.c +++ b/libgomp/team.c @@ -498,7 +498,8 @@ gomp_team_end (void) gomp_mutex_destroy (&team->work_share_list_free_lock); #endif - if (__builtin_expect (thr->ts.team != NULL, 0)) + if (__builtin_expect (thr->ts.team != NULL, 0) + || __builtin_expect (team->nthreads == 1, 0)) free_team (team); else { diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 1caf0ef248b..13649995233 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2008-07-16 Roger Sayle <roger@eyesopen.com> + Paolo Bonzini <bonzini@gnu.org> + + * scripts/jar.in: Fix portability problems with Solaris /bin/sh. + 2008-07-08 Matthias Klose <doko@ubuntu.com> * libtool-version: Bump soversion. diff --git a/libjava/classpath/ChangeLog b/libjava/classpath/ChangeLog index 10a167cb08c..f8e2d43ee2c 100644 --- a/libjava/classpath/ChangeLog +++ b/libjava/classpath/ChangeLog @@ -1,3 +1,10 @@ +2008-07-15 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> + + * m4/acinclude.m4 (CLASSPATH_COND_IF): New macro. + * configure.ac: Use it. + * configure: Regenerate. + * tools/Makefile.am (!CREATE_WRAPPERS): Update comment. + 2008-06-11 Andrew Haley <aph@redhat.com> * native/jawt/Makefile.am, diff --git a/libjava/classpath/configure b/libjava/classpath/configure index 966fcbd54f9..4a39d32c2b4 100755 --- a/libjava/classpath/configure +++ b/libjava/classpath/configure @@ -28343,9 +28343,11 @@ fi ac_config_files="$ac_config_files Makefile doc/Makefile doc/api/Makefile external/Makefile external/sax/Makefile external/w3c_dom/Makefile external/relaxngDatatype/Makefile external/jsr166/Makefile gnu/classpath/Configuration.java gnu/java/security/Configuration.java include/Makefile native/Makefile native/fdlibm/Makefile native/jawt/Makefile native/jni/Makefile native/jni/classpath/Makefile native/jni/java-io/Makefile native/jni/java-lang/Makefile native/jni/java-net/Makefile native/jni/java-nio/Makefile native/jni/java-util/Makefile native/jni/gtk-peer/Makefile native/jni/gconf-peer/Makefile native/jni/gstreamer-peer/Makefile native/jni/qt-peer/Makefile native/jni/xmlj/Makefile native/jni/midi-alsa/Makefile native/jni/midi-dssi/Makefile native/jni/native-lib/Makefile native/plugin/Makefile resource/Makefile resource/META-INF/services/java.util.prefs.PreferencesFactory resource/META-INF/services/javax.sound.sampled.spi.AudioFileReader resource/META-INF/services/javax.sound.sampled.spi.MixerProvider scripts/Makefile scripts/classpath.spec lib/Makefile lib/gen-classlist.sh lib/copy-vmresources.sh scripts/check_jni_methods.sh tools/Makefile examples/Makefile examples/Makefile.jawt examples/Makefile.java2d" -if test "x${COMPILE_WRAPPERS}" = xno -then - ac_config_files="$ac_config_files tools/gappletviewer tools/gjarsigner tools/gkeytool tools/gjar tools/gnative2ascii tools/gserialver tools/grmiregistry tools/gtnameserv tools/gorbd tools/grmid tools/grmic tools/gjavah" +if test "x${COMPILE_WRAPPERS}" = xyes; then + : + else + ac_config_files="$ac_config_files tools/gappletviewer tools/gjarsigner tools/gkeytool tools/gjar tools/gnative2ascii tools/gserialver tools/grmiregistry tools/gtnameserv tools/gorbd tools/grmid tools/grmic tools/gjavah" + ac_config_commands="$ac_config_commands gappletviewer" @@ -28371,7 +28373,9 @@ then ac_config_commands="$ac_config_commands gjavah" -fi + + fi + ac_config_commands="$ac_config_commands gen-classlist" diff --git a/libjava/classpath/configure.ac b/libjava/classpath/configure.ac index a14d2c128c3..54a3efce22f 100644 --- a/libjava/classpath/configure.ac +++ b/libjava/classpath/configure.ac @@ -1059,9 +1059,8 @@ examples/Makefile examples/Makefile.jawt examples/Makefile.java2d]) -if test "x${COMPILE_WRAPPERS}" = xno -then -AC_CONFIG_FILES([tools/gappletviewer +CLASSPATH_COND_IF([CREATE_WRAPPERS], [test "x${COMPILE_WRAPPERS}" = xyes], [], +[AC_CONFIG_FILES([tools/gappletviewer tools/gjarsigner tools/gkeytool tools/gjar @@ -1073,6 +1072,7 @@ tools/gorbd tools/grmid tools/grmic tools/gjavah]) + AC_CONFIG_COMMANDS([gappletviewer],[chmod 755 tools/gappletviewer]) AC_CONFIG_COMMANDS([gjarsigner],[chmod 755 tools/gjarsigner]) AC_CONFIG_COMMANDS([gkeytool],[chmod 755 tools/gkeytool]) @@ -1085,7 +1085,7 @@ AC_CONFIG_COMMANDS([gorbd],[chmod 755 tools/gorbd]) AC_CONFIG_COMMANDS([grmid],[chmod 755 tools/grmid]) AC_CONFIG_COMMANDS([grmic],[chmod 755 tools/grmic]) AC_CONFIG_COMMANDS([gjavah], [chmod 755 tools/gjavah]) -fi +]) AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh]) AC_CONFIG_COMMANDS([copy-vmresources],[chmod 755 lib/copy-vmresources.sh]) diff --git a/libjava/classpath/m4/acinclude.m4 b/libjava/classpath/m4/acinclude.m4 index 6c4eacda486..9f98f1c37f6 100644 --- a/libjava/classpath/m4/acinclude.m4 +++ b/libjava/classpath/m4/acinclude.m4 @@ -246,3 +246,19 @@ EOF rm -f $JAVA_TEST $CLASS_TEST AC_SUBST(JAVAC_MEM_OPT) ]) + +dnl --------------------------------------------------------------- +dnl CLASSPATH_COND_IF(COND, SHELL-CONDITION, [IF-TRUE], [IF-FALSE]) +dnl --------------------------------------------------------------- +dnl Automake 1.11 can emit conditional rules for AC_CONFIG_FILES, +dnl using AM_COND_IF. This wrapper uses it if it is available, +dnl otherwise falls back to code compatible with Automake 1.9.6. +AC_DEFUN([CLASSPATH_COND_IF], +[m4_ifdef([AM_COND_IF], + [AM_COND_IF([$1], [$3], [$4])], + [if $2; then + m4_default([$3], [:]) + else + m4_default([$4], [:]) + fi +])]) diff --git a/libjava/classpath/tools/Makefile.am b/libjava/classpath/tools/Makefile.am index 94228271e93..81953bc66ee 100755 --- a/libjava/classpath/tools/Makefile.am +++ b/libjava/classpath/tools/Makefile.am @@ -89,7 +89,8 @@ noinst_SCRIPTS = gappletviewer gjarsigner gkeytool \ gjar gnative2ascii gserialver gjavah grmiregistry \ gtnameserv gorbd grmid grmic bin_PROGRAMS = -## FIXME: revisit this with a newer automake. +## FIXME: remove these unneeded dependency lines once we can +## require Automake 1.11. gappletviewer: gappletviewer.in gjarsigner: gjarsigner.in gkeytool: gkeytool.in diff --git a/libjava/scripts/jar.in b/libjava/scripts/jar.in index 82ea10c2912..e9cb9f5822e 100644 --- a/libjava/scripts/jar.in +++ b/libjava/scripts/jar.in @@ -96,7 +96,7 @@ copy () { return 0 fi - if test -e "$2"/"$1"; then + if test -f "$2"/"$1"; then error "$1": Duplicate entry. fi dir=`dirname "$1"` @@ -249,8 +249,7 @@ jar_list_verbose () { } # mkdir -p emulation based on the mkinstalldirs script. -mkdir_p () -{ +func_mkdir_p () { for file do case $file in @@ -290,7 +289,7 @@ mkdir_p () if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then mkdir_p='mkdir -p' else - mkdir_p='mkdir_p' + mkdir_p='func_mkdir_p' test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index dc9437e5a94..03bd7b87ba7 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,81 @@ +2008-07-16 Paolo Carlini <paolo.carlini@oracle.com> + + * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Adjust + dg-error lines. + * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise. + * testsuite/20_util/duration/cons/1_neg.cc: Likewise. + + * include/tr1_impl/type_traits: Fix comment typo. + +2008-07-16 Paolo Carlini <paolo.carlini@oracle.com> + + * include/bits/unique_ptr.h: Remove stray character. + +2008-07-15 Benjamin Kosnik <bkoz@redhat.com> + + * doc/doxygen/user.cfg.in: Add complex, ratio, + intializer_list. + (PREDEFINED): Add _GLIBCXX_USE_C99_STDINT_TR1. + * doc/doxygen/doxygroups.cc: Add std::chrono. + * include/bits/unique_ptr.h (default_delete, unique_ptr): Add markup. + * libsupc++/initializer_list (initializer_list): Same. + * include/std/ratio: Same. + * include/std/chrono: Same. + * include/std/complex: Disambiguate file markup. + +2008-07-15 Chris Fairles <chris.fairles@gmail.com> + + * include/std/chrono: New, as per N2661. + * src/chrono.cc: New. + * include/Makefile.am: Update. + * src/Makefile.am: Likewise. + * include/Makefile.in: Regenerate. + * src/Makefile.in: Likewise. + * acinclude.m4: Add tests for clock_gettime and gettimeofday that + define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. + * configure.ac: Use them. + * configure: Regenerate. + * config.h.in: Likewise. + * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and + system_clock::is_monotonic. + * testsuite/20_util/duration/cons/1.cc: New. + * testsuite/20_util/duration/cons/2.cc: Likewise. + * testsuite/20_util/duration/cons/1_neg.cc: Likewise. + * testsuite/20_util/duration/requirements/explicit_instantiation/ + explicit_instantiation.cc: Likewise. + * testsuite/20_util/duration/arithmetic/1.cc: Likewise. + * testsuite/20_util/duration/arithmetic/2.cc: Likewise. + * testsuite/20_util/duration/comparisons/1.cc: Likewise. + * testsuite/20_util/time_point/requirements/explicit_instantiation/ + explicit_instantiation.cc: Likewise. + * testsuite/20_util/time_point/1.cc: Likewise. + * testsuite/20_util/time_point/2.cc: Likewise. + * testsuite/20_util/time_point/3.cc: Likewise. + * testsuite/20_util/clocks/1.cc: Likewise. + * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add + missing headers. + * testsuite/17_intro/headers/c++200x/all.cc: Likewise. + * include/precompiled/stdc++.h: Likewise and remove <date_time>. + * doc/doxygen/user.cfg.in: Likewise. + +2008-07-15 Paolo Carlini <paolo.carlini@oracle.com> + + PR libstdc++/36832 + * include/ext/rope (_Destroy_const): Add. + (rope<>::copy): Call it. + * testsuite/ext/rope/36832.cc: New. + +2008-07-15 Johannes Singler <singler@ira.uka.de> + + * include/parallel/find_selectors.h: + Correct name for include guard #ifndef. + * include/parallel/balanced_quicksort.h: Likewise. + * include/parallel/unique_copy.h: Likewise. + * include/parallel/multiway_mergesort.h: Likewise. + * include/parallel/checkers.h: Likewise. + * include/parallel/[various files]: + Add/correct comment for #endif of include guard (at end of file) + 2008-07-12 Paolo Carlini <paolo.carlini@oracle.com> * include/std/date_time: Remove, per N2549, in WP. @@ -28,7 +106,7 @@ PR libstdc++/36451 * doc/xml/manual/allocator.xml: Fix links. * doc/html/*: Regenerate. - + 2008-07-09 Joseph Myers <joseph@codesourcery.com> * libsupc++/unwind-cxx.h (__is_gxx_forced_unwind_class, @@ -44,7 +122,7 @@ PR libstdc++/36552 * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ null_metadata.hpp: Remove self-include. - + 2008-07-09 Joseph Myers <joseph@codesourcery.com> * testsuite/20_util/make_signed/requirements/typedefs-2.cc, diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index a68ab9be2a8..e998471c446 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -1009,6 +1009,94 @@ AC_DEFUN([GLIBCXX_ENABLE_C99], [ dnl +dnl Check for IEEE Std 1003.1-2001 clock_gettime required for +dnl 20.8.5 [time.clock] in the current C++0X working draft. +dnl +AC_DEFUN([GLIBCXX_CHECK_CLOCK_GETTIME], [ + + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" + + AC_CHECK_HEADERS(unistd.h, ac_has_unistd_h=yes, ac_has_unistd_h=no) + + ac_has_clock_monotonic=no; + ac_has_clock_realtime=no; + if test x"$ac_has_unistd_h" = x"yes"; then + AC_MSG_CHECKING([for monotonic clock]) + AC_TRY_LINK( + [#include <unistd.h> + #include <time.h> + ], + [#if _POSIX_TIMERS > 0 && defined(_POSIX_MONOTONIC_CLOCK) + timespec tp; + #endif + clock_gettime(CLOCK_MONOTONIC, &tp); + ], [ac_has_clock_monotonic=yes], [ac_has_clock_monotonic=no]) + + AC_MSG_RESULT($ac_has_clock_monotonic) + + AC_MSG_CHECKING([for realtime clock]) + AC_TRY_LINK( + [#include <unistd.h> + #include <time.h> + ], + [#if _POSIX_TIMERS > 0 + timespec tp; + #endif + clock_gettime(CLOCK_REALTIME, &tp); + ], [ac_has_clock_realtime=yes], [ac_has_clock_realtime=no]) + + AC_MSG_RESULT($ac_has_clock_realtime) + fi + + if test x"$ac_has_clock_monotonic" = x"yes"; then + AC_DEFINE(_GLIBCXX_USE_CLOCK_MONOTONIC, 1, + [ Defined if clock_gettime has monotonic clock support. ]) + fi + + if test x"$ac_has_clock_realtime" = x"yes"; then + AC_DEFINE(_GLIBCXX_USE_CLOCK_REALTIME, 1, + [ Defined if clock_gettime has realtime clock support. ]) + fi + + CXXFLAGS="$ac_save_CXXFLAGS" + AC_LANG_RESTORE +]) + +dnl +dnl Check for IEEE Std 1003.1-2001 gettimeofday required for +dnl 20.8.5 [time.clock] in the current C++0X working draft. +dnl +AC_DEFUN([GLIBCXX_CHECK_GETTIMEOFDAY], [ + + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" + + ac_has_gettimeofday=no; + AC_CHECK_HEADERS(sys/time.h, ac_has_sys_time_h=yes, ac_has_sys_time_h=no) + if test x"$ac_has_sys_time_h" = x"yes"; then + AC_MSG_CHECKING([for gettimeofday]) + AC_TRY_LINK([#include <sys/time.h>], + [timeval tv; gettimeofday(&tv, 0);], + [ac_has_gettimeofday=yes], [ac_has_gettimeofday=no]) + + AC_MSG_RESULT($ac_has_gettimeofday) + fi + + if test x"$ac_has_gettimeofday" = x"yes"; then + AC_DEFINE(_GLIBCXX_USE_GETTIMEOFDAY, 1, + [ Defined if gettimeofday is available. ]) + fi + + CXXFLAGS="$ac_save_CXXFLAGS" + AC_LANG_RESTORE +]) + +dnl dnl Check for ISO/IEC 9899:1999 "C99" support to ISO/IEC DTR 19768 "TR1" dnl facilities in Chapter 8, "C compatibility". dnl diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in index 3dbb654a995..aa3d7d1e0a2 100644 --- a/libstdc++-v3/config.h.in +++ b/libstdc++-v3/config.h.in @@ -811,6 +811,15 @@ namespace std::tr1. */ #undef _GLIBCXX_USE_C99_STDINT_TR1 +/* Defined if clock_gettime has monotonic clock support. */ +#undef _GLIBCXX_USE_CLOCK_MONOTONIC + +/* Defined if clock_gettime has realtime clock support. */ +#undef _GLIBCXX_USE_CLOCK_REALTIME + +/* Defined if gettimeofday is available. */ +#undef _GLIBCXX_USE_GETTIMEOFDAY + /* Define if LFS support is available. */ #undef _GLIBCXX_USE_LFS diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver index 8327d10511f..a9c94fc694b 100644 --- a/libstdc++-v3/config/abi/pre/gnu.ver +++ b/libstdc++-v3/config/abi/pre/gnu.ver @@ -885,6 +885,10 @@ GLIBCXX_3.4.11 { # char16_t and char32_t _ZNSt14numeric_limitsIu8char*; + # chrono + _ZNSt6chrono12system_clock12is_monotonicE; + _ZNSt6chrono12system_clock3nowEv; + } GLIBCXX_3.4.10; # Symbols in the support library (libsupc++) have their own tag. diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index d8aad162a8d..d5005496585 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -40128,6 +40128,571 @@ _ACEOF + # For clock_gettime support. + + + + + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" + + +for ac_header in unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ----------------------------------------- ## +## Report this to the package-unused lists. ## +## ----------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + ac_has_unistd_h=yes +else + ac_has_unistd_h=no +fi + +done + + + ac_has_clock_monotonic=no; + ac_has_clock_realtime=no; + if test x"$ac_has_unistd_h" = x"yes"; then + echo "$as_me:$LINENO: checking for monotonic clock" >&5 +echo $ECHO_N "checking for monotonic clock... $ECHO_C" >&6 + if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <unistd.h> + #include <time.h> + +int +main () +{ +#if _POSIX_TIMERS > 0 && defined(_POSIX_MONOTONIC_CLOCK) + timespec tp; + #endif + clock_gettime(CLOCK_MONOTONIC, &tp); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_has_clock_monotonic=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_has_clock_monotonic=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + echo "$as_me:$LINENO: result: $ac_has_clock_monotonic" >&5 +echo "${ECHO_T}$ac_has_clock_monotonic" >&6 + + echo "$as_me:$LINENO: checking for realtime clock" >&5 +echo $ECHO_N "checking for realtime clock... $ECHO_C" >&6 + if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <unistd.h> + #include <time.h> + +int +main () +{ +#if _POSIX_TIMERS > 0 + timespec tp; + #endif + clock_gettime(CLOCK_REALTIME, &tp); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_has_clock_realtime=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_has_clock_realtime=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + echo "$as_me:$LINENO: result: $ac_has_clock_realtime" >&5 +echo "${ECHO_T}$ac_has_clock_realtime" >&6 + fi + + if test x"$ac_has_clock_monotonic" = x"yes"; then + +cat >>confdefs.h <<\_ACEOF +#define _GLIBCXX_USE_CLOCK_MONOTONIC 1 +_ACEOF + + fi + + if test x"$ac_has_clock_realtime" = x"yes"; then + +cat >>confdefs.h <<\_ACEOF +#define _GLIBCXX_USE_CLOCK_REALTIME 1 +_ACEOF + + fi + + CXXFLAGS="$ac_save_CXXFLAGS" + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + # For gettimeofday support. + + + + + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" + + ac_has_gettimeofday=no; + +for ac_header in sys/time.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ----------------------------------------- ## +## Report this to the package-unused lists. ## +## ----------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + ac_has_sys_time_h=yes +else + ac_has_sys_time_h=no +fi + +done + + if test x"$ac_has_sys_time_h" = x"yes"; then + echo "$as_me:$LINENO: checking for gettimeofday" >&5 +echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6 + if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/time.h> +int +main () +{ +timeval tv; gettimeofday(&tv, 0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_has_gettimeofday=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_has_gettimeofday=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + echo "$as_me:$LINENO: result: $ac_has_gettimeofday" >&5 +echo "${ECHO_T}$ac_has_gettimeofday" >&6 + fi + + if test x"$ac_has_gettimeofday" = x"yes"; then + +cat >>confdefs.h <<\_ACEOF +#define _GLIBCXX_USE_GETTIMEOFDAY 1 +_ACEOF + + fi + + CXXFLAGS="$ac_save_CXXFLAGS" + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + # For TLS support. # Check whether --enable-tls was given. diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index 19501aac1be..b23e17714dd 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -161,6 +161,12 @@ if $GLIBCXX_IS_NATIVE; then # For dev/random and dev/urandom for TR1. GLIBCXX_CHECK_RANDOM_TR1 + # For clock_gettime support. + GLIBCXX_CHECK_CLOCK_GETTIME + + # For gettimeofday support. + GLIBCXX_CHECK_GETTIMEOFDAY + # For TLS support. GCC_CHECK_TLS diff --git a/libstdc++-v3/doc/doxygen/doxygroups.cc b/libstdc++-v3/doc/doxygen/doxygroups.cc index d0adec9e5fb..d94c9e50b3e 100644 --- a/libstdc++-v3/doc/doxygen/doxygroups.cc +++ b/libstdc++-v3/doc/doxygen/doxygroups.cc @@ -28,12 +28,15 @@ /** @namespace std::tr1::__detail * @brief Implementation details not part of the namespace std::tr1 interface. */ -/** @namespace std::regex_constants - * @brief ISO C++ 0x entities sub namespace for regex. +/** @namespace std::chrono + * @brief ISO C++ 0x entities sub namespace for time and date. */ /** @namespace std::placeholders * @brief ISO C++ 0x entities sub namespace for functional. */ +/** @namespace std::regex_constants + * @brief ISO C++ 0x entities sub namespace for regex. +*/ /** @namespace std::this_thread * @brief ISO C++ 0x entities sub namespace for thread. */ diff --git a/libstdc++-v3/doc/doxygen/user.cfg.in b/libstdc++-v3/doc/doxygen/user.cfg.in index 3c59dcbb831..23204850e11 100644 --- a/libstdc++-v3/doc/doxygen/user.cfg.in +++ b/libstdc++-v3/doc/doxygen/user.cfg.in @@ -463,13 +463,15 @@ WARN_LOGFILE = INPUT = @srcdir@/libsupc++/cxxabi.h \ @srcdir@/libsupc++/cxxabi-forced.h \ @srcdir@/libsupc++/exception \ + @srcdir@/libsupc++/initializer_list \ @srcdir@/libsupc++/new \ @srcdir@/libsupc++/typeinfo \ include/algorithm \ include/array \ include/bitset \ + include/chrono \ + include/complex \ include/condition_variable \ - include/date_time \ include/deque \ include/fstream \ include/functional \ @@ -489,6 +491,7 @@ INPUT = @srcdir@/libsupc++/cxxabi.h \ include/ostream \ include/queue \ include/random \ + include/ratio \ include/regex \ include/set \ include/sstream \ @@ -1167,6 +1170,7 @@ INCLUDE_FILE_PATTERNS = PREDEFINED = __cplusplus \ __GTHREADS \ + __GXX_EXPERIMENTAL_CXX0X__ \ "_GLIBCXX_STD_P= " \ "_GLIBCXX_STD_D= " \ _GLIBCXX_STD=std \ @@ -1182,16 +1186,18 @@ PREDEFINED = __cplusplus \ _GLIBCXX_DEPRECATED \ _GLIBCXX_USE_WCHAR_T \ _GLIBCXX_USE_LONG_LONG \ + _GLIBCXX_USE_C99_STDINT_TR1 \ __glibcxx_function_requires=// \ __glibcxx_class_requires=// \ __glibcxx_class_requires2=// \ __glibcxx_class_requires3=// \ __glibcxx_class_requires4=// -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES +# then this tag can be used to specify a list of macro names that +# should be expanded. The macro definition that is found in the +# sources will be used. Use the PREDEFINED tag if you want to use a +# different macro definition. EXPAND_AS_DEFINED = diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 5d8358b42eb..1249930c80d 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -32,6 +32,7 @@ std_headers = \ ${std_srcdir}/array \ ${std_srcdir}/bitset \ ${std_srcdir}/c++0x_warning.h \ + ${std_srcdir}/chrono \ ${std_srcdir}/complex \ ${std_srcdir}/condition_variable \ ${std_srcdir}/deque \ diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 5c8da2cf763..e9c8d89a6a7 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -288,6 +288,7 @@ std_headers = \ ${std_srcdir}/array \ ${std_srcdir}/bitset \ ${std_srcdir}/c++0x_warning.h \ + ${std_srcdir}/chrono \ ${std_srcdir}/complex \ ${std_srcdir}/condition_variable \ ${std_srcdir}/deque \ diff --git a/libstdc++-v3/include/bits/unique_ptr.h b/libstdc++-v3/include/bits/unique_ptr.h index f2c13b5800a..ead0acf9515 100644 --- a/libstdc++-v3/include/bits/unique_ptr.h +++ b/libstdc++-v3/include/bits/unique_ptr.h @@ -47,6 +47,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) + /// Primary template, default_delete. template<typename _Tp> struct default_delete { @@ -66,6 +67,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 740 - omit specialization for array objects with a compile time length + /// Specialization, default_delete. template<typename _Tp> struct default_delete<_Tp[]> { @@ -78,6 +80,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } }; + /// 20.6.11.2 unique_ptr for single objects. template <typename _Tp, typename _Tp_Deleter = default_delete<_Tp> > class unique_ptr { @@ -224,7 +227,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) __tuple_type _M_t; }; - // 20.6.11.3 unique_ptr for array objects with a runtime length + /// 20.6.11.3 unique_ptr for array objects with a runtime length // [unique.ptr.runtime] // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 740 - omit specialization for array objects with a compile time length diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope index e39761ec432..b85f98e3be4 100644 --- a/libstdc++-v3/include/ext/rope +++ b/libstdc++-v3/include/ext/rope @@ -1,6 +1,6 @@ // SGI's rope class -*- C++ -*- -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -80,6 +80,22 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) using std::allocator; using std::_Destroy; + // See libstdc++/36832. + template<typename _ForwardIterator, typename _Allocator> + void + _Destroy_const(_ForwardIterator __first, + _ForwardIterator __last, _Allocator __alloc) + { + for (; __first != __last; ++__first) + __alloc.destroy(&*__first); + } + + template<typename _ForwardIterator, typename _Tp> + inline void + _Destroy_const(_ForwardIterator __first, + _ForwardIterator __last, allocator<_Tp>) + { _Destroy(__first, __last); } + // The _S_eos function is used for those functions that // convert to/from C-like strings to detect the end of the string. @@ -1941,11 +1957,11 @@ protected: this->_M_tree_ptr = _S_balance(this->_M_tree_ptr); _S_unref(__old); } - + void copy(_CharT* __buffer) const { - _Destroy(__buffer, __buffer + size(), _M_get_allocator()); + _Destroy_const(__buffer, __buffer + size(), _M_get_allocator()); _S_flatten(this->_M_tree_ptr, __buffer); } @@ -1959,8 +1975,8 @@ protected: { size_t __size = size(); size_t __len = (__pos + __n > __size? __size - __pos : __n); - - _Destroy(__buffer, __buffer + __len, _M_get_allocator()); + + _Destroy_const(__buffer, __buffer + __len, _M_get_allocator()); _S_flatten(this->_M_tree_ptr, __pos, __len, __buffer); return __len; } diff --git a/libstdc++-v3/include/parallel/algo.h b/libstdc++-v3/include/parallel/algo.h index 4aa4d8af47f..23e7bdcbabc 100644 --- a/libstdc++-v3/include/parallel/algo.h +++ b/libstdc++-v3/include/parallel/algo.h @@ -2367,4 +2367,4 @@ namespace __parallel } // end namespace } // end namespace -#endif /* _GLIBCXX_ALGORITHM_H */ +#endif /* _GLIBCXX_PARALLEL_ALGO_H */ diff --git a/libstdc++-v3/include/parallel/algobase.h b/libstdc++-v3/include/parallel/algobase.h index 821985d49b1..4e77dd7d5dc 100644 --- a/libstdc++-v3/include/parallel/algobase.h +++ b/libstdc++-v3/include/parallel/algobase.h @@ -284,4 +284,4 @@ namespace __parallel } // end namespace } // end namespace -#endif /* _GLIBCXX_ALGOBASE_H */ +#endif /* _GLIBCXX_PARALLEL_ALGOBASE_H */ diff --git a/libstdc++-v3/include/parallel/algorithmfwd.h b/libstdc++-v3/include/parallel/algorithmfwd.h index ea6b245eb7e..3f386a5cdbc 100644 --- a/libstdc++-v3/include/parallel/algorithmfwd.h +++ b/libstdc++-v3/include/parallel/algorithmfwd.h @@ -892,4 +892,4 @@ namespace __parallel } // end namespace __parallel } // end namespace std -#endif +#endif /* _GLIBCXX_PARALLEL_ALGORITHMFWD_H */ diff --git a/libstdc++-v3/include/parallel/balanced_quicksort.h b/libstdc++-v3/include/parallel/balanced_quicksort.h index 3393655fc98..3fd12642eea 100644 --- a/libstdc++-v3/include/parallel/balanced_quicksort.h +++ b/libstdc++-v3/include/parallel/balanced_quicksort.h @@ -45,8 +45,8 @@ // Written by Johannes Singler. -#ifndef _GLIBCXX_PARALLEL_BAL_QUICKSORT_H -#define _GLIBCXX_PARALLEL_BAL_QUICKSORT_H 1 +#ifndef _GLIBCXX_PARALLEL_BALANCED_QUICKSORT_H +#define _GLIBCXX_PARALLEL_BALANCED_QUICKSORT_H 1 #include <parallel/basic_iterator.h> #include <bits/stl_algo.h> @@ -480,4 +480,4 @@ template<typename RandomAccessIterator, typename Comparator> } } // namespace __gnu_parallel -#endif +#endif /* _GLIBCXX_PARALLEL_BALANCED_QUICKSORT_H */ diff --git a/libstdc++-v3/include/parallel/base.h b/libstdc++-v3/include/parallel/base.h index 54c26d8ca6d..45c3327f5af 100644 --- a/libstdc++-v3/include/parallel/base.h +++ b/libstdc++-v3/include/parallel/base.h @@ -492,4 +492,4 @@ do \ } //namespace __gnu_parallel -#endif +#endif /* _GLIBCXX_PARALLEL_BASE_H */ diff --git a/libstdc++-v3/include/parallel/basic_iterator.h b/libstdc++-v3/include/parallel/basic_iterator.h index 4b891be80b2..edbecca7a9f 100644 --- a/libstdc++-v3/include/parallel/basic_iterator.h +++ b/libstdc++-v3/include/parallel/basic_iterator.h @@ -45,4 +45,4 @@ #include <bits/stl_iterator_base_funcs.h> #include <bits/stl_iterator.h> -#endif /* _GLIBCXX_BASIC_ITERATOR_H */ +#endif /* _GLIBCXX_PARALLEL_BASIC_ITERATOR_H */ diff --git a/libstdc++-v3/include/parallel/checkers.h b/libstdc++-v3/include/parallel/checkers.h index 1c6bc355d17..231cea8892b 100644 --- a/libstdc++-v3/include/parallel/checkers.h +++ b/libstdc++-v3/include/parallel/checkers.h @@ -35,8 +35,8 @@ // Written by Johannes Singler. -#ifndef _GLIBCXX_PARALLEL_CHECKERS -#define _GLIBCXX_PARALLEL_CHECKERS 1 +#ifndef _GLIBCXX_PARALLEL_CHECKERS_H +#define _GLIBCXX_PARALLEL_CHECKERS_H 1 #include <functional> #include <cstdio> @@ -157,4 +157,4 @@ namespace __gnu_parallel } } -#endif +#endif /* _GLIBCXX_PARALLEL_CHECKERS_H */ diff --git a/libstdc++-v3/include/parallel/compatibility.h b/libstdc++-v3/include/parallel/compatibility.h index 18514e6f8a9..840a9201712 100644 --- a/libstdc++-v3/include/parallel/compatibility.h +++ b/libstdc++-v3/include/parallel/compatibility.h @@ -353,4 +353,4 @@ namespace __gnu_parallel } } // end namespace -#endif +#endif /* _GLIBCXX_PARALLEL_COMPATIBILITY_H */ diff --git a/libstdc++-v3/include/parallel/equally_split.h b/libstdc++-v3/include/parallel/equally_split.h index 37e45816727..e12cb10a040 100644 --- a/libstdc++-v3/include/parallel/equally_split.h +++ b/libstdc++-v3/include/parallel/equally_split.h @@ -90,4 +90,4 @@ template<typename difference_type> } } -#endif +#endif /* _GLIBCXX_PARALLEL_EQUALLY_SPLIT_H */ diff --git a/libstdc++-v3/include/parallel/features.h b/libstdc++-v3/include/parallel/features.h index 7150c20affc..f0aef51622e 100644 --- a/libstdc++-v3/include/parallel/features.h +++ b/libstdc++-v3/include/parallel/features.h @@ -107,4 +107,4 @@ #endif -#endif +#endif /* _GLIBCXX_PARALLEL_FEATURES_H */ diff --git a/libstdc++-v3/include/parallel/find.h b/libstdc++-v3/include/parallel/find.h index 3e0084f68ab..4717c8e570b 100644 --- a/libstdc++-v3/include/parallel/find.h +++ b/libstdc++-v3/include/parallel/find.h @@ -404,4 +404,4 @@ template<typename RandomAccessIterator1, #endif } // end namespace -#endif +#endif /* _GLIBCXX_PARALLEL_FIND_H */ diff --git a/libstdc++-v3/include/parallel/find_selectors.h b/libstdc++-v3/include/parallel/find_selectors.h index 3076bd2327e..29c6ca09e98 100644 --- a/libstdc++-v3/include/parallel/find_selectors.h +++ b/libstdc++-v3/include/parallel/find_selectors.h @@ -36,8 +36,8 @@ // Written by Felix Putze. -#ifndef _GLIBCXX_PARALLEL_FIND_FUNCTIONS_H -#define _GLIBCXX_PARALLEL_FIND_FUNCTIONS_H 1 +#ifndef _GLIBCXX_PARALLEL_FIND_SELECTORS_H +#define _GLIBCXX_PARALLEL_FIND_SELECTORS_H 1 #include <parallel/tags.h> #include <parallel/basic_iterator.h> @@ -195,4 +195,4 @@ namespace __gnu_parallel }; } -#endif +#endif /* _GLIBCXX_PARALLEL_FIND_SELECTORS_H */ diff --git a/libstdc++-v3/include/parallel/for_each.h b/libstdc++-v3/include/parallel/for_each.h index 8a4d702d2d5..df9d4f338a1 100644 --- a/libstdc++-v3/include/parallel/for_each.h +++ b/libstdc++-v3/include/parallel/for_each.h @@ -100,4 +100,4 @@ namespace __gnu_parallel } } -#endif +#endif /* _GLIBCXX_PARALLEL_FOR_EACH_H */ diff --git a/libstdc++-v3/include/parallel/for_each_selectors.h b/libstdc++-v3/include/parallel/for_each_selectors.h index eaa55fc05c6..651b76bad28 100644 --- a/libstdc++-v3/include/parallel/for_each_selectors.h +++ b/libstdc++-v3/include/parallel/for_each_selectors.h @@ -363,4 +363,4 @@ namespace __gnu_parallel }; } -#endif +#endif /* _GLIBCXX_PARALLEL_FOR_EACH_SELECTORS_H */ diff --git a/libstdc++-v3/include/parallel/iterator.h b/libstdc++-v3/include/parallel/iterator.h index ba20a460d5c..7aaafee8611 100644 --- a/libstdc++-v3/include/parallel/iterator.h +++ b/libstdc++-v3/include/parallel/iterator.h @@ -202,4 +202,4 @@ namespace __gnu_parallel }; } -#endif +#endif /* _GLIBCXX_PARALLEL_ITERATOR_H */ diff --git a/libstdc++-v3/include/parallel/list_partition.h b/libstdc++-v3/include/parallel/list_partition.h index 5adc5c9280d..c9d34e3c8e7 100644 --- a/libstdc++-v3/include/parallel/list_partition.h +++ b/libstdc++-v3/include/parallel/list_partition.h @@ -179,4 +179,4 @@ namespace __gnu_parallel } } -#endif +#endif /* _GLIBCXX_PARALLEL_LIST_PARTITION_H */ diff --git a/libstdc++-v3/include/parallel/losertree.h b/libstdc++-v3/include/parallel/losertree.h index 3736b908557..b7f8da036ae 100644 --- a/libstdc++-v3/include/parallel/losertree.h +++ b/libstdc++-v3/include/parallel/losertree.h @@ -1024,4 +1024,4 @@ public: } // namespace __gnu_parallel -#endif +#endif /* _GLIBCXX_PARALLEL_LOSERTREE_H */ diff --git a/libstdc++-v3/include/parallel/merge.h b/libstdc++-v3/include/parallel/merge.h index 580b1479329..ca140a5b125 100644 --- a/libstdc++-v3/include/parallel/merge.h +++ b/libstdc++-v3/include/parallel/merge.h @@ -264,4 +264,4 @@ namespace __gnu_parallel } } //namespace __gnu_parallel -#endif +#endif /* _GLIBCXX_PARALLEL_MERGE_H */ diff --git a/libstdc++-v3/include/parallel/multiseq_selection.h b/libstdc++-v3/include/parallel/multiseq_selection.h index 662204526c9..ee9214f4a22 100644 --- a/libstdc++-v3/include/parallel/multiseq_selection.h +++ b/libstdc++-v3/include/parallel/multiseq_selection.h @@ -636,5 +636,4 @@ namespace __gnu_parallel #undef S -#endif - +#endif /* _GLIBCXX_PARALLEL_MULTISEQ_SELECTION_H */ diff --git a/libstdc++-v3/include/parallel/multiway_merge.h b/libstdc++-v3/include/parallel/multiway_merge.h index 3c75c70f3c4..4bfad0c9989 100644 --- a/libstdc++-v3/include/parallel/multiway_merge.h +++ b/libstdc++-v3/include/parallel/multiway_merge.h @@ -2148,4 +2148,4 @@ stable_multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin }; // namespace __gnu_parallel -#endif +#endif /* _GLIBCXX_PARALLEL_MULTIWAY_MERGE_H */ diff --git a/libstdc++-v3/include/parallel/multiway_mergesort.h b/libstdc++-v3/include/parallel/multiway_mergesort.h index 9d9733ad05f..c12e58407fd 100644 --- a/libstdc++-v3/include/parallel/multiway_mergesort.h +++ b/libstdc++-v3/include/parallel/multiway_mergesort.h @@ -35,8 +35,8 @@ // Written by Johannes Singler. -#ifndef _GLIBCXX_PARALLEL_MERGESORT_H -#define _GLIBCXX_PARALLEL_MERGESORT_H 1 +#ifndef _GLIBCXX_PARALLEL_MULTIWAY_MERGESORT_H +#define _GLIBCXX_PARALLEL_MULTIWAY_MERGESORT_H 1 #include <vector> @@ -478,4 +478,4 @@ template<bool stable, bool exact, typename RandomAccessIterator, } } //namespace __gnu_parallel -#endif +#endif /* _GLIBCXX_PARALLEL_MULTIWAY_MERGESORT_H */ diff --git a/libstdc++-v3/include/parallel/numericfwd.h b/libstdc++-v3/include/parallel/numericfwd.h index 581ceaad6f4..362725b4a67 100644 --- a/libstdc++-v3/include/parallel/numericfwd.h +++ b/libstdc++-v3/include/parallel/numericfwd.h @@ -203,4 +203,4 @@ namespace __parallel } // end namespace } // end namespace -#endif +#endif /* _GLIBCXX_PARALLEL_NUMERICFWD_H */ diff --git a/libstdc++-v3/include/parallel/omp_loop.h b/libstdc++-v3/include/parallel/omp_loop.h index bc34aed2857..88634c95d4f 100644 --- a/libstdc++-v3/include/parallel/omp_loop.h +++ b/libstdc++-v3/include/parallel/omp_loop.h @@ -121,4 +121,4 @@ template<typename RandomAccessIterator, } // end namespace -#endif +#endif /* _GLIBCXX_PARALLEL_OMP_LOOP_H */ diff --git a/libstdc++-v3/include/parallel/omp_loop_static.h b/libstdc++-v3/include/parallel/omp_loop_static.h index 96692e8645a..dc6c24975b5 100644 --- a/libstdc++-v3/include/parallel/omp_loop_static.h +++ b/libstdc++-v3/include/parallel/omp_loop_static.h @@ -120,4 +120,4 @@ template<typename RandomAccessIterator, } // end namespace -#endif +#endif /* _GLIBCXX_PARALLEL_OMP_LOOP_STATIC_H */ diff --git a/libstdc++-v3/include/parallel/par_loop.h b/libstdc++-v3/include/parallel/par_loop.h index 9e6c2ea641e..c8d2a220ca8 100644 --- a/libstdc++-v3/include/parallel/par_loop.h +++ b/libstdc++-v3/include/parallel/par_loop.h @@ -128,4 +128,4 @@ template<typename RandomAccessIterator, } // end namespace -#endif +#endif /* _GLIBCXX_PARALLEL_PAR_LOOP_H */ diff --git a/libstdc++-v3/include/parallel/parallel.h b/libstdc++-v3/include/parallel/parallel.h index 63246126b8f..f76f67976b6 100644 --- a/libstdc++-v3/include/parallel/parallel.h +++ b/libstdc++-v3/include/parallel/parallel.h @@ -45,4 +45,4 @@ #include <parallel/tags.h> #include <parallel/settings.h> -#endif +#endif /* _GLIBCXX_PARALLEL_PARALLEL_H */ diff --git a/libstdc++-v3/include/parallel/partial_sum.h b/libstdc++-v3/include/parallel/partial_sum.h index fd4954d456d..4551e48e97b 100644 --- a/libstdc++-v3/include/parallel/partial_sum.h +++ b/libstdc++-v3/include/parallel/partial_sum.h @@ -223,4 +223,4 @@ template<typename InputIterator, } } -#endif +#endif /* _GLIBCXX_PARALLEL_PARTIAL_SUM_H */ diff --git a/libstdc++-v3/include/parallel/partition.h b/libstdc++-v3/include/parallel/partition.h index 7747b7e9980..f7bf3d083c9 100644 --- a/libstdc++-v3/include/parallel/partition.h +++ b/libstdc++-v3/include/parallel/partition.h @@ -432,4 +432,4 @@ template<typename RandomAccessIterator, typename Comparator> #undef _GLIBCXX_VOLATILE -#endif +#endif /* _GLIBCXX_PARALLEL_PARTITION_H */ diff --git a/libstdc++-v3/include/parallel/queue.h b/libstdc++-v3/include/parallel/queue.h index 27a26f3ecaa..fc37f6c8a71 100644 --- a/libstdc++-v3/include/parallel/queue.h +++ b/libstdc++-v3/include/parallel/queue.h @@ -152,4 +152,4 @@ namespace __gnu_parallel #undef _GLIBCXX_VOLATILE -#endif +#endif /* _GLIBCXX_PARALLEL_QUEUE_H */ diff --git a/libstdc++-v3/include/parallel/quicksort.h b/libstdc++-v3/include/parallel/quicksort.h index 844a5bf3ccd..b0201c2c08b 100644 --- a/libstdc++-v3/include/parallel/quicksort.h +++ b/libstdc++-v3/include/parallel/quicksort.h @@ -182,4 +182,4 @@ namespace __gnu_parallel } //namespace __gnu_parallel -#endif +#endif /* _GLIBCXX_PARALLEL_QUICKSORT_H */ diff --git a/libstdc++-v3/include/parallel/random_number.h b/libstdc++-v3/include/parallel/random_number.h index e1e11a8675c..fa91198a990 100644 --- a/libstdc++-v3/include/parallel/random_number.h +++ b/libstdc++-v3/include/parallel/random_number.h @@ -127,4 +127,4 @@ namespace __gnu_parallel } // namespace __gnu_parallel -#endif +#endif /* _GLIBCXX_PARALLEL_RANDOM_NUMBER_H */ diff --git a/libstdc++-v3/include/parallel/random_shuffle.h b/libstdc++-v3/include/parallel/random_shuffle.h index e5bc5395c0b..e6ce95d489d 100644 --- a/libstdc++-v3/include/parallel/random_shuffle.h +++ b/libstdc++-v3/include/parallel/random_shuffle.h @@ -522,4 +522,4 @@ template<typename RandomAccessIterator, typename RandomNumberGenerator> } -#endif +#endif /* _GLIBCXX_PARALLEL_RANDOM_SHUFFLE_H */ diff --git a/libstdc++-v3/include/parallel/search.h b/libstdc++-v3/include/parallel/search.h index 86bd2b827b9..acda6a858b5 100644 --- a/libstdc++-v3/include/parallel/search.h +++ b/libstdc++-v3/include/parallel/search.h @@ -175,4 +175,4 @@ template<typename _RandomAccessIterator1, } } // end namespace -#endif +#endif /* _GLIBCXX_PARALLEL_SEARCH_H */ diff --git a/libstdc++-v3/include/parallel/set_operations.h b/libstdc++-v3/include/parallel/set_operations.h index dccfbd83262..1d747401f8e 100644 --- a/libstdc++-v3/include/parallel/set_operations.h +++ b/libstdc++-v3/include/parallel/set_operations.h @@ -527,4 +527,4 @@ template<typename InputIterator, } -#endif // _GLIBCXX_SET_ALGORITHM_ +#endif /* _GLIBCXX_PARALLEL_SET_OPERATIONS_H */ diff --git a/libstdc++-v3/include/parallel/settings.h b/libstdc++-v3/include/parallel/settings.h index ae1ae5ca063..bf7bfdcfb8b 100644 --- a/libstdc++-v3/include/parallel/settings.h +++ b/libstdc++-v3/include/parallel/settings.h @@ -284,4 +284,4 @@ namespace __gnu_parallel }; } -#endif /* _GLIBCXX_SETTINGS_H */ +#endif /* _GLIBCXX_PARALLEL_SETTINGS_H */ diff --git a/libstdc++-v3/include/parallel/sort.h b/libstdc++-v3/include/parallel/sort.h index 559ed1cc19e..6e786819b29 100644 --- a/libstdc++-v3/include/parallel/sort.h +++ b/libstdc++-v3/include/parallel/sort.h @@ -232,4 +232,4 @@ namespace __gnu_parallel } } // end namespace __gnu_parallel -#endif +#endif /* _GLIBCXX_PARALLEL_SORT_H */ diff --git a/libstdc++-v3/include/parallel/types.h b/libstdc++-v3/include/parallel/types.h index 1b646b02084..40afa8a8580 100644 --- a/libstdc++-v3/include/parallel/types.h +++ b/libstdc++-v3/include/parallel/types.h @@ -158,4 +158,4 @@ namespace __gnu_parallel static const lcas_t lcas_t_mask = ((lcas_t(1) << (lcas_t_bits / 2)) - 1); } -#endif /* _GLIBCXX_TYPES_H */ +#endif /* _GLIBCXX_PARALLEL_TYPES_H */ diff --git a/libstdc++-v3/include/parallel/unique_copy.h b/libstdc++-v3/include/parallel/unique_copy.h index 7f51e2603fd..1ef379d1186 100644 --- a/libstdc++-v3/include/parallel/unique_copy.h +++ b/libstdc++-v3/include/parallel/unique_copy.h @@ -35,8 +35,8 @@ // Written by Robert Geisberger and Robin Dapp. -#ifndef _GLIBCXX_PARALLEL_UNIQUE_H -#define _GLIBCXX_PARALLEL_UNIQUE_H 1 +#ifndef _GLIBCXX_PARALLEL_UNIQUE_COPY_H +#define _GLIBCXX_PARALLEL_UNIQUE_COPY_H 1 #include <parallel/parallel.h> #include <parallel/multiseq_selection.h> @@ -195,4 +195,4 @@ template<typename InputIterator, class OutputIterator> }//namespace __gnu_parallel -#endif +#endif /* _GLIBCXX_PARALLEL_UNIQUE_COPY_H */ diff --git a/libstdc++-v3/include/parallel/workstealing.h b/libstdc++-v3/include/parallel/workstealing.h index 628f12cca2c..c8d571b0d6c 100644 --- a/libstdc++-v3/include/parallel/workstealing.h +++ b/libstdc++-v3/include/parallel/workstealing.h @@ -309,4 +309,4 @@ template<typename RandomAccessIterator, } } // end namespace -#endif +#endif /* _GLIBCXX_PARALLEL_WORKSTEALING_H */ diff --git a/libstdc++-v3/include/precompiled/stdc++.h b/libstdc++-v3/include/precompiled/stdc++.h index e4b61106734..b9249353678 100644 --- a/libstdc++-v3/include/precompiled/stdc++.h +++ b/libstdc++-v3/include/precompiled/stdc++.h @@ -98,8 +98,9 @@ #ifdef __GXX_EXPERIMENTAL_CXX0X__ #include <array> -#include <date_time> +#include <chrono> #include <random> +#include <ratio> #include <regex> #include <system_error> #include <tuple> diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex index c8845f6728c..1c48251e350 100644 --- a/libstdc++-v3/include/std/complex +++ b/libstdc++-v3/include/std/complex @@ -29,7 +29,7 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file complex +/** @file include/complex * This is a Standard C++ Library header. */ diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex index 5d4e52105f8..e4ba94def11 100644 --- a/libstdc++-v3/include/std/mutex +++ b/libstdc++-v3/include/std/mutex @@ -120,7 +120,6 @@ namespace std #endif } - void lock() { diff --git a/libstdc++-v3/include/std/ratio b/libstdc++-v3/include/std/ratio index 9980571f160..124e9af397a 100644 --- a/libstdc++-v3/include/std/ratio +++ b/libstdc++-v3/include/std/ratio @@ -165,6 +165,7 @@ namespace std template<intmax_t _Num, intmax_t _Den> const intmax_t ratio<_Num, _Den>::den; + /// ratio_add template<typename _R1, typename _R2> struct ratio_add { @@ -180,6 +181,7 @@ namespace std __safe_multiply<_R1::den, (_R2::den / __gcd)>::value> type; }; + /// ratio_subtract template<typename _R1, typename _R2> struct ratio_subtract { @@ -188,6 +190,7 @@ namespace std ratio<-_R2::num, _R2::den>>::type type; }; + /// ratio_multiply template<typename _R1, typename _R2> struct ratio_multiply { @@ -205,6 +208,7 @@ namespace std (_R2::den / __gcd1)>::value> type; }; + /// ratio_divide template<typename _R1, typename _R2> struct ratio_divide { @@ -215,11 +219,13 @@ namespace std ratio<_R2::den, _R2::num>>::type type; }; + /// ratio_equal template<typename _R1, typename _R2> struct ratio_equal : integral_constant<bool, _R1::num == _R2::num && _R1::den == _R2::den> { }; + /// ratio_not_equal template<typename _R1, typename _R2> struct ratio_not_equal : integral_constant<bool, !ratio_equal<_R1, _R2>::value> @@ -243,21 +249,25 @@ namespace std __ratio_less_simple_impl<_R1, _R2>>::type { }; + /// ratio_less template<typename _R1, typename _R2> struct ratio_less : __ratio_less_impl<_R1, _R2>::type { }; + /// ratio_less_equal template<typename _R1, typename _R2> struct ratio_less_equal : integral_constant<bool, !ratio_less<_R2, _R1>::value> { }; + /// ratio_greater template<typename _R1, typename _R2> struct ratio_greater : integral_constant<bool, ratio_less<_R2, _R1>::value> { }; + /// ratio_greater_equal template<typename _R1, typename _R2> struct ratio_greater_equal : integral_constant<bool, !ratio_less<_R1, _R2>::value> diff --git a/libstdc++-v3/include/tr1_impl/type_traits b/libstdc++-v3/include/tr1_impl/type_traits index 5d0824a365f..87633fa9804 100644 --- a/libstdc++-v3/include/tr1_impl/type_traits +++ b/libstdc++-v3/include/tr1_impl/type_traits @@ -235,7 +235,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 template<typename _Tp> struct is_member_pointer; - /// is_scalal + /// is_scalar template<typename _Tp> struct is_scalar : public integral_constant<bool, (is_arithmetic<_Tp>::value diff --git a/libstdc++-v3/libsupc++/initializer_list b/libstdc++-v3/libsupc++/initializer_list index 18fb15bc552..e98cd71a1ac 100644 --- a/libstdc++-v3/libsupc++/initializer_list +++ b/libstdc++-v3/libsupc++/initializer_list @@ -28,6 +28,10 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. +/** @file initializer_list + * This is a Standard C++ Library header. + */ + #ifndef __CXX_INITIALIZER_LIST #define __CXX_INITIALIZER_LIST @@ -39,6 +43,7 @@ namespace std { + /// initializer_list template<class _E> class initializer_list { diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am index 8d2cbf5e14b..d41f3ebf290 100644 --- a/libstdc++-v3/src/Makefile.am +++ b/libstdc++-v3/src/Makefile.am @@ -186,6 +186,7 @@ sources = \ wstring-inst.cc \ mutex.cc \ condition_variable.cc \ + chrono.cc \ ${host_sources} \ ${host_sources_extra} @@ -272,6 +273,11 @@ atomic.lo: atomic.cc atomic.o: atomic.cc $(CXXCOMPILE) -x c++ -std=gnu++0x -c $< +chrono.lo: chrono.cc + $(LTCXXCOMPILE) -std=gnu++0x -c $< +chrono.o: chrono.cc + $(CXXCOMPILE) -std=gnu++0x -c $< + if GLIBCXX_LDBL_COMPAT # Use special rules for compatibility-ldbl.cc compilation, as we need to # pass -mlong-double-64. diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in index df9c4b9e597..720def9b5cb 100644 --- a/libstdc++-v3/src/Makefile.in +++ b/libstdc++-v3/src/Makefile.in @@ -84,10 +84,10 @@ am__libstdc___la_SOURCES_DIST = atomic.cc bitmap_allocator.cc \ istream-inst.cc istream.cc locale-inst.cc misc-inst.cc \ ostream-inst.cc sstream-inst.cc streambuf-inst.cc streambuf.cc \ string-inst.cc valarray-inst.cc wlocale-inst.cc \ - wstring-inst.cc mutex.cc condition_variable.cc atomicity.cc \ - codecvt_members.cc collate_members.cc ctype_members.cc \ - messages_members.cc monetary_members.cc numeric_members.cc \ - time_members.cc basic_file.cc c++locale.cc \ + wstring-inst.cc mutex.cc condition_variable.cc chrono.cc \ + atomicity.cc codecvt_members.cc collate_members.cc \ + ctype_members.cc messages_members.cc monetary_members.cc \ + numeric_members.cc time_members.cc basic_file.cc c++locale.cc \ compatibility-ldbl.cc parallel_list.cc parallel_settings.cc am__objects_1 = atomicity.lo codecvt_members.lo collate_members.lo \ ctype_members.lo messages_members.lo monetary_members.lo \ @@ -109,7 +109,7 @@ am__objects_5 = atomic.lo bitmap_allocator.lo pool_allocator.lo \ istream-inst.lo istream.lo locale-inst.lo misc-inst.lo \ ostream-inst.lo sstream-inst.lo streambuf-inst.lo streambuf.lo \ string-inst.lo valarray-inst.lo wlocale-inst.lo \ - wstring-inst.lo mutex.lo condition_variable.lo \ + wstring-inst.lo mutex.lo condition_variable.lo chrono.lo \ $(am__objects_1) $(am__objects_4) am_libstdc___la_OBJECTS = $(am__objects_5) libstdc___la_OBJECTS = $(am_libstdc___la_OBJECTS) @@ -425,6 +425,7 @@ sources = \ wstring-inst.cc \ mutex.cc \ condition_variable.cc \ + chrono.cc \ ${host_sources} \ ${host_sources_extra} @@ -869,6 +870,11 @@ atomic.lo: atomic.cc atomic.o: atomic.cc $(CXXCOMPILE) -x c++ -std=gnu++0x -c $< +chrono.lo: chrono.cc + $(LTCXXCOMPILE) -std=gnu++0x -c $< +chrono.o: chrono.cc + $(CXXCOMPILE) -std=gnu++0x -c $< + # Use special rules for compatibility-ldbl.cc compilation, as we need to # pass -mlong-double-64. @GLIBCXX_LDBL_COMPAT_TRUE@compatibility-ldbl.lo: compatibility-ldbl.cc diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/all.cc index 7988666739a..4c2e31be081 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++200x/all.cc @@ -95,6 +95,7 @@ #include <algorithm> #include <array> #include <bitset> +#include <chrono> #include <condition_variable> #include <complex> #include <deque> @@ -118,6 +119,7 @@ #include <ostream> #include <queue> #include <random> +#include <ratio> #include <regex> #include <set> #include <sstream> diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc index 814fbc3a144..f88edc8268a 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc @@ -93,6 +93,7 @@ #include <algorithm> #include <array> #include <bitset> +#include <chrono> #include <complex> #include <deque> #include <exception> @@ -114,6 +115,7 @@ #include <ostream> #include <queue> #include <random> +#include <ratio> #include <regex> #include <set> #include <sstream> @@ -203,6 +205,7 @@ #include <algorithm> #include <array> #include <bitset> +#include <chrono> #include <complex> #include <deque> #include <exception> @@ -219,11 +222,13 @@ #include <locale> #include <map> #include <memory> +#include <mutex> #include <new> #include <numeric> #include <ostream> #include <queue> #include <random> +#include <ratio> #include <regex> #include <set> #include <sstream> diff --git a/libstdc++-v3/testsuite/20_util/clocks/1.cc b/libstdc++-v3/testsuite/20_util/clocks/1.cc new file mode 100644 index 00000000000..bcbe210d22f --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/clocks/1.cc @@ -0,0 +1,39 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// Copyright (C) 2008 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 20.8.5 Clocks [time.clock] + +#include <chrono> + +// 20.8.5.1 system_clock [time.clock.system] +int +main() +{ + using namespace std::chrono; + + system_clock::time_point t1 = system_clock::now(); + bool is_monotonic = system_clock::is_monotonic; + is_monotonic = is_monotonic; // suppress unused warning + std::time_t t2 = system_clock::to_time_t(t1); + system_clock::time_point t3 = system_clock::from_time_t(t2); + + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/duration/arithmetic/1.cc b/libstdc++-v3/testsuite/20_util/duration/arithmetic/1.cc new file mode 100644 index 00000000000..55533eb1dde --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/duration/arithmetic/1.cc @@ -0,0 +1,94 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// Copyright (C) 2008 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 20.8.3 Class template duration [time.duration] + +#include <chrono> +#include <testsuite_hooks.h> + +// 20.8.3.3 duration arithmetic [time.duration.arithmetic] (unary member ops) +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::chrono; + + duration<int> d0(3); + duration<int> d1 = -d0; + VERIFY(d0.count() == 3); + VERIFY(d1.count() == -3); + + duration<int> d2 = (+d0); + VERIFY(d2.count() == 3); + + duration<int> d3(++d2); + VERIFY(d2.count() == 4); + VERIFY(d3.count() == 4); + + duration<int> d4(d3++); + VERIFY(d3.count() == 5); + VERIFY(d4.count() == 4); + + duration<int> d5(--d4); + VERIFY(d4.count() == 3); + VERIFY(d5.count() == 3); + + duration<int> d6(d5--); + VERIFY(d5.count() == 2); + VERIFY(d6.count() == 3); +} + +// 20.8.3.3 duration arithmetic [time.duration.arithmetic] (binary member ops) +void +test02() +{ + bool test __attribute__((unused)) = true; + using namespace std::chrono; + + duration<int> d7(3); + duration<int> d8(9); + d7 += d8; + VERIFY(d7.count() == 12); + VERIFY(d8.count() == 9); + + duration<int> d9(3); + duration<int> d10(9); + d9 -= d10; + VERIFY(d9.count() == -6); + VERIFY(d10.count() == 9); + + duration<int> d11(9); + int i = 3; + d11 *= i; + VERIFY(d11.count() == 27); + + duration<int> d12(12); + d12 /= i; + VERIFY(d12.count() == 4); +} + +int +main() +{ + test01(); + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/duration/arithmetic/2.cc b/libstdc++-v3/testsuite/20_util/duration/arithmetic/2.cc new file mode 100644 index 00000000000..e096334c980 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/duration/arithmetic/2.cc @@ -0,0 +1,62 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// Copyright (C) 2008 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 20.8.3 Class template duration [time.duration] + +#include <chrono> +#include <testsuite_hooks.h> + +// 20.8.3.5 duration non-member arithmetic [time.duration.nonmember] +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::chrono; + + duration<int> d0(12); + duration<int> d1(3); + int i = 3; + + duration<int> d2 = d0 + d1; + VERIFY(d2.count() == 15); + + duration<int> d3 = d0 - d1; + VERIFY(d3.count() == 9); + + duration<int> d4 = d0 * i; + VERIFY(d4.count() == 36); + + duration<int> d5 = i * d0; + VERIFY(d5.count() == 36); + + duration<int> d6 = d0 / i; + VERIFY(d6.count() == 4); + + int j = d0 / d1; + VERIFY(j == 4); +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/duration/comparisons/1.cc b/libstdc++-v3/testsuite/20_util/duration/comparisons/1.cc new file mode 100644 index 00000000000..31ac42ddcee --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/duration/comparisons/1.cc @@ -0,0 +1,56 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// Copyright (C) 2008 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 20.8.3 Class template duration [time.duration] + +#include <chrono> +#include <testsuite_hooks.h> + +// 20.8.3.6 duration comparisons [time.duration.comparisons] +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::chrono; + + duration<int> d0(12); + duration<int> d1(3); + duration<int> d2(3); + + VERIFY(d1 < d0); + VERIFY(d0 > d1); + + VERIFY(d0 != d1); + VERIFY(d1 == d2); + + VERIFY(d1 <= d2); + VERIFY(d1 >= d2); + + VERIFY(d1 <= d0); + VERIFY(d0 >= d1); +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/duration/cons/1.cc b/libstdc++-v3/testsuite/20_util/duration/cons/1.cc new file mode 100644 index 00000000000..6d12dbb5bd7 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/duration/cons/1.cc @@ -0,0 +1,138 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// Copyright (C) 2008 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 20.8.3 Class template duration [time.duration] + +#include <chrono> +#include <type_traits> +#include <testsuite_hooks.h> + +template<typename T> +struct type_emulator +{ + type_emulator() + : i(T(0)) { } + + type_emulator(T j) + : i(j) { } + + type_emulator(const type_emulator& e) + : i(e.i) { } + + type_emulator& + operator*=(type_emulator a) + { + i *= a.i; + return *this; + } + + type_emulator& + operator+=(type_emulator a) + { + i += a.i; + return *this; + } + + operator T () + { return i; } + + T i; +}; + +template<typename T> +bool +operator==(type_emulator<T> a, type_emulator<T> b) +{ return a.i == b.i; } + +template<typename T> +bool +operator<(type_emulator<T> a, type_emulator<T> b) +{ return a.i < b.i; } + +template<typename T> +type_emulator<T> +operator+(type_emulator<T> a, type_emulator<T> b) +{ return a += b; } + +template<typename T> +type_emulator<T> +operator*(type_emulator<T> a, type_emulator<T> b) +{ return a *= b; } + +namespace std +{ + template<typename T, typename U> + struct common_type<type_emulator<T>, U> + { typedef typename common_type<T,U>::type type; }; + + template<typename T, typename U> + struct common_type<U, type_emulator<T>> + { typedef typename common_type<U,T>::type type; }; + + template<typename T, typename U> + struct common_type<type_emulator<T>, type_emulator<U>> + { typedef typename common_type<T,U>::type type; }; + + namespace chrono + { + template<typename T> + struct treat_as_floating_point<type_emulator<T>> + : is_floating_point<T> + { }; + } +} + +typedef type_emulator<int> int_emulator; +typedef type_emulator<double> dbl_emulator; + +// 20.8.3.1 duration constructors [time.duration.cons] +void +test01() +{ + bool test __attribute__((unused)) = true; + using std::chrono::duration; + + duration<int> d0; + VERIFY(d0.count() == static_cast<duration<int>::rep>(0)); + + int r = 3; + duration<int> d1(r); + VERIFY(d1.count() == static_cast<duration<int>::rep>(r)); + + double s = 8.0; + duration<double> d2(s); + VERIFY(d2.count() == static_cast<duration<double>::rep>(s)); + + int_emulator ie(3); + duration<int_emulator> d3(ie); + VERIFY(d3.count() == static_cast<duration<int_emulator>::rep>(ie)); + + dbl_emulator de(4.0); + duration<dbl_emulator> d4(de); + VERIFY(d4.count() == static_cast<duration<dbl_emulator>::rep>(de)); +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc b/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc new file mode 100644 index 00000000000..fa63dab22b5 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc @@ -0,0 +1,46 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// Copyright (C) 2008 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 20.8.3.1 duration constructors [time.duration.cons] + +#include <chrono> + +void +test01() +{ + std::chrono::duration<int> d1(1.0); +} + +void +test02() +{ + using namespace std::chrono; + + duration<int, std::micro> d2(8); + duration<int, std::milli> d2_copy(d2); +} + +// { dg-error "instantiated from here" "" { target *-*-* } 30 } +// { dg-error "instantiated from here" "" { target *-*-* } 39 } +// { dg-error "not exactly representable" "" { target *-*-* } 203 } +// { dg-error "integral duration with floating point" "" { target *-*-* } 187 } +// { dg-excess-errors "In instantiation of" } diff --git a/libstdc++-v3/testsuite/20_util/duration/cons/2.cc b/libstdc++-v3/testsuite/20_util/duration/cons/2.cc new file mode 100644 index 00000000000..b491224dc48 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/duration/cons/2.cc @@ -0,0 +1,120 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// Copyright (C) 2008 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 20.8.3 Class template duration [time.duration] + +#include <chrono> +#include <type_traits> +#include <testsuite_hooks.h> + +template<typename T> +struct type_emulator +{ + type_emulator() : i(T(0)) { } + type_emulator(T j) : i(j) { } + type_emulator(const type_emulator& e) : i(e.i) { } + + type_emulator& operator*=(type_emulator a) + { i *= a.i; return *this; } + + type_emulator& operator+=(type_emulator a) + { i += a.i; return *this; } + + operator T () { return i; } + T i; +}; + +template<typename T> +bool operator==(type_emulator<T> a, type_emulator<T> b) +{ return a.i == b.i; } + +template<typename T> +bool operator<(type_emulator<T> a, type_emulator<T> b) +{ return a.i < b.i; } + +template<typename T> +type_emulator<T> operator+(type_emulator<T> a, type_emulator<T> b) +{ return a += b; } + +template<typename T> +type_emulator<T> operator*(type_emulator<T> a, type_emulator<T> b) +{ return a *= b; } + +namespace std +{ + template<typename T, typename U> + struct common_type<type_emulator<T>, U> + { typedef typename common_type<T,U>::type type; }; + + template<typename T, typename U> + struct common_type<U, type_emulator<T>> + { typedef typename common_type<U,T>::type type; }; + + template<typename T, typename U> + struct common_type<type_emulator<T>, type_emulator<U>> + { typedef typename common_type<T,U>::type type; }; + + namespace chrono + { + template<typename T> + struct treat_as_floating_point<type_emulator<T>> + : is_floating_point<T> + { }; + } +} + +typedef type_emulator<int> int_emulator; +typedef type_emulator<double> dbl_emulator; + +// 20.8.3.1 duration constructors [time.duration.cons] +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::chrono; + + duration<int> d0(3); + duration<int> d0_copy(d0); + VERIFY(d0_copy.count() == d0.count()); + + duration<int, std::milli> d1(5); + duration<int, std::micro> d1_copy(d1); + VERIFY(d1.count() * 1000 == d1_copy.count()); + + duration<double, std::micro> d2(8.0); + duration<double, std::milli> d2_copy(d2); + VERIFY(d2.count() == d2_copy.count() * 1000.0); + + duration<int_emulator, std::milli> d3(5); + duration<int_emulator, std::micro> d3_copy(d3); + VERIFY(d3.count() * 1000 == d3_copy.count()); + + duration<dbl_emulator, std::micro> d4(5.0); + duration<dbl_emulator, std::milli> d4_copy(d4); + VERIFY(d4.count() == d4_copy.count() * dbl_emulator(1000.0)); +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/explicit_instantiation/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/explicit_instantiation/explicit_instantiation.cc new file mode 100644 index 00000000000..7613411879d --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/duration/requirements/explicit_instantiation/explicit_instantiation.cc @@ -0,0 +1,27 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// Copyright (C) 2008 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301, USA. + +#include <ratio> +#include <chrono> + +template class std::chrono::duration<int>; +template class std::chrono::duration<float, std::ratio<2,3>>; diff --git a/libstdc++-v3/testsuite/20_util/time_point/1.cc b/libstdc++-v3/testsuite/20_util/time_point/1.cc new file mode 100644 index 00000000000..70f4d7800eb --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/time_point/1.cc @@ -0,0 +1,49 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// Copyright (C) 2008 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 20.8.4 Class template time_point [time.point] + +#include <chrono> +#include <testsuite_hooks.h> + +// 20.8.4.1 time_point constructors [time.point.cons] +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::chrono; + + time_point<system_clock> t1; + VERIFY(t1.time_since_epoch() == system_clock::duration::zero()); + + time_point<monotonic_clock> t2; + VERIFY(t2.time_since_epoch() == monotonic_clock::duration::zero()); + + time_point<high_resolution_clock> t3; + VERIFY(t3.time_since_epoch() == high_resolution_clock::duration::zero()); +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/time_point/2.cc b/libstdc++-v3/testsuite/20_util/time_point/2.cc new file mode 100644 index 00000000000..91f21a5e0f7 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/time_point/2.cc @@ -0,0 +1,72 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// Copyright (C) 2008 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 20.8.4 Class template time_point [time.point] + +#include <chrono> +#include <testsuite_hooks.h> + +// 20.8.4.3 time_point arithmetic [time.point.arithmetic] +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::chrono; + + time_point<system_clock> t1, t2; + t1 += seconds(1); + VERIFY(t2.time_since_epoch() + seconds(1) == t1.time_since_epoch()); + + t1 -= std::chrono::seconds(1); + VERIFY(t2.time_since_epoch() == t1.time_since_epoch()); +} + +// 20.8.4.5 time_point non-member arithmetic [time.point.nonmember] +void +test02() +{ + bool test __attribute__((unused)) = true; + using namespace std::chrono; + + time_point<system_clock> t1; + time_point<system_clock> t2(t1 + seconds(1)); + VERIFY(t2.time_since_epoch() == t1.time_since_epoch() + seconds(1)); + + time_point<system_clock> t3(seconds(1) + t1); + VERIFY(t3.time_since_epoch() == t1.time_since_epoch() + seconds(1)); + + time_point<system_clock> t4(seconds(1)); + time_point<system_clock> t5(seconds(2)); + + time_point<system_clock> t6(t5 - seconds(1)); + VERIFY(t6.time_since_epoch() == t4.time_since_epoch()); + + time_point<system_clock> t7(t5 - t4); + VERIFY(t7.time_since_epoch() == t4.time_since_epoch()); +} + +int +main() +{ + test01(); + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/time_point/3.cc b/libstdc++-v3/testsuite/20_util/time_point/3.cc new file mode 100644 index 00000000000..20820cebea1 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/time_point/3.cc @@ -0,0 +1,53 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// Copyright (C) 2008 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 20.8.4 Class template time_point [time.point] + +#include <chrono> +#include <testsuite_hooks.h> + +// 20.8.4.6 time_point comparisons [time.point.comparisons] +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::chrono; + + time_point<system_clock> t1(seconds(1)); + time_point<system_clock> t2(seconds(1)); + time_point<system_clock> t3(seconds(2)); + + VERIFY(t1 == t2); + VERIFY(t1 != t3); + VERIFY(t1 < t3); + VERIFY(t1 <= t3); + VERIFY(t1 <= t2); + VERIFY(t3 > t1); + VERIFY(t3 >= t1); + VERIFY(t2 >= t1); +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/time_point/requirements/explicit_instantiation/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/time_point/requirements/explicit_instantiation/explicit_instantiation.cc new file mode 100644 index 00000000000..7f9bbdf3d16 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/time_point/requirements/explicit_instantiation/explicit_instantiation.cc @@ -0,0 +1,25 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// Copyright (C) 2008 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301, USA. + +#include <chrono> + +template class std::chrono::time_point<std::chrono::system_clock>; diff --git a/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/assign_neg.cc b/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/assign_neg.cc index ca399742287..2e057104ec4 100644 --- a/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/assign_neg.cc +++ b/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/assign_neg.cc @@ -39,4 +39,4 @@ void test01() m1 = m2; } // { dg-error "within this context" "" { target *-*-* } 39 } -// { dg-error "is private" "" { target *-*-* } 155 } +// { dg-error "is private" "" { target *-*-* } 154 } diff --git a/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/copy_neg.cc b/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/copy_neg.cc index 7f530c36e38..a98e73333e5 100644 --- a/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/copy_neg.cc +++ b/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/copy_neg.cc @@ -38,4 +38,4 @@ void test01() mutex_type m2(m1); } // { dg-error "within this context" "" { target *-*-* } 38 } -// { dg-error "is private" "" { target *-*-* } 154 } +// { dg-error "is private" "" { target *-*-* } 153 } |