diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-06 17:40:11 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-06 17:40:11 +0000 |
commit | e5c1ea132c5ddd9c6c4da9290e06297138470d2f (patch) | |
tree | 033e80db4542571fa503164441703a7aa79d9683 /gcc | |
parent | 6b06353678b47ae92251138f50faba5b545f6a5c (diff) | |
download | gcc-e5c1ea132c5ddd9c6c4da9290e06297138470d2f.tar.gz |
2008-09-06 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r140063
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@140069 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
134 files changed, 3897 insertions, 1069 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 79f38b7f036..f3a30d97222 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,295 @@ +2008-09-06 Richard Sandiford <rdsandiford@googlemail.com> + + * config/mips/mips.c (mips_function_ok_for_sibcall): Check for + DECL being null. + +2008-09-06 Richard Sandiford <rdsandiford@goolemail.com> + Peter Fuerst <post@pfrst.de> + + * doc/invoke.texi: Document -mr10k-cache-barrier=. + * doc/extend.texi: Document __builtin_mips_cache. + * config/mips/mips-ftypes.def: Add a (VOID, SI, CVPOINTER) entry. + * config/mips/mips.opt (mr10k-cache-barrier=): New option. + * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Define + __GCC_HAVE_BUILTIN_MIPS_CACHE. + (TARGET_CACHE_BUILTIN, ISA_HAS_CACHE): New macros. + * config/mips/mips.c (mips_r10k_cache_barrier_setting): New enum. + (set_push_mips_isas): New variable. + (mips_r10k_cache_barrier): New variable. + (cache): New availability predicate. + (mips_builtins): Add an entry for __builtin_mips_cache. + (mips_build_cvpointer_type): New function. + (MIPS_ATYPE_CVPOINTER): New macro. + (mips_prepare_builtin_arg): Only use the insn's mode if the rtx's + mode is VOIDmode. + (r10k_simplified_address_p, r10k_simplify_address) + (r10k_uncached_address_p, r10k_safe_address_p) + (r10k_needs_protection_p_1, r10k_needs_protection_p_store) + (r10k_needs_protection_p_call, r10k_needs_protection_p) + (r10k_insert_cache_barriers): New functions. + (mips_reorg_process_insns): Delete cache barriers after a + branch-likely instruction. + (mips_reorg): Call r10k_insert_cache_barriers. + (mips_handle_option): Handle OPT_mr10k_cache_barrier_. + * config/mips/mips.md (UNSPEC_MIPS_CACHE): New constant. + (UNSPEC_R10K_CACHE_BARRIER): Likewise. + (mips_cache, r10k_cache_barrier): New define_insns. + +2008-09-06 Richard Sandiford <rdsandiford@googlemail.com> + + * ira-int.h (ira_zero_hard_reg_set, ira_one_hard_reg_set): Delete. + * ira-color.c (setup_allocno_left_conflicts_num): Use + hard_reg_set_equal_p instead of a comparison with + ira_zero_hard_reg_set. + * ira.c (setup_reg_subclasses): Likewise. + (setup_cover_and_important_classes): Likewise. + (setup_class_translate): Likewise. + (setup_reg_class_intersect_union): Likewise. + (ira_zero_hard_reg_set, ira_one_hard_reg_set): Delete. + (ira_init_once): Don't initialize them. + +2008-09-05 Vladimir Makarov <vmakarov@redhat.com> + + * doc/tm.texi (IRA_COVER_CLASSES): Fix a typo. + +2008-09-05 Vladimir Makarov <vmakarov@redhat.com> + + * ira-color.c (ira_fast_allocation): Permit global allocno + allocation. + +2008-09-05 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com> + + Improved branch hints, safe hints, and scheduling. + + * haifa-sched.c (sched_emit_insn) : Define. + * sched-int.h (sched_emit_insn) : Add prototype. + * doc/invoke.texi (-mdual-nops, -mhint-max-nops, + -mhint-max-distance -msafe-hints) : Document. + * config/spu/spu.c (spu_flag_var_tracking): New. + (TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_INIT, + TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, + TARGET_ASM_FILE_START): Define. + (TARGET_SCHED_ADJUST_PRIORITY): Remove. + (STOP_HINT_P, HINTED_P, SCHED_ON_EVEN_P): Define. + (spu_emit_branch_hint): Add blocks argument. + (insert_branch_hints, insert_nops): Remove. + (pad_bb, insert_hbrp_for_ilb_runout, insert_hbrp, in_spu_reorg, + uses_ls_unit, spu_sched_init_global, spu_sched_init, + spu_sched_reorder, asm_file_start): New functions. + (clock_var, spu_sched_length, pipe0_clock, + pipe1_clock, prev_clock_var, prev_priority, + spu_ls_first, prev_ls_clock): New static variables. + * config/spu/spu.h (TARGET_DEFAULT): Add MASK_SAFE_HINTS. + * config/spu.md (iprefetch): Add operand, make it clobber MEM. + (nopn_nv): Add a non-volatile version of nop. + * config/spu/spu.opt (-mdual-nops, -mhint-max-nops, + -mhint-max-distance, -msafe-hints): New options. + +2008-09-05 Janis Johnson <janis187@us.ibm.com> + Samuel Tardieu <sam@rfc1149.net> + + * opts.c (decode_options): Combine nested if statements. + + PR target/37283 + * opts.c (decode_options): Handle more relationships among + unit-at-a-time, toplevel-reorder, and section-anchors. + +2008-09-05 David Daney <ddaney@avtrex.com> + + * doc/install.texi (--enable-reduced-reflection): Document new option. + +2008-09-05 Bob Wilson <bob.wilson@acm.org> + + * config/xtensa/predicates.md (nonimmed_operand, mem_operand): Use + constantpool_mem_p. + (constantpool_operand): New. + (move_operand): Disallow sub-word modes for the constant pool. + * config/xtensa/xtensa.c (TARGET_SECONDARY_RELOAD): Define. + (xtensa_secondary_reload_class): Replace with.... + (xtensa_secondary_reload): this function. Remove SIGN_EXTEND check. + Set icode for sub-word reloads from the constant pool. + * config/xtensa/xtensa.h (SECONDARY_INPUT_RELOAD_CLASS): Delete. + (SECONDARY_OUTPUT_RELOAD_CLASS): Delete. + * config/xtensa/xtensa.md (reload<mode>_literal): New. + * config/xtensa/xtensa-protos.h: Update prototypes. + +2008-09-05 Joseph Myers <joseph@codesourcery.com> + + * config/mips/mips.h (enum reg_class): Add FRAME_REGS. + (REG_CLASS_NAMES): Update. + (REG_CLASS_CONTENTS): Update. + * config/mips/mips.c (mips_regno_to_class): Use FRAME_REGS instead + of ALL_REGS for regs 77 and 78. + * function.c (instantiate_virtual_regs_in_insn): Assert that + return value of simplify_gen_subreg is not NULL. + +2008-09-05 Paolo Bonzini <bonzini@gnu.org> + + * emit-rtl.c (gen_rtvec): Rewrite not using gen_rtvec_v. + (gen_rtvec_v): Fix coding standards. + +2008-09-04 Jan Hubicka <jh@suse.cz> + + * i386.c (decide_alg): Be more conservative about optimizing for size. + +2008-09-04 Ian Lance Taylor <iant@google.com> + + * varasm.c (narrowing_initializer_constant_valid_p): New + static function. + (initializer_constant_valid_p): Call it. + +2008-09-04 Jeff Law <law@redhat.com> + + * fold-const.c (native_encode_real): Fix computation of WORDS. + (native_interpret_real): Likewise. + +2008-09-04 Janis Johnson <janis187@us.ibm.com> + + * config/rs6000/t-rs6000: Remove target gt-rs6000.h. + +2008-09-04 Vladimir Makarov <vmakarov@redhat.com> + + * ira-conflicts.c (process_regs_for_copy): Check insn to check + that the cost is already taken into account in ira-costs.c + + * ira-int.h (ira_debug_copy, ira_debug_copies): New. + + * ira-build.c (print_copy, print_copies, ira_debug_copy, + ira_debug_copies): New. + (ira_bulid): Call print_copies. + + * doc/tm.texi (IRA_COVER_CLASSES): Fix the description. + +2008-09-04 Samuel Tardieu <sam@rfc1149.net> + + PR target/32783 + * config/rs6000/rs6000.c (optimization_options): Remove check of + flag_toplevel_order. + +2008-09-04 Adam Nemet <anemet@caviumnetworks.com> + + * config/mips/mips.h (ISA_HAS_SEQ_SNE): New macro. + * config/mips/mips.c (mips_expand_scc): Also expand seq and sne if + second operand is a reg_imm10_operand. + * config/mips/mips.md (*seq_<GPR:mode><GPR2:mode>_seq, + *sne_<GPR:mode><GPR2:mode>_sne): New patterns. + (*seq_<GPR:mode><GPR2:mode>): Rename to + *seq_zero_<GPR:mode><GPR2:mode>. Don't match if + ISA_HAS_SEQ_SNE. + (*seq_<GPR:mode><GPR2:mode>_mips16): Rename to + *seq_zero_<GPR:mode><GPR2:mode>_mip16. Don't match if + ISA_HAS_SEQ_SNE. + (*sne_<GPR:mode><GPR2:mode>): Rename to + *sne_zero_<GPR:mode><GPR2:mode>. Don't match if + ISA_HAS_SEQ_SNE. + +2008-09-04 Adam Nemet <anemet@caviumnetworks.com> + + * config/mips/mips.h (ISA_HAS_EXTS): New macro. + * config/mips/mips.md (*ashr_trunc<mode>): Name the pattern + combining an arithmetic right shift by more than 31 and a + trunction. Don't match for out-of-range shift amounts. Set + attribute mode to <MODE>. + (*lshr32_trunc<mode>): Name the pattern combining a logical right + shift by 32 and and a truncation. Set attribute mode to <MODE>. + (*<optab>_trunc<mode>_exts): New pattern for truncated right + shifts by less than 32. + (extv): Change predicate on first operand to accept registers. + Change predicate of the other operands from immediate_operand to + const_int_operand. Expand exts when source is a register. + (extzv): Change predicate of the constant operands from + immediate_operand to const_int_operand. + (extzv<mode>): Change predicate of the constant operands from + immediate_operand to const_int_operand and no constraint. Also + remove mode. + (*extzv_trunc<mode>_exts): New pattern. + +2008-09-04 Adam Nemet <anemet@caviumnetworks.com> + + * config/mips/mips.h (ISA_HAS_CINS): New macro. + * config/mips/mips-protos.h (mask_low_and_shift_p, + mask_low_and_shift_len): Declare. + * config/mips/mips.c (mask_low_and_shift_p, + mask_low_and_shift_len): New functions. + (mips_print_operand): Handle new operand prefix "m". + * config/mips/mips.md (*cins<mode>): New pattern. + +2008-09-04 Bernd Schmidt <bernd.schmidt@analog.com> + + * config/bfin/bfin.c (gen_one_bundle): Don't create new nops when + optimizing for size. + +2008-09-04 Richard Sandiford <rdsandiford@googlemail.com> + + * df-scan.c (df_get_entry_block_def_set): Add STACK_POINTER_REGNUM + regardless of epilogue_completed. + +2008-09-04 Vladimir Makarov <vmakarov@redhat.com> + + PR middle-end/37359 + * ira-lives.c (process_bb_node_lives): Check setjmp. + +2008-09-04 Richard Sandiford <rdsandiford@googlemail.com> + + PR middle-end/37243 + * ira-build.c (form_loop_tree): Reverse BB walk. + (create_bb_allocnos): Likewise. + * ira-lives.c (make_regno_born_and_dead, regs_set): Delete. + (mark_reg_store): Rename to... + (mark_ref_live): ...this and take a df_ref argument instead of + note_stores arguments. Assert that we have a register. + (mark_reg_clobber): Delete. + (def_conflicts_with_inputs_p): New function. + (mark_reg_conflicts): Delete. + (mark_reg_death): Rename to... + (mark_ref_dead): ...this and take a df_ref argument instead of + a register. Assert that we have a register. + (process_bb_node_lives): Hoist frequency calculation out of + instruction walk. Convert from a forwards scan to a backwards scan. + Use DF_REF_USES and DF_REF_DEFS instead of register notes and + note_stores. Remove EH_RETURN_DATA_REGNO and regs_set handling. + (create_allocno_live_ranges): Don't create regs_set. + +2008-09-04 Ian Lance Taylor <iant@google.com> + + * rtl.h (LABEL_REF_NONLOCAL_P): Don't check for REG_LABEL_OPERAND + or REG_LABEL_TARGET. + * calls.c (emit_library_call_value_1): Use MEM_P rather than + comparing MODE with MEM. + * gimple.c (gimple_build_predict): Cast END_PREDICTORS before + comparing with GF_PREDICT_TAKEN. + (gimple_get_lhs): Change code to enum gimple_code. + (gimple_set_lhs): Likewise. + * ifcvt.c (noce_process_if_block): Correct GET_MODE to GET_CODE. + * omp-low.c (find_omp_clause): Change kind parameter to enum + omp_clause_code. + * tree-flow.h (find_omp_clause): Update declaration. + * regrename.c (clear_dead_regs): Change kind parameter to enum + reg_note. + * reload1.c (eliminate_regs_1): Use REG_NOTE_KIND rather than + GET_MODE. + * see.c (see_get_extension_data): Change return type to enum + entry_type. Change UNKNOWN to NOT_RELEVANT, SIGN_EXTEND to + SIGNED_EXTENDED_DEF, ZERO_EXTEND to ZERO_EXTENDED_DEF. + (see_gen_normalized_extension): Change extension_code parameter to + enum entry_type. + (see_seek_pre_extension_expr): Change extension_code to enum + entry_type. + (see_merge_one_def_extension): Likewise. + (see_handle_relevant_defs): Likewise. + (see_handle_relevant_uses): Likewise. + (see_analyze_one_def): Likewise. + * tree-cfg.c (need_fake_edge_p): Compare gimple code with + GIMPLE_ASM rather than ASM_EXPR. + * tree-ssa-alias.c (is_escape_site): Compare gimple code with + GIMPLE_RETURN rather than RETURN_EXPR. + * tree-ssa-ccp.c (likely_value): Change code to enum gimple_code. + (evaluate_stmt): Likewise. + * tree-vect-analyze.c (vect_analyze_operations): Change relevance + to enum vect_relevant. + (vect_mark_stmts_to_be_vectorized): Change assertion to not + compare gimple codes with tree codes. + 2008-09-04 Paul Brook <paul@codesourcery.com> * config/arm/arm.c (arm_size_rtx_costs): Call cost function. @@ -3463,7 +3755,7 @@ * passes.c (init_optimization_passes): Exchange store-ccp with a ccp pass. -2008-08-19 Rafael Espindola <espindola@google.com> +2008-08-19 Rafael EspÃndola <espindola@google.com> * varasm.c (weak_decls): Move earlier in the file. (assemble_external): Add weak decls to the weak_decls list. @@ -5263,7 +5555,7 @@ PR ada/36554 * dwarf2out.c (is_subrange_type): Deal with BOOLEAN_TYPE. -2008-07-30 Rafael Avila de Espindola <espindola@google.com> +2008-07-30 Rafael Ãvila de EspÃndola <espindola@google.com> PR 36974 * final.c (call_from_call_insn): Handle COND_EXEC. @@ -5475,7 +5767,7 @@ * config/rs6000/rs6000.h (SLOW_UNALIGNED_ACCESS): Add clause for vector modes. -2008-07-30 Rafael Avila de Espindola <espindola@google.com> +2008-07-30 Rafael Ãvila de EspÃndola <espindola@google.com> * final.c (call_from_call_insn): New. (final_scan_insn): Call assemble_external on FUNCTION_DECLs. @@ -6591,7 +6883,7 @@ (TARGET_OPTION_PRINT): Ditto. (TARGET_CAN_INLINE_P): Ditto. -2008-07-22 Rafael Avila de Espindola <espindola@google.com> +2008-07-22 Rafael Ãvila de EspÃndola <espindola@google.com> * c-typeck.c (build_external_ref): Don't call assemble_external. * final.c (output_operand): Call assemble_external. @@ -6612,7 +6904,7 @@ highest magnitude if this is still less or equal to the true quotient in magnitude. -2008-07-21 Rafael Avila de Espindola <espindola@google.com> +2008-07-21 Rafael Ãvila de EspÃndola <espindola@google.com> * Makefile.in: Replace toplev.h with TOPLEV_H. * c-decl.c (merge_decls): Don't set DECL_IN_SYSTEM_HEADER. @@ -6914,7 +7206,7 @@ (m32c_legitimate_address_p): Handle "++rii" addresses created by m32c_legitimize_reload_address. -2007-07-16 Rafael Avila de Espindola <espindola@google.com> +2007-07-16 Rafael Ãvila de EspÃndola <espindola@google.com> * c-decl.c (merge_decls): Keep DECL_SOURCE_LOCATION and DECL_IN_SYSTEM_HEADER in sync. @@ -7004,7 +7296,7 @@ * emit-rtl.c (set_mem_attributes_minus_bitpos): Improve comment. -2007-07-14 Rafael Avila de Espindola <espindola@google.com> +2007-07-14 Rafael Ãvila de EspÃndola <espindola@google.com> * c-decl.c (diagnose_mismatched_decls): Don't warn if TREE_NO_WARNING is set. @@ -11296,7 +11588,7 @@ Clear __gcov_indreict_call_callee variable to avoid misattribution of the profile. -2008-05-28 Rafael Espindola <espindola@google.com> +2008-05-28 Rafael EspÃndola <espindola@google.com> * see.c (see_def_extension_not_merged): Use copy_rtx_if_shared to avoid invalid sharing. @@ -11714,7 +12006,7 @@ for A24 to PSImode. (m32c_address_cost): Detail costs for indirect offsets. -2008-05-23 Rafael Espindola <espindola@google.com> +2008-05-23 Rafael EspÃndola <espindola@google.com> * see.c (see_get_extension_data): Don't use SUBREG_REG to test if a node is a SUBREG. @@ -11815,7 +12107,7 @@ * config/avr/avr.c (get_sequence_length): Add new function. (expand_prologue, expand_epilogue): Remove duplicate code. -2008-05-22 Rafael Espindola <espindola@google.com> +2008-05-22 Rafael EspÃndola <espindola@google.com> * see.c (see_pre_insert_extensions): Use copy_rtx to avoid invalid rtx sharing. @@ -13107,7 +13399,7 @@ to one line. * doc/invoke.texi (Wframe-larger-than=): Add more description. -2008-05-08 Rafael Espindola <espindola@google.com> +2008-05-08 Rafael EspÃndola <espindola@google.com> * tree-complex.c (expand_complex_div_wide): Don't create CONDs that trap. @@ -14134,7 +14426,7 @@ (evaluate_stmt): Print the likely value. (ccp_visit_stmt): Avoid excessive vertical spacing. -2008-04-30 Rafael Espindola <espindola@google.com> +2008-04-30 Rafael EspÃndola <espindola@google.com> * builtins.c (fold_call_expr): Return realret. * tree-ssa-threadedge.c @@ -14917,7 +15209,7 @@ * tree-vect-analyze.c (vect_analyze_group_access): SLP is incapable of dealing with loads with gaps. -2008-04-24 Rafael Espindola <espindola@google.com> +2008-04-24 Rafael EspÃndola <espindola@google.com> * tree-flow.h (vrp_evaluate_conditional): Change signature. * tree-ssa-propagate.c (fold_predicate_in): Update call to @@ -15241,7 +15533,7 @@ * Makefile.in (s-gtyp-input): Remove tmp-gi.list before writing it. -2008-04-18 Rafael Espindola <espindola@google.com> +2008-04-18 Rafael EspÃndola <espindola@google.com> * tree-vrp.c (find_case_label_index): Fix the binary search. (find_case_label_range): New. @@ -15547,7 +15839,7 @@ * c-decl.c (finish_decl): If extern or static var has variable size, set TREE_TYPE (decl) to error_mark_node. -2008-04-15 Rafael Espindola <espindola@google.com> +2008-04-15 Rafael EspÃndola <espindola@google.com> * fold-const.c (tree_call_nonnegative_warnv_p): Remove local variable arg1. @@ -15687,7 +15979,7 @@ * config/spu/spu.c (spu_init_builtins): Mark builtins as nothrow. -2008-04-10 Rafael Espindola <espindola@google.com> +2008-04-10 Rafael EspÃndola <espindola@google.com> * tree-vrp.c (extract_range_from_binary_expr): Don't handle TRUTH_ANDIF_EXPR or TRUTH_ORIF_EXPR. @@ -15782,7 +16074,7 @@ * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Update GNU Fortran language string. -2008-04-08 Rafael Espindola <espindola@google.com> +2008-04-08 Rafael EspÃndola <espindola@google.com> * fold-canst.c (tree_call_nonnegative_warnv_p): New. (tree_invalid_nonnegative_warnv_p): Use tree_call_nonnegative_warnv_p. @@ -16430,7 +16722,7 @@ make sure to fill gaps with a fallback label if default_label is not present. -2008-04-03 Dominique d'Humieres <dominiq@lps.ens.fr> +2008-04-03 Dominique d'Humières <dominiq@lps.ens.fr> PR target/35801 * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Free cfun. @@ -16593,7 +16885,7 @@ (varying_mem_p): Move above propagate_rtx. (all_uses_available_at): Do not check MEMs. -2008-04-02 Rafael Espindola <espindola@google.com> +2008-04-02 Rafael EspÃndola <espindola@google.com> * tree-vrp.c (extract_code_and_val_from_cond): Remove. (register_edge_assert_for_2): Split the cond argument. @@ -16768,7 +17060,7 @@ (*sse4_1_smin<mode>3): Likewise. (*sse4_1_umin<mode>3): Likewise. -2008-04-01 Rafael Espindola <espindola@google.com> +2008-04-01 Rafael EspÃndola <espindola@google.com> * tree-cfg.c (verify_expr): remove in_phi. (verify_stmt): Don't call walk_tree with verify_expr. Use @@ -16789,7 +17081,7 @@ PR pch/13675 * c-pch.c (c_common_read_pch): On error close (fd) resp. fclose (f). -2008-04-01 Rafael Espindola <espindola@google.com> +2008-04-01 Rafael EspÃndola <espindola@google.com> * tree-vrp.c (extract_code_and_val_from_cond_with_ops): New. (extract_code_and_val_from_cond): Use @@ -16980,7 +17272,7 @@ vectorization support. * doc/invoke.texi (-mveclibabi) [svml]: Document new target option. -2008-03-28 Rafael Espindola <espindola@google.com> +2008-03-28 Rafael EspÃndola <espindola@google.com> * fold-const.c (tree_unary_nonnegative_warnv_p): Make it public. (tree_binary_nonnegative_warnv_p): Make it public. @@ -18773,7 +19065,7 @@ on hpux10. * configure: Rebuilt. -2008-03-04 Rafael Espindola <espindola@google.com> +2008-03-04 Rafael EspÃndola <espindola@google.com> * fold-const.c (tree_simple_nonnegative_warnv_p): New. (tree_unary_nonnegative_warnv_p): New. @@ -18794,7 +19086,7 @@ * config/i386/smmintrin.h (SIDD_XXX): Renamed to ... (_SIDD_XXX): This. -2008-03-04 Rafael Espindola <espindola@google.com> +2008-03-04 Rafael EspÃndola <espindola@google.com> * fold-const.c (tree_unary_nonzero_warnv_p): New. (tree_binary_nonzero_warnv_p): New. diff --git a/gcc/ChangeLog-1998 b/gcc/ChangeLog-1998 index bd2f722d1b0..140814035a4 100644 --- a/gcc/ChangeLog-1998 +++ b/gcc/ChangeLog-1998 @@ -7626,7 +7626,7 @@ Thu Aug 13 17:08:11 1998 Jason Merrill <jason@yorick.cygnus.com> * tree.c (get_file_function_name_long): Split out... (get_file_function_name): ...from here. -Thu Aug 13 16:09:53 1998 Martin von Loewis <loewis@informatik.hu-berlin.de> +Thu Aug 13 16:09:53 1998 Martin von Löwis <loewis@informatik.hu-berlin.de> * expr.c (safe_from_p): Change code to ERROR_MARK only when not accessing nodes. @@ -11595,7 +11595,7 @@ Thu May 21 23:09:50 1998 Jeffrey A Law (law@cygnus.com) * alias.c (rtx_equal_for_memref_p): Handle SCRATCH as a memory address. -Thu May 21 20:18:13 1998 Martin von Loewis <loewis@informatik.hu-berlin.de> +Thu May 21 20:18:13 1998 Martin von Löwis <loewis@informatik.hu-berlin.de> * Makefile.in (TREE_H): Add tree-check.h. (tree-check.h, gencheck): New targets. @@ -12506,7 +12506,7 @@ Wed May 13 12:54:19 1998 Michael Meissner <meissner@cygnus.com> (REG_N_CHANGES_SIZE, REG_N_CALLS_CROSSED, REG_LIVE_LENGTH): Likewise. (REGNO_FIRST_UID, REGNO_LAST_UID, REGNO_LAST_NOTE_UID): Likewise. -Wed May 13 12:54:19 1998 Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de> +Wed May 13 12:54:19 1998 Martin von Löwis <martin@mira.isdn.cs.tu-berlin.de> * acconfig.h (ENABLE_CHECKING): Undefine. * configure.in (--enable-checking): New option. @@ -14684,7 +14684,7 @@ Tue Mar 24 12:13:18 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * genpeep.c: Likewise. * genrecog.c: Likewise. -1998-03-24 Martin von Loewis <loewis@informatik.hu-berlin.de> +1998-03-24 Martin von Löwis <loewis@informatik.hu-berlin.de> * c-lang.c (lang_print_xnode): New function. * objc/objc-act.c (lang_print_xnode): Likewise. @@ -16061,7 +16061,7 @@ Sat Feb 14 02:02:41 1998 Jeffrey A Law (law@cygnus.com) * varasm.c (assemble_string): Similarly for 'i'. * i386.h (LEGITIMIZE_ADDRESS): Similarly for 'orig_x'. -1998-02-13 Martin von Loewis <loewis@informatik.hu-berlin.de> +1998-02-13 Martin von Löwis <loewis@informatik.hu-berlin.de> * c-lang.c (lang_print_xnode): New function. * objc/objc-act.c (lang_print_xnode): Likewise. diff --git a/gcc/ChangeLog-1999 b/gcc/ChangeLog-1999 index add129de3d1..ea81917c2e5 100644 --- a/gcc/ChangeLog-1999 +++ b/gcc/ChangeLog-1999 @@ -26,7 +26,7 @@ Fri Dec 31 19:10:31 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * Makefile.in (dwarfout.o): Depend on frame.h (dwarf2out.o): Likewise. -1999-12-29 "Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de> +1999-12-29 "Martin v. Löwis" <martin@loewis.home.cs.tu-berlin.de> Restore i386 binary compatibility in Dwarf EH info. * config/i386/i386.h (DWARF_FRAME_REGISTERS): Define as 17, the old @@ -15712,7 +15712,7 @@ Wed Apr 14 11:28:34 1999 Dave Brolley <brolley@cygnus.com> * config/i386/i386.c (memory_address_length): Add missing parenthesis. -Wed Apr 14 13:59:27 1999 Martin von Loewis <loewis@informatik.hu-berlin.de> +Wed Apr 14 13:59:27 1999 Martin von Löwis <loewis@informatik.hu-berlin.de> * extend.texi (Deprecated Features): New node. * invoke.texi (-Wdeprecated): Document. diff --git a/gcc/ChangeLog-2000 b/gcc/ChangeLog-2000 index 536137bb657..fcbad249f87 100644 --- a/gcc/ChangeLog-2000 +++ b/gcc/ChangeLog-2000 @@ -10367,7 +10367,7 @@ Mon Aug 28 19:02:13 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * ABOUT-GCC-NLS: Remove gettext patches from Paul Eggert as they have been incorporated into the gettext CVS. Change the text to reflect the current status of NLS. Add instructions for accessing - the gettext CVS and add the patch from Martin v. Loewis. + the gettext CVS and add the patch from Martin v. Löwis. 2000-08-27 Geoff Keating <geoffk@cygnus.com> @@ -11506,7 +11506,7 @@ Mon Aug 14 18:51:44 2000 J"orn Rennecke <amylaar@cygnus.co.uk> value, and we make a new quantity, make sure that it won't be mistaken by for a valid one by mention_regs. -2000-08-13 Ralf Gütlein <ralf.guetlein@aranea.de> +2000-08-13 Ralf Gütlein <ralf.guetlein@aranea.de> * h8300.md: Remove obsolete peepholes. @@ -15283,7 +15283,7 @@ Mon Jul 3 00:32:47 2000 Jeffrey A Law (law@cygnus.com) * pa/som.h (ASM_WEAKEN_LABEL): Export weak data symbols so that they have global scope. -2000-06-30 Martin von Loewis <loewis@informatik.hu-berlin.de> +2000-06-30 Martin von Löwis <loewis@informatik.hu-berlin.de> * invoke.texi (-Wreturn-type): In C++, a missing return type is always an error. @@ -21054,7 +21054,7 @@ Mon Apr 24 17:34:18 2000 Mumit Khan <khan@xraylith.wisc.edu> * configure.in (ENUM_BITFIELDS_ARE_UNSIGNED): Delete redundant call to AC_MSG_RESULT. -2000-04-24 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-04-24 Martin v. Löwis <loewis@informatik.hu-berlin.de> * invoke.texi: Correct grammatical errors, document -fno-gnu-keywords as identical to -fno-asm for C++. @@ -22250,7 +22250,7 @@ Tue Apr 11 09:55:59 2000 Jeffrey A Law (law@cygnus.com) 'long lineno' to 'unsigned int lineno'. (CPP_BUF_LINE, CPP_BUF_COL): New macros. -2000-04-11 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-04-11 Martin v. Löwis <loewis@informatik.hu-berlin.de> * extend.texi: ISO C99 is not a draft anymore. * invoke.texi: ISO C++ is not a draft anymore. @@ -22341,7 +22341,7 @@ Mon Apr 10 07:21:13 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> than GETC (). * cpphash.h: (CPP_BUMP_BUFFER_LINE_CUR, CPP_BUMP_LINE_CUR): New. -2000-04-10 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-04-10 Martin v. Löwis <loewis@informatik.hu-berlin.de> * invoke.texi (-fno-gnu-keywords): Remove classof, headof, __classof__, and __headof__ from the list of gnu keywords. @@ -23334,7 +23334,7 @@ Wed Apr 5 09:34:26 2000 Philippe De Muyter <phdm@macqel.be> * config/ia64/ia64.h (HARD_REGNO_RENAME_OK, RENAME_EXTENDED_BLOCKS): New macros. -2000-04-04 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-04-04 Martin v. Löwis <loewis@informatik.hu-berlin.de> * Makefile (gccbug): New target. (doc): Depend on it. @@ -24853,7 +24853,7 @@ Mon Mar 20 19:53:53 2000 Jim Wilson <wilson@cygnus.com> in the --enable-checking handling. * configure: Regenerate. -2000-03-20 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-03-20 Martin v. Löwis <loewis@informatik.hu-berlin.de> * c-parse.in (SAVE_WARN_FLAGS): Use size_int. * c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c: @@ -24864,7 +24864,7 @@ Mon Mar 20 11:43:15 MET 2000 Jan Hubicka <jh@suse.cz> * jump.c (delete_noop_moves): Remove code attempting to combine stack adjustments. -2000-03-19 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-03-19 Martin v. Löwis <loewis@informatik.hu-berlin.de> * emit-rtl.c (push_to_full_sequence, end_full_sequence): New functions. * except.c (emit_cleanup_handler): Use them. @@ -25120,7 +25120,7 @@ Fri Mar 17 08:09:14 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * config/c4x/c4x.h (CPP_SPEC): Fix typo. -2000-03-17 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-03-17 Martin v. Löwis <loewis@informatik.hu-berlin.de> * call.c (special_function_p): It is only malloc if it returns Pmode. @@ -26110,7 +26110,7 @@ Tue Mar 14 08:42:21 2000 Jeffrey A Law (law@cygnus.com) * i386.md: Revert 2000-01-16 change. -2000-03-14 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-03-14 Martin v. Löwis <loewis@informatik.hu-berlin.de> * gccbug.in: Add web category, gcc specific classes. @@ -26168,7 +26168,7 @@ Tue Mar 14 08:42:21 2000 Jeffrey A Law (law@cygnus.com) * cpphash.c (dump_hash_helper): Only dump nodes of type T_MACRO. Emit a newline after each definition. -2000-03-14 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-03-14 Martin v. Löwis <loewis@informatik.hu-berlin.de> * gccbug.in: New file. * configure.in (all_outputs): Add gccbug. @@ -27478,7 +27478,7 @@ Wed Mar 1 12:14:31 MET 2000 Jan Hubicka <jh@suse.cz> * calls.c (emit_library_call): Check for null REG. -2000-03-01 Martin von Loewis <loewis@informatik.hu-berlin.de> +2000-03-01 Martin von Löwis <loewis@informatik.hu-berlin.de> * c-decl.c (current_function_decl): Move to toplev.c. (init_decl_processing): Don't add current_function_decl as a ggc @@ -28212,7 +28212,7 @@ Fri Feb 18 20:08:57 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * config/arm/thumb.h (ASM_OUTPUT_ALIGN): Do not generate anything for an alignment of zero. -2000-02-18 Martin von Loewis <loewis@informatik.hu-berlin.de> +2000-02-18 Martin von Löwis <loewis@informatik.hu-berlin.de> * gcc.texi (Bug Reporting): Refer to bugs.html. (Bug Lists): Likewise. @@ -30660,7 +30660,7 @@ Tue Jan 18 16:19:55 MET 2000 Jan Hubicka <hubicka@freesoft.cz> * alpha.h (FLOAT_STORE_FLAG_VALUE): Use REAL_VALUE_ATOF. -2000-01-18 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-01-18 Martin v. Löwis <loewis@informatik.hu-berlin.de> * c-parse.in (SAVE_WARN_FLAGS): Create an INTEGER_CST. (RESTORE_WARN_FLAGS): Unpack it. @@ -32029,7 +32029,7 @@ Tue Jan 4 15:34:34 MET 2000 Jan Hubicka <hubicka@freesoft.cz> (rotlsi3_cmpno, rotlhi3_cmpno, rotlqi3_cmpno, rotrsi3_cmpno, rotrhi3_cmpno, rotrqi3_cmpno): Likewise. -2000-01-04 Martin von Löwis <loewis@informatik.hu-berlin.de> +2000-01-04 Martin von Löwis <loewis@informatik.hu-berlin.de> * ginclude/stdbool.h: Support compilation as C++. diff --git a/gcc/ChangeLog-2003 b/gcc/ChangeLog-2003 index 46045a92840..eac1c1419e1 100644 --- a/gcc/ChangeLog-2003 +++ b/gcc/ChangeLog-2003 @@ -5398,7 +5398,7 @@ (machopic_legitimize_pic_address): Improve codegen in dynamic-no-pic case. -2003-10-15 Gábor Lóki <alga@rgai.hu> +2003-10-15 Gábor Lóki <alga@rgai.hu> * fold-const.c (tree_swap_operands_p): Disable some features when optimizing for size. diff --git a/gcc/ChangeLog-2004 b/gcc/ChangeLog-2004 index 2adf3aef9e3..747b2fd36ca 100644 --- a/gcc/ChangeLog-2004 +++ b/gcc/ChangeLog-2004 @@ -20647,7 +20647,7 @@ * config/i386/xmmintrin.h: Include <mm_malloc.h>. 2004-08-03 H.J. Lu <hongjiu.lu@intel.com> - Tanguy Fautrà <tfautre@pandora.be> + Tanguy Fautré <tfautre@pandora.be> * config/i386/pmm_malloc.h: New file. diff --git a/gcc/ChangeLog-2006 b/gcc/ChangeLog-2006 index 7a41ca28efe..00d47c29139 100644 --- a/gcc/ChangeLog-2006 +++ b/gcc/ChangeLog-2006 @@ -7446,7 +7446,7 @@ * config/xtensa/lib1funcs.asm: Use C-style comments. -2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com> +2006-10-23 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * tree.c (local_define_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. @@ -18422,7 +18422,7 @@ (dump_decl_name): Do not walk the decl tree chains. * tree-pass.h (TDF_CHAIN): Remove. -2006-02-20 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> +2006-02-20 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Makefile.in (C): Remove (PROTO): Remove @@ -18982,7 +18982,7 @@ * opts.c (common_handle_option): Free new_option pointer. * df-core.c (df_analyze): Free postorder pointer. -2006-02-15 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> +2006-02-15 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Makefile.in: Fix the examples about the use of stamps @@ -22671,7 +22671,7 @@ * basic-block.h: Remove the prototype for partition_hot_cold_basic_blocks. -2006-01-16 Rafael Ãvila de EspÃ�ndola <rafael.espindola@gmail.com> +2006-01-16 Rafael Ãvila de EspÃ�ndola <rafael.espindola@gmail.com> * cppspec.c (lang_specific_spec_functions): Remove. * gcc.c (lookup_spec_function): Use static_spec_functions directly. diff --git a/gcc/ChangeLog-2007 b/gcc/ChangeLog-2007 index 004ef92911d..e76781bbd9d 100644 --- a/gcc/ChangeLog-2007 +++ b/gcc/ChangeLog-2007 @@ -18112,7 +18112,7 @@ movhi_insn, movqi_insn, movsf_insn, movdf_insn): Don't allow constant to memory moves. -2007-06-11 Rafael Avila de Espindola <espindola@google.com> +2007-06-11 Rafael Ãvila de EspÃndola <espindola@google.com> * tree.c (signed_or_unsigned_type_for): New. (unsigned_type_for): Use signed_or_unsigned_type_for. @@ -19817,7 +19817,7 @@ (i386_pe_mangle_decl_assembler_name): New. Wrap i386_pe_maybe_mangle_decl_assembler_name. -2007-05-16 Rafael Avila de Espindola <espindola@google.com> +2007-05-16 Rafael Ãvila de EspÃndola <espindola@google.com> * c-common.c (c_common_signed_or_unsigned_type): Delay the check for INTEGRAL_TYPE_P and TYPE_UNSIGNED. @@ -20845,7 +20845,7 @@ * config/i386/i386.c (ix86_scalar_mode_supported): TFmode is supported for TARGET_64BIT. -2007-05-16 Rafael Avila de Espindola <espindola@google.com> +2007-05-16 Rafael Ãvila de EspÃndola <espindola@google.com> * c-common.c (c_common_signed_or_unsigned_type): Emulate c_common_unsigned_type behavior. @@ -20983,7 +20983,7 @@ * genautomata.c (gen_regexp_el): Allocate correct size for regexp. -2007-05-14 Rafael Avila de Espindola <espindola@google.com> +2007-05-14 Rafael Ãvila de EspÃndola <espindola@google.com> * c-common.c (warnings_for_convert_and_check): Use unsigned_type_for instead of c_common_unsigned_type. @@ -24355,7 +24355,7 @@ * config/avr/avr.md (movw peephole2): New. (movw_r peephole2): New. -2007-03-30 Rafael Avila de Espindola <espindola@google.com> +2007-03-30 Rafael Ãvila de EspÃndola <espindola@google.com> * tree.h (get_signed_or_unsigned_type): New. * fold-const.c (operand_equal_for_comparison_p): Use @@ -26017,7 +26017,7 @@ * c-common.c (warn_logical_operator): Fix condition. -2007-03-10 Tobias Schl�ter <tobi@gcc.gnu.org> +2007-03-10 Tobias Schlüter <tobi@gcc.gnu.org> * config/i386/darwin.h (DARWIN_MINVERSION_SPEC): Add missing quotation mark. @@ -33161,7 +33161,7 @@ * langhooks.h (struct lang_hooks): Removed field 'can_use_bit_fields_p'. -2007-01-10 Ralf Corsépius <ralf.corsepius@rtems.org> +2007-01-10 Ralf Corsépius <ralf.corsepius@rtems.org> * config/bfin/t-bfin, config/bfin/t-bfin-elf: Remove GCC_CFLAGS. @@ -33390,7 +33390,7 @@ * config/frv/predicates.md (reg_or_0_operand): Accept CONST_DOUBLEs. -2007-01-08 Ralf Corsépius <ralf.corsepius@rtems.org> +2007-01-08 Ralf Corsépius <ralf.corsepius@rtems.org> * config/bfin/rtems.h, config/bfin/t-rtems: New. * config.gcc: Add bfin*-rtems*. diff --git a/gcc/ChangeLog.tuples b/gcc/ChangeLog.tuples index d5e338368b5..ab189c44902 100644 --- a/gcc/ChangeLog.tuples +++ b/gcc/ChangeLog.tuples @@ -2155,7 +2155,7 @@ and enable call to diagnose_omp_structured_block_errors. * Makefile.in (GTFILES): Add omp-low.c again. -2008-05-02 Rafael Espindola <espindola@google.com> +2008-05-02 Rafael EspÃndola <espindola@google.com> * tree-gimple.c (is_gimple_condexpr): Do not allow trapping comparisons. @@ -2203,7 +2203,7 @@ (verify_stmts): Add code to check that label_to_block_map and labels are consistent. -2008-04-22 Rafael Espindola <espindola@google.com> +2008-04-22 Rafael EspÃndola <espindola@google.com> Merge with mainline @134843. @@ -2243,17 +2243,17 @@ (lower_eh_constructs_2): Call maybe_record_in_goto_queue for GIMPLE_CONDs. -2008-05-01 Rafael Espindola <espindola@google.com> +2008-05-01 Rafael EspÃndola <espindola@google.com> * gimple-pretty-print.c (dump_gimple_try): Print like trunk does. (dump_gimple_catch): Print like trunk does. -2008-05-01 Rafael Espindola <espindola@google.com> +2008-05-01 Rafael EspÃndola <espindola@google.com> * passes.c (gimple_verify_flow_info): Enable remaining pass_rename_ssa_copies passes. -2008-05-01 Rafael Espindola <espindola@google.com> +2008-05-01 Rafael EspÃndola <espindola@google.com> * tree-cfg.c (gimple_verify_flow_info): Handle switches with only the default label. @@ -2274,17 +2274,17 @@ replace_locals_stmt, copy_gimple_seq_and_replace_locals): New. * tree-inline.h (copy_gimple_seq_and_replace_locals): New prototype. -2008-04-29 Rafael Espindola <espindola@google.com> +2008-04-29 Rafael EspÃndola <espindola@google.com> * gimple-pretty-print.c (dump_gimple_return): Add missing space. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Fix type of variable. -2008-04-29 Rafael Espindola <espindola@google.com> +2008-04-29 Rafael EspÃndola <espindola@google.com> * gimple-pretty-print.c (pp_cfg_jump): add missing ";". -2008-04-29 Rafael Espindola <espindola@google.com> +2008-04-29 Rafael EspÃndola <espindola@google.com> * gimple-pretty-print.c (dump_gimple_assign): print ";" at the end. (dump_gimple_return):print ";" at the end. @@ -2292,7 +2292,7 @@ (dump_gimple_cond): use op_symbol_code instead of tree_code_name. (pp_cfg_jump): print ";" at the end. -2008-04-29 Rafael Espindola <espindola@google.com> +2008-04-29 Rafael EspÃndola <espindola@google.com> * ipa-cp.c (ipcp_driver): Disable. * matrix-reorg.c (matrix_reorg): Comment body. @@ -2329,7 +2329,7 @@ (remap_gimple_stmt): Add code to handle GIMPLE_RESX region number remapping. -2008-04-28 Rafael Espindola <espindola@google.com> +2008-04-28 Rafael EspÃndola <espindola@google.com> * cfgexpand.c (gimple_to_tree): Add support for switch stmts without a default label. @@ -2412,7 +2412,7 @@ gimplify_do_stmt and gimplify_switch_stmt. Tuplify gimplification of CONTINUE_STMT and BREAK_STMT. -2008-04-26 Rafael Espindola <espindola@google.com> +2008-04-26 Rafael EspÃndola <espindola@google.com> * gimple.c (gimple_build_assign_with_ops): Don't set SSA_NAME_DEF_STMT. * gimple.h (gimple_assign_set_lhs): Set SSA_NAME_DEF_STMT. @@ -2468,7 +2468,7 @@ (gimplify_init_ctor_eval_range): Add a fall-through label for GIMPLE_COND statement. -2008-04-25 Rafael Espindola <espindola@google.com> +2008-04-25 Rafael EspÃndola <espindola@google.com> * tree-ssa-dom.c (avail_expr_eq): Return false if the hashes don't match. @@ -2481,12 +2481,12 @@ GIMPLE_CHANGE_DYNAMIC_TYPE. * tree-cfg.c (verify_types_in_gimple_stmt): Likewise. -2008-04-24 Rafael Espindola <espindola@google.com> +2008-04-24 Rafael EspÃndola <espindola@google.com> * tree-ssa-dom.c (initialize_hash_element): Fix the type of the code variable. -2008-04-23 Rafael Espindola <espindola@google.com> +2008-04-23 Rafael EspÃndola <espindola@google.com> * omp-low.c (gate_lower_omp): Return 0. * passes.c (init_optimization_passes): Enable all passes whose @@ -2516,7 +2516,7 @@ (lower_omp_1): Remove debugging code. * gimple.h (gimple_omp_parallel_combined_p): Add new argument. -2008-04-22 Rafael Espindola <espindola@google.com> +2008-04-22 Rafael EspÃndola <espindola@google.com> Merge with mainline @134552. @@ -2609,7 +2609,7 @@ (build_ssa_operands): Likewise. (stmt_references_memory_p): Remove. -2008-04-21 Rafael Espindola <espindola@google.com> +2008-04-21 Rafael EspÃndola <espindola@google.com> Cherry pick http://gcc.gnu.org/ml/gcc-patches/2008-04/msg01213.html @@ -2873,18 +2873,18 @@ * tree-cfg.c (need_fake_edge_p): Initialize CALL_FLAGS. -2008-04-12 Rafael Espindola <espindola@google.com> +2008-04-12 Rafael EspÃndola <espindola@google.com> Merge with mainline @134237. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-04-13 Rafael Espindola <espindola@google.com> +2008-04-13 Rafael EspÃndola <espindola@google.com> * config/extensions.m4: Add. Was missing from previous merge. -2008-04-12 Rafael Espindola <espindola@google.com> +2008-04-12 Rafael EspÃndola <espindola@google.com> Merge with mainline @133860. @@ -2963,7 +2963,7 @@ (tree_ssa_phiprop): Tuplify. * passes.c (init_optimization_passes): Re-enable pass_phiprop. -2008-04-11 Rafael Espindola <espindola@google.com> +2008-04-11 Rafael EspÃndola <espindola@google.com> * tree-ssa-math-opts.c (execute_cse_sincos_1): fix warning. @@ -3188,21 +3188,21 @@ if cfun is NULL. -2008-04-04 Rafael Espindola <espindola@google.com> +2008-04-04 Rafael EspÃndola <espindola@google.com> Merge with mainline @133632. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-04-04 Rafael Espindola <espindola@google.com> +2008-04-04 Rafael EspÃndola <espindola@google.com> Merge with mainline @133631. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-04-04 Rafael Espindola <espindola@google.com> +2008-04-04 Rafael EspÃndola <espindola@google.com> Merge with mainline @133630. @@ -3230,14 +3230,14 @@ (lower_nested_functions): Pass convert_nl_goto_receiver as the first parameter to walk_all_functions. -2008-04-03 Rafael Espindola <espindola@google.com> +2008-04-03 Rafael EspÃndola <espindola@google.com> Merge with mainline @133624. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-04-03 Rafael Espindola <espindola@google.com> +2008-04-03 Rafael EspÃndola <espindola@google.com> Merge with mainline @133612. @@ -3299,28 +3299,28 @@ * cfgexpand.c (gimple_to_tree): Generate assignment to return value if necessary. -2008-04-02 Rafael Espindola <espindola@google.com> +2008-04-02 Rafael EspÃndola <espindola@google.com> Merge with mainline @133597. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-04-02 Rafael Espindola <espindola@google.com> +2008-04-02 Rafael EspÃndola <espindola@google.com> Merge with mainline @133527. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-04-02 Rafael Espindola <espindola@google.com> +2008-04-02 Rafael EspÃndola <espindola@google.com> Merge with mainline @133519. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-04-02 Rafael Espindola <espindola@google.com> +2008-04-02 Rafael EspÃndola <espindola@google.com> Merge with mainline @133453. @@ -3373,35 +3373,35 @@ * gimplify.c (gimplify_switch_expr): Verify the return value from gimplify_expr. -2008-03-31 Rafael Espindola <espindola@google.com> +2008-03-31 Rafael EspÃndola <espindola@google.com> Merge with mainline @133452. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-03-31 Rafael Espindola <espindola@google.com> +2008-03-31 Rafael EspÃndola <espindola@google.com> Merge with mainline @133440. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-03-31 Rafael Espindola <espindola@google.com> +2008-03-31 Rafael EspÃndola <espindola@google.com> Merge with mainline @133423. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-03-30 Rafael Espindola <espindola@google.com> +2008-03-30 Rafael EspÃndola <espindola@google.com> Merge with mainline @133342. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-03-28 Rafael Espindola <espindola@google.com> +2008-03-28 Rafael EspÃndola <espindola@google.com> Merge with mainline @133341. @@ -3427,7 +3427,7 @@ * omp-low.c (expand_omp_sections): Fix build breakage due to an uninitialized variable. -2008-03-28 Rafael Espindola <espindola@google.com> +2008-03-28 Rafael EspÃndola <espindola@google.com> Merge with mainline @133315. @@ -3440,7 +3440,7 @@ V_MAIN and V_BACK. (expand_omp_for): Initialize VIN. -2008-03-28 Rafael Espindola <espindola@google.com> +2008-03-28 Rafael EspÃndola <espindola@google.com> Merge with mainline @133313. @@ -3521,14 +3521,14 @@ (gimple_has_location): Remove fixmes. * tree-cfg.c (gimple_block_label): Remove ATTRIBUTE_UNUSED. -2008-03-27 Rafael Espindola <espindola@google.com> +2008-03-27 Rafael EspÃndola <espindola@google.com> Merge with mainline @133311. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-03-27 Rafael Espindola <espindola@google.com> +2008-03-27 Rafael EspÃndola <espindola@google.com> * gcc/tree-nested.c (save_tmp_var): Use gsi_insert_after_without_update instead of gsi_insert_after. @@ -3546,20 +3546,20 @@ * testsuite/gcc.dg/tree-ssa/ssa-dse-10.c: {dg-final} changed. * testsuite/gcc.dg/tree-ssa/pr30375.c: {dg-final} changed. -2008-03-26 Rafael Espindola <espindola@google.com> +2008-03-26 Rafael EspÃndola <espindola@google.com> * gcc/tree-ssa-operands.c (ssa_operands_active): Assert that cfun is not NULL. * gcc/tree-nested.c (init_tmp_var): Use gsi_insert_before_without_update instead of gsi_insert_before. -2008-03-25 Rafael Espindola <espindola@google.com> +2008-03-25 Rafael EspÃndola <espindola@google.com> Merge with mainline @133309. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-03-25 Rafael Espindola <espindola@google.com> +2008-03-25 Rafael EspÃndola <espindola@google.com> Merge with mainline @133306. @@ -3576,7 +3576,7 @@ * passes.c (init_optimization_passes): Enable pass_copy_prop. -2008-03-25 Rafael Espindola <espindola@google.com> +2008-03-25 Rafael EspÃndola <espindola@google.com> Merge with mainline @133257. @@ -3593,35 +3593,35 @@ (gimplify_body): Updated the call to gimple_build_bind and moved the copying of block information into gimplify_bind_expr. -2008-03-25 Rafael Espindola <espindola@google.com> +2008-03-25 Rafael EspÃndola <espindola@google.com> Merge with mainline @133255. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-03-25 Rafael Espindola <espindola@google.com> +2008-03-25 Rafael EspÃndola <espindola@google.com> Merge with mainline @133251. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-03-25 Rafael Espindola <espindola@google.com> +2008-03-25 Rafael EspÃndola <espindola@google.com> Merge with mainline @133250. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-03-24 Rafael Espindola <espindola@google.com> +2008-03-24 Rafael EspÃndola <espindola@google.com> Merge with mainline @133246. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-03-24 Rafael Espindola <espindola@google.com> +2008-03-24 Rafael EspÃndola <espindola@google.com> Merge with mainline @133222. @@ -3632,21 +3632,21 @@ * passes.c (init_optimization_passes): Enable pass_split_crit_edges. -2008-03-24 Rafael Espindola <espindola@google.com> +2008-03-24 Rafael EspÃndola <espindola@google.com> Merge with mainline @133169. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-03-21 Rafael Espindola <espindola@google.com> +2008-03-21 Rafael EspÃndola <espindola@google.com> Merge with mainline @133168. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-03-21 Rafael Espindola <espindola@google.com> +2008-03-21 Rafael EspÃndola <espindola@google.com> Merge with mainline @133167. @@ -3680,28 +3680,28 @@ (gimplify_call_expr): Remove call to get_tmp_var_for, set gimple_register on a new lhs in some cases. -2008-03-20 Rafael Espindola <espindola@google.com> +2008-03-20 Rafael EspÃndola <espindola@google.com> Merge with mainline @133162. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-03-20 Rafael Espindola <espindola@google.com> +2008-03-20 Rafael EspÃndola <espindola@google.com> Merge with mainline @133161. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-03-20 Rafael Espindola <espindola@google.com> +2008-03-20 Rafael EspÃndola <espindola@google.com> Merge with mainline @133140. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. -2008-03-20 Rafael Espindola <espindola@google.com> +2008-03-20 Rafael EspÃndola <espindola@google.com> Merge with mainline @133138. @@ -4082,7 +4082,7 @@ * tree-phinodes.c (allocate_phi_node): Fix syntax errors from previous commit. -2008-03-05 Rafael Espindola <espindola@google.com> +2008-03-05 Rafael EspÃndola <espindola@google.com> * tree-phinodes.c (allocate_phi_node): free free_phinodes[bucket] if empty. @@ -4157,7 +4157,7 @@ pass_warn_function_return, pass_update_address_taken, pass_simple_dse and pass_build_alias passes. -2008-03-04 Rafael Espindola <espindola@google.com> +2008-03-04 Rafael EspÃndola <espindola@google.com> * fold-const.c (tree_simple_nonnegative_warnv_p): New. (tree_unary_nonnegative_warnv_p): New. @@ -4224,7 +4224,7 @@ (struct gimple_cfg_hooks): Enable block_ends_with_call_p callback. -2008-03-04 Rafael Espindola <espindola@google.com> +2008-03-04 Rafael EspÃndola <espindola@google.com> * fold-const.c (tree_unary_nonzero_warnv_p): New. (tree_binary_nonzero_warnv_p): New. @@ -4297,12 +4297,12 @@ * tree-cfg.c (replace_uses_by): Check that op is not null. * passes.c (init_optimization_passes): Enable pass_lim. -2008-02-28 Rafael Espindola <espindola@google.com> +2008-02-28 Rafael EspÃndola <espindola@google.com> * tree-outof-ssa.c (insert_backedge_copies): Don't build uninitialized assignment. -2008-02-28 Rafael Espindola <espindola@google.com> +2008-02-28 Rafael EspÃndola <espindola@google.com> * tree-dfa.c (dump_dfa_stats): cast dfa_stats.max_num_phi_args to long. @@ -4503,11 +4503,11 @@ * tree-cfgcleanup.c (tree_forwarder_block_p): Fix test for PHI_WANTED. -2008-02-25 Rafael Espindola <espindola@google.com> +2008-02-25 Rafael EspÃndola <espindola@google.com> * tree-cfgcleanup.c (tree_forwarder_block_p): fix thinko. -2008-02-24 Rafael Espindola <espindola@google.com> +2008-02-24 Rafael EspÃndola <espindola@google.com> * gimple-iterator.c (gsi_split_seq_before): Don't abort if at the beginning. @@ -4544,18 +4544,18 @@ (copy_or_nop_cast_stmt_rhs): New. * gimple.h (copy_or_nop_cast_stmt_rhs): Declare. -2008-02-21 Rafael Espindola <espindola@google.com> +2008-02-21 Rafael EspÃndola <espindola@google.com> * gimple.h (gimple_cond_true_p): Define. (gimple_cond_false_p): Define. (gimple_cond_single_var_p): Define. -2008-02-21 Rafael Espindola <espindola@google.com> +2008-02-21 Rafael EspÃndola <espindola@google.com> * tree-tailcall.c (adjust_accumulator_values): Check that a phi was found. -2008-02-21 Rafael Espindola <espindola@google.com> +2008-02-21 Rafael EspÃndola <espindola@google.com> * tree-tailcall.c (adjust_accumulator_values): Initialize phi. @@ -4573,13 +4573,13 @@ * gimplify.c (gimplify_expr): Save locus into the right sequence. -2008-02-20 Rafael Espindola <espindola@google.com> +2008-02-20 Rafael EspÃndola <espindola@google.com> * passes.c (init_optimization_passes): Enable pass_mark_used_blocks and pass_cleanup_cfg_post_optimizing. * tree-optimize.c (execute_cleanup_cfg_post_optimizing): call cleanup_tree_cfg. -2008-02-20 Rafael Espindola <espindola@google.com> +2008-02-20 Rafael EspÃndola <espindola@google.com> * passes.c (init_optimization_passes): Enable pass_nrv. * tree-nrv.c (finalize_nrv_r): data is now a walk_stmt_info. @@ -4719,7 +4719,7 @@ ebitmap.o-warn, lower-subreg.o-warn, tree-chrec.o-warn): Change -Wno-error to -Wno-uninitialized. -2008-02-19 Rafael Espindola <espindola@google.com> +2008-02-19 Rafael EspÃndola <espindola@google.com> * tree-eh.c (collect_finally_tree): handle GIMPLE_SWITCH. @@ -4980,7 +4980,7 @@ markers to execute pass_expand. Guard more passes under #if 0. -2008-02-01 Rafael Espindola <espindola@google.com> +2008-02-01 Rafael EspÃndola <espindola@google.com> * passes.c (init_optimization_passes): Enable pass_del_ssa. @@ -5006,12 +5006,12 @@ (create_outofssa_var_map):Port to tuples. (coalesce_partitions): Port to tuples. -2008-02-01 Rafael Espindola <espindola@google.com> +2008-02-01 Rafael EspÃndola <espindola@google.com> * tree-ssa-operands.c (free_stmt_operands): Only free with_ops.addresses_taken if stmt has ops. -2008-01-31 Rafael Espindola <espindola@google.com> +2008-01-31 Rafael EspÃndola <espindola@google.com> * tree-optimize.c (pass_free_cfg_annotations): Flip works_with_tuples_p. @@ -5033,16 +5033,16 @@ lower-subreg.o-warn, tree-chrec.o-warn, varasm.o-warn): New. -2008-01-30 Rafael Espindola <espindola@google.com> +2008-01-30 Rafael EspÃndola <espindola@google.com> * gimplify.c (gimplify_scan_omp_clauses): Comment out pop_gimplify_context calls -2008-01-30 Rafael Espindola <espindola@google.com> +2008-01-30 Rafael EspÃndola <espindola@google.com> * gimple.h (gsi_after_labels): Add. -2008-01-30 Rafael Espindola <espindola@google.com> +2008-01-30 Rafael EspÃndola <espindola@google.com> * Makefile.in (tree-complex.o): Uncomment gt-tree-vect-generic.h. (GTFILES): Add tree-vect-generic.c. @@ -5070,7 +5070,7 @@ (pass_lower_vector): flip works_with_tuples_p (pass_lower_vector_ssa) flip works_with_tuples_ -2008-01-29 Rafael Espindola <espindola@google.com> +2008-01-29 Rafael EspÃndola <espindola@google.com> http://gcc.gnu.org/ml/gcc-patches/2008-01/msg01434.html diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index ca942ebb0fe..92b72ce4934 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20080904 +20080906 diff --git a/gcc/FSFChangeLog b/gcc/FSFChangeLog index d8cdf7bd564..07ede2f0f77 100644 --- a/gcc/FSFChangeLog +++ b/gcc/FSFChangeLog @@ -1220,7 +1220,7 @@ Mon Jun 8 14:40:02 1998 John Wehle (john@feith.com) (movsf_normal): Change to unnamed pattern. Likewise for movdf, movxf, and friends. -Mon Jun 8 13:18:04 1998 Martin v. Loewis <loewis@informatik.hu-berlin.de> +Mon Jun 8 13:18:04 1998 Martin v. Löwis <loewis@informatik.hu-berlin.de> * Makefile.in (TREE_H): Add tree-check.h. (tree-check.h, s-check, gencheck): New targets. diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 745c8431e5d..0ce56a66a97 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2008-09-05 Joel Sherrill <joel.sherrill@oarcorp.com> + + * s-stchop-rtems.adb: Add file missed in early commit. Already + referenced in gcc-interface/Makefile.in. + 2008-08-30 Thomas Quinot <quinot@adacore.com> * gcc-interface/Make-lang.in: Allow s-oscons.{o,ali} to @@ -11758,7 +11763,7 @@ PR ada/10768 POINTER_PLUS_EXPR's operands. When adding an offset to a pointer, use POINTER_PLUS_EXPR. -2007-06-11 Rafael Avila de Espindola <espindola@google.com> +2007-06-11 Rafael Ãvila de EspÃndola <espindola@google.com> * trans.c (Attribute_to_gnu): Use signed_or_unsigned_type_for instead of get_signed_or_unsigned_type. @@ -14424,7 +14429,7 @@ PR ada/10768 * misc.c (enumerate_modes): Consider log2_b to always be one. -2007-05-14 Rafael Avila de Espindola <espindola@google.com> +2007-05-14 Rafael Ãvila de EspÃndola <espindola@google.com> * misc.c (LANG_HOOKS_UNSIGNED_TYPE): Remove. @@ -16244,7 +16249,7 @@ PR ada/10768 (Print_Name,Print_Node): Make these debug printouts more robust: print "no such..." instead of crashing on bad input. -2007-03-30 Rafael Avila de Espindola <espindola@google.com> +2007-03-30 Rafael Ãvila de EspÃndola <espindola@google.com> * trans.c (Attribute_to_gnu): Use get_signed_or_unsigned_type instead of gnat_signed_or_unsigned_type. @@ -18939,7 +18944,7 @@ PR ada/10768 * fe.h: Remove redundant declarations. -2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com> +2006-10-23 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * utils.c (builtin_function): Rename to gnat_builtin_function. Move common code to add_builtin_function. @@ -19090,7 +19095,7 @@ PR ada/10768 * utils.c (create_var_decl): Use have_global_bss_p when deciding whether to make the decl common. -2006-02-20 Rafael �vila de Esp�ndola <rafael.espindola@gmail.com> +2006-02-20 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in (Ada): Remove. (.PHONY): Remove Ada @@ -21548,11 +21553,11 @@ PR ada/10768 * s-bitops.adb: Clarify comment for Bits_Array -2005-12-07 Rafael �vila de Esp�ndola <rafael.espindola@gmail.com> +2005-12-07 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in (ada.install-normal): Remove. -2005-12-07 Rafael �vila de Esp�ndola <rafael.espindola@gmail.com> +2005-12-07 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in: Remove all dependencies on s-gtype. diff --git a/gcc/ada/s-stchop-rtems.adb b/gcc/ada/s-stchop-rtems.adb new file mode 100644 index 00000000000..3b06bb64c3b --- /dev/null +++ b/gcc/ada/s-stchop-rtems.adb @@ -0,0 +1,114 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- +-- -- +-- S Y S T E M . S T A C K _ C H E C K I N G . O P E R A T I O N S -- +-- -- +-- B o d y -- +-- -- +-- Copyright (C) 1999-2008, Free Software Foundation, Inc. -- +-- -- +-- GNARL is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 2, or (at your option) any later ver- -- +-- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- +-- OUT 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 distributed with GNARL; see file COPYING. If not, write -- +-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- +-- Boston, MA 02110-1301, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNARL was developed by the GNARL team at Florida State University. -- +-- Extensive contributions were provided by Ada Core Technologies, Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This is the RTEMS version of this package. +-- This file should be kept synchronized with the general implementation +-- provided by s-stchop.adb. + +pragma Restrictions (No_Elaboration_Code); +-- We want to guarantee the absence of elaboration code because the +-- binder does not handle references to this package. + +with Ada.Exceptions; + +with Interfaces.C; use Interfaces.C; + +package body System.Stack_Checking.Operations is + + ---------------------------- + -- Invalidate_Stack_Cache -- + ---------------------------- + + procedure Invalidate_Stack_Cache (Any_Stack : Stack_Access) is + pragma Warnings (Off, Any_Stack); + begin + Cache := Null_Stack; + end Invalidate_Stack_Cache; + + ----------------------------- + -- Notify_Stack_Attributes -- + ----------------------------- + + procedure Notify_Stack_Attributes + (Initial_SP : System.Address; + Size : System.Storage_Elements.Storage_Offset) + is + + -- RTEMS keeps all the information we need. + + pragma Unreferenced (Size); + pragma Unreferenced (Initial_SP); + + begin + null; + end Notify_Stack_Attributes; + + ----------------- + -- Stack_Check -- + ----------------- + + function Stack_Check + (Stack_Address : System.Address) return Stack_Access + is + pragma Unreferenced (Stack_Address); + + -- RTEMS has a routine to check this. So use it. + function rtems_stack_checker_is_blown return Interfaces.C.int; + pragma Import (C, + rtems_stack_checker_is_blown, "rtems_stack_checker_is_blown"); + + begin + -- RTEMS has a routine to check this. So use it. + + if rtems_stack_checker_is_blown /= 0 then + Ada.Exceptions.Raise_Exception + (E => Storage_Error'Identity, + Message => "stack overflow detected"); + end if; + + return null; + + end Stack_Check; + + ------------------------ + -- Update_Stack_Cache -- + ------------------------ + + procedure Update_Stack_Cache (Stack : Stack_Access) is + begin + if not Multi_Processor then + Cache := Stack; + end if; + end Update_Stack_Cache; + +end System.Stack_Checking.Operations; diff --git a/gcc/calls.c b/gcc/calls.c index 96d05eaf502..a3d35b3bf5c 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -3423,7 +3423,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, flags |= ECF_PURE; } - if (GET_MODE (val) == MEM && !must_copy) + if (MEM_P (val) && !must_copy) slot = val; else { diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c index 90a67888b97..8e0f355d176 100644 --- a/gcc/config/bfin/bfin.c +++ b/gcc/config/bfin/bfin.c @@ -4457,6 +4457,11 @@ gen_one_bundle (rtx slot[3]) { gcc_assert (slot[1] != NULL_RTX); + /* Don't add extra NOPs if optimizing for size. */ + if (optimize_size + && (slot[0] == NULL_RTX || slot[2] == NULL_RTX)) + return false; + /* Verify that we really can do the multi-issue. */ if (slot[0]) { diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 2c016328e4c..e847a11ea3a 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -16994,6 +16994,7 @@ decide_alg (HOST_WIDE_INT count, HOST_WIDE_INT expected_size, bool memset, int *dynamic_check) { const struct stringop_algs * algs; + bool optimize_for_speed; /* Algorithms using the rep prefix want at least edi and ecx; additionally, memset wants eax and memcpy wants esi. Don't consider such algorithms if the user has appropriated those @@ -17008,7 +17009,16 @@ decide_alg (HOST_WIDE_INT count, HOST_WIDE_INT expected_size, bool memset, && alg != rep_prefix_8_byte)) const struct processor_costs *cost; - cost = optimize_insn_for_size_p () ? &ix86_size_cost : ix86_cost; + /* Even if the string operation call is cold, we still might spend a lot + of time processing large blocks. */ + if (optimize_function_for_size_p (cfun) + || (optimize_insn_for_size_p () + && expected_size != -1 && expected_size < 256)) + optimize_for_speed = false; + else + optimize_for_speed = true; + + cost = optimize_for_speed ? ix86_cost : &ix86_size_cost; *dynamic_check = -1; if (memset) @@ -17018,7 +17028,7 @@ decide_alg (HOST_WIDE_INT count, HOST_WIDE_INT expected_size, bool memset, if (stringop_alg != no_stringop && ALG_USABLE_P (stringop_alg)) return stringop_alg; /* rep; movq or rep; movl is the smallest variant. */ - else if (optimize_insn_for_size_p ()) + else if (!optimize_for_speed) { if (!count || (count & 3)) return rep_prefix_usable ? rep_prefix_1_byte : loop_1_byte; diff --git a/gcc/config/mips/mips-ftypes.def b/gcc/config/mips/mips-ftypes.def index 8ae54ebe263..df0d9ff2aa3 100644 --- a/gcc/config/mips/mips-ftypes.def +++ b/gcc/config/mips/mips-ftypes.def @@ -120,6 +120,7 @@ DEF_MIPS_FTYPE (2, (V8QI, V4HI, V4HI)) DEF_MIPS_FTYPE (1, (V8QI, V8QI)) DEF_MIPS_FTYPE (2, (V8QI, V8QI, V8QI)) +DEF_MIPS_FTYPE (2, (VOID, SI, CVPOINTER)) DEF_MIPS_FTYPE (2, (VOID, SI, SI)) DEF_MIPS_FTYPE (2, (VOID, V2HI, V2HI)) DEF_MIPS_FTYPE (2, (VOID, V4QI, V4QI)) diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h index 01645a1ebc2..9403945a4f3 100644 --- a/gcc/config/mips/mips-protos.h +++ b/gcc/config/mips/mips-protos.h @@ -314,6 +314,10 @@ extern bool mips_use_ins_ext_p (rtx, HOST_WIDE_INT, HOST_WIDE_INT); extern const char *mips16e_output_save_restore (rtx, HOST_WIDE_INT); extern bool mips16e_save_restore_pattern_p (rtx, HOST_WIDE_INT, struct mips16e_save_restore_info *); + +extern bool mask_low_and_shift_p (enum machine_mode, rtx, rtx, int); +extern int mask_low_and_shift_len (enum machine_mode, rtx, rtx); + union mips_gen_fn_ptrs { rtx (*fn_6) (rtx, rtx, rtx, rtx, rtx, rtx); diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index dea7ffe57fa..799570cc7ae 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -148,6 +148,13 @@ enum mips_address_type { ADDRESS_SYMBOLIC }; +/* Enumerates the setting of the -mr10k-cache-barrier option. */ +enum mips_r10k_cache_barrier_setting { + R10K_CACHE_BARRIER_NONE, + R10K_CACHE_BARRIER_STORE, + R10K_CACHE_BARRIER_LOAD_STORE +}; + /* Macros to create an enumeration identifier for a function prototype. */ #define MIPS_FTYPE_NAME1(A, B) MIPS_##A##_FTYPE_##B #define MIPS_FTYPE_NAME2(A, B, C) MIPS_##A##_FTYPE_##B##_##C @@ -456,6 +463,9 @@ static int mips_base_align_functions; /* align_functions */ /* The -mcode-readable setting. */ enum mips_code_readable_setting mips_code_readable = CODE_READABLE_YES; +/* The -mr10k-cache-barrier setting. */ +static enum mips_r10k_cache_barrier_setting mips_r10k_cache_barrier; + /* Index [M][R] is true if register R is allowed to hold a value of mode M. */ bool mips_hard_regno_mode_ok[(int) MAX_MACHINE_MODE][FIRST_PSEUDO_REGISTER]; @@ -502,7 +512,7 @@ const enum reg_class mips_regno_to_class[FIRST_PSEUDO_REGISTER] = { MD0_REG, MD1_REG, NO_REGS, ST_REGS, ST_REGS, ST_REGS, ST_REGS, ST_REGS, ST_REGS, ST_REGS, ST_REGS, NO_REGS, - NO_REGS, ALL_REGS, ALL_REGS, NO_REGS, + NO_REGS, FRAME_REGS, FRAME_REGS, NO_REGS, COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, @@ -4222,8 +4232,14 @@ mips_expand_scc (enum rtx_code code, rtx target) if (code == EQ || code == NE) { - rtx zie = mips_zero_if_equal (cmp_operands[0], cmp_operands[1]); - mips_emit_binary (code, target, zie, const0_rtx); + if (ISA_HAS_SEQ_SNE + && reg_imm10_operand (cmp_operands[1], GET_MODE (cmp_operands[1]))) + mips_emit_binary (code, target, cmp_operands[0], cmp_operands[1]); + else + { + rtx zie = mips_zero_if_equal (cmp_operands[0], cmp_operands[1]); + mips_emit_binary (code, target, zie, const0_rtx); + } } else mips_emit_int_order_test (code, 0, target, @@ -6157,7 +6173,8 @@ mips_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED) because there is no direct "jx" instruction equivalent to "jalx" to switch the ISA mode. We only care about cases where the sibling and normal calls would both be direct. */ - if (mips_use_mips16_mode_p (decl) + if (decl + && mips_use_mips16_mode_p (decl) && const_call_insn_operand (XEXP (DECL_RTL (decl), 0), VOIDmode)) return false; @@ -6659,6 +6676,32 @@ mips_use_ins_ext_p (rtx op, HOST_WIDE_INT width, HOST_WIDE_INT bitpos) return true; } + +/* Check if MASK and SHIFT are valid in mask-low-and-shift-left + operation if MAXLEN is the maxium length of consecutive bits that + can make up MASK. MODE is the mode of the operation. See + mask_low_and_shift_len for the actual definition. */ + +bool +mask_low_and_shift_p (enum machine_mode mode, rtx mask, rtx shift, int maxlen) +{ + return IN_RANGE (mask_low_and_shift_len (mode, mask, shift), 1, maxlen); +} + +/* The canonical form of a mask-low-and-shift-left operation is + (and (ashift X SHIFT) MASK) where MASK has the lower SHIFT number of bits + cleared. Thus we need to shift MASK to the right before checking if it + is a valid mask value. MODE is the mode of the operation. If true + return the length of the mask, otherwise return -1. */ + +int +mask_low_and_shift_len (enum machine_mode mode, rtx mask, rtx shift) +{ + HOST_WIDE_INT shval; + + shval = INTVAL (shift) & (GET_MODE_BITSIZE (mode) - 1); + return exact_log2 ((UINTVAL (mask) >> shval) + 1); +} /* Return true if -msplit-addresses is selected and should be honored. @@ -7026,6 +7069,7 @@ mips_print_float_branch_condition (FILE *file, enum rtx_code code, int letter) 'X' Print CONST_INT OP in hexadecimal format. 'x' Print the low 16 bits of CONST_INT OP in hexadecimal format. 'd' Print CONST_INT OP in decimal. + 'm' Print one less than CONST_INT OP in decimal. 'h' Print the high-part relocation associated with OP, after stripping any outermost HIGH. 'R' Print the low-part relocation associated with OP. @@ -7081,6 +7125,13 @@ mips_print_operand (FILE *file, rtx op, int letter) output_operand_lossage ("invalid use of '%%%c'", letter); break; + case 'm': + if (GET_CODE (op) == CONST_INT) + fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (op) - 1); + else + output_operand_lossage ("invalid use of '%%%c'", letter); + break; + case 'h': if (code == HIGH) op = XEXP (op, 0); @@ -10882,6 +10933,7 @@ AVAIL_NON_MIPS16 (dspr2, TARGET_DSPR2) AVAIL_NON_MIPS16 (dsp_32, !TARGET_64BIT && TARGET_DSP) AVAIL_NON_MIPS16 (dspr2_32, !TARGET_64BIT && TARGET_DSPR2) AVAIL_NON_MIPS16 (loongson, TARGET_LOONGSON_VECTORS) +AVAIL_NON_MIPS16 (cache, TARGET_CACHE_BUILTIN) /* Construct a mips_builtin_description from the given arguments. @@ -11312,7 +11364,10 @@ static const struct mips_builtin_description mips_builtins[] = { LOONGSON_BUILTIN_SUFFIX (punpcklwd, u, MIPS_UV2SI_FTYPE_UV2SI_UV2SI), LOONGSON_BUILTIN_SUFFIX (punpcklbh, s, MIPS_V8QI_FTYPE_V8QI_V8QI), LOONGSON_BUILTIN_SUFFIX (punpcklhw, s, MIPS_V4HI_FTYPE_V4HI_V4HI), - LOONGSON_BUILTIN_SUFFIX (punpcklwd, s, MIPS_V2SI_FTYPE_V2SI_V2SI) + LOONGSON_BUILTIN_SUFFIX (punpcklwd, s, MIPS_V2SI_FTYPE_V2SI_V2SI), + + /* Sundry other built-in functions. */ + DIRECT_NO_TARGET_BUILTIN (cache, MIPS_VOID_FTYPE_SI_CVPOINTER, cache) }; /* MODE is a vector mode whose elements have type TYPE. Return the type @@ -11334,10 +11389,25 @@ mips_builtin_vector_type (tree type, enum machine_mode mode) return types[mode_index]; } +/* Return a type for 'const volatile void *'. */ + +static tree +mips_build_cvpointer_type (void) +{ + static tree cache; + + if (cache == NULL_TREE) + cache = build_pointer_type (build_qualified_type + (void_type_node, + TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE)); + return cache; +} + /* Source-level argument types. */ #define MIPS_ATYPE_VOID void_type_node #define MIPS_ATYPE_INT integer_type_node #define MIPS_ATYPE_POINTER ptr_type_node +#define MIPS_ATYPE_CVPOINTER mips_build_cvpointer_type () /* Standard mode-based argument types. */ #define MIPS_ATYPE_UQI unsigned_intQI_type_node @@ -11437,7 +11507,13 @@ mips_prepare_builtin_arg (enum insn_code icode, mode = insn_data[icode].operand[opno].mode; if (!insn_data[icode].operand[opno].predicate (value, mode)) { - value = copy_to_mode_reg (mode, value); + /* Cope with address operands, where MODE is not the mode of + VALUE itself. */ + if (GET_MODE (value) == VOIDmode) + value = copy_to_mode_reg (mode, value); + else + value = copy_to_reg (value); + /* Check the predicate again. */ if (!insn_data[icode].operand[opno].predicate (value, mode)) { @@ -11984,6 +12060,378 @@ mips16_lay_out_constants (void) mips16_emit_constants (pool.first, get_last_insn ()); } +/* Return true if it is worth r10k_simplify_address's while replacing + an address with X. We are looking for constants, and for addresses + at a known offset from the incoming stack pointer. */ + +static bool +r10k_simplified_address_p (rtx x) +{ + if (GET_CODE (x) == PLUS && CONST_INT_P (XEXP (x, 1))) + x = XEXP (x, 0); + return x == virtual_incoming_args_rtx || CONSTANT_P (x); +} + +/* X is an expression that appears in INSN. Try to use the UD chains + to simplify it, returning the simplified form on success and the + original form otherwise. Replace the incoming value of $sp with + virtual_incoming_args_rtx (which should never occur in X otherwise). */ + +static rtx +r10k_simplify_address (rtx x, rtx insn) +{ + rtx newx, op0, op1, set, def_insn, note; + struct df_ref *use, *def; + struct df_link *defs; + + newx = NULL_RTX; + if (UNARY_P (x)) + { + op0 = r10k_simplify_address (XEXP (x, 0), insn); + if (op0 != XEXP (x, 0)) + newx = simplify_gen_unary (GET_CODE (x), GET_MODE (x), + op0, GET_MODE (XEXP (x, 0))); + } + else if (BINARY_P (x)) + { + op0 = r10k_simplify_address (XEXP (x, 0), insn); + op1 = r10k_simplify_address (XEXP (x, 1), insn); + if (op0 != XEXP (x, 0) || op1 != XEXP (x, 1)) + newx = simplify_gen_binary (GET_CODE (x), GET_MODE (x), op0, op1); + } + else if (GET_CODE (x) == LO_SUM) + { + /* LO_SUMs can be offset from HIGHs, if we know they won't + overflow. See mips_classify_address for the rationale behind + the lax check. */ + op0 = r10k_simplify_address (XEXP (x, 0), insn); + if (GET_CODE (op0) == HIGH) + newx = XEXP (x, 1); + } + else if (REG_P (x)) + { + /* Uses are recorded by regno_reg_rtx, not X itself. */ + use = df_find_use (insn, regno_reg_rtx[REGNO (x)]); + gcc_assert (use); + defs = DF_REF_CHAIN (use); + + /* Require a single definition. */ + if (defs && defs->next == NULL) + { + def = defs->ref; + if (DF_REF_IS_ARTIFICIAL (def)) + { + /* Replace the incoming value of $sp with + virtual_incoming_args_rtx. */ + if (x == stack_pointer_rtx + && DF_REF_BB (def) == ENTRY_BLOCK_PTR) + newx = virtual_incoming_args_rtx; + } + else if (dominated_by_p (CDI_DOMINATORS, DF_REF_BB (use), + DF_REF_BB (def))) + { + /* Make sure that DEF_INSN is a single set of REG. */ + def_insn = DF_REF_INSN (def); + if (NONJUMP_INSN_P (def_insn)) + { + set = single_set (def_insn); + if (set && rtx_equal_p (SET_DEST (set), x)) + { + /* Prefer to use notes, since the def-use chains + are often shorter. */ + note = find_reg_equal_equiv_note (def_insn); + if (note) + newx = XEXP (note, 0); + else + newx = SET_SRC (set); + newx = r10k_simplify_address (newx, def_insn); + } + } + } + } + } + if (newx && r10k_simplified_address_p (newx)) + return newx; + return x; +} + +/* Return true if ADDRESS is known to be an uncached address + on R10K systems. */ + +static bool +r10k_uncached_address_p (unsigned HOST_WIDE_INT address) +{ + unsigned HOST_WIDE_INT upper; + + /* Check for KSEG1. */ + if (address + 0x60000000 < 0x20000000) + return true; + + /* Check for uncached XKPHYS addresses. */ + if (Pmode == DImode) + { + upper = (address >> 40) & 0xf9ffff; + if (upper == 0x900000 || upper == 0xb80000) + return true; + } + return false; +} + +/* Return true if we can prove that an access to address X in instruction + INSN would be safe from R10K speculation. This X is a general + expression; it might not be a legitimate address. */ + +static bool +r10k_safe_address_p (rtx x, rtx insn) +{ + rtx base, offset; + HOST_WIDE_INT offset_val; + + x = r10k_simplify_address (x, insn); + + /* Check for references to the stack frame. It doesn't really matter + how much of the frame has been allocated at INSN; -mr10k-cache-barrier + allows us to assume that accesses to any part of the eventual frame + is safe from speculation at any point in the function. */ + mips_split_plus (x, &base, &offset_val); + if (base == virtual_incoming_args_rtx + && offset_val >= -cfun->machine->frame.total_size + && offset_val < cfun->machine->frame.args_size) + return true; + + /* Check for uncached addresses. */ + if (CONST_INT_P (x)) + return r10k_uncached_address_p (INTVAL (x)); + + /* Check for accesses to a static object. */ + split_const (x, &base, &offset); + return offset_within_block_p (base, INTVAL (offset)); +} + +/* Return true if a MEM with MEM_EXPR EXPR and MEM_OFFSET OFFSET is + an in-range access to an automatic variable, or to an object with + a link-time-constant address. */ + +static bool +r10k_safe_mem_expr_p (tree expr, rtx offset) +{ + if (expr == NULL_TREE + || offset == NULL_RTX + || !CONST_INT_P (offset) + || INTVAL (offset) < 0 + || INTVAL (offset) >= int_size_in_bytes (TREE_TYPE (expr))) + return false; + + while (TREE_CODE (expr) == COMPONENT_REF) + { + expr = TREE_OPERAND (expr, 0); + if (expr == NULL_TREE) + return false; + } + + return DECL_P (expr); +} + +/* A for_each_rtx callback for which DATA points to the instruction + containing *X. Stop the search if we find a MEM that is not safe + from R10K speculation. */ + +static int +r10k_needs_protection_p_1 (rtx *loc, void *data) +{ + rtx mem; + + mem = *loc; + if (!MEM_P (mem)) + return 0; + + if (r10k_safe_mem_expr_p (MEM_EXPR (mem), MEM_OFFSET (mem))) + return -1; + + if (r10k_safe_address_p (XEXP (mem, 0), (rtx) data)) + return -1; + + return 1; +} + +/* A note_stores callback for which DATA points to an instruction pointer. + If *DATA is nonnull, make it null if it X contains a MEM that is not + safe from R10K speculation. */ + +static void +r10k_needs_protection_p_store (rtx x, const_rtx pat ATTRIBUTE_UNUSED, + void *data) +{ + rtx *insn_ptr; + + insn_ptr = (rtx *) data; + if (*insn_ptr && for_each_rtx (&x, r10k_needs_protection_p_1, *insn_ptr)) + *insn_ptr = NULL_RTX; +} + +/* A for_each_rtx callback that iterates over the pattern of a CALL_INSN. + Return nonzero if the call is not to a declared function. */ + +static int +r10k_needs_protection_p_call (rtx *loc, void *data ATTRIBUTE_UNUSED) +{ + rtx x; + + x = *loc; + if (!MEM_P (x)) + return 0; + + x = XEXP (x, 0); + if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_DECL (x)) + return -1; + + return 1; +} + +/* Return true if instruction INSN needs to be protected by an R10K + cache barrier. */ + +static bool +r10k_needs_protection_p (rtx insn) +{ + if (CALL_P (insn)) + return for_each_rtx (&PATTERN (insn), r10k_needs_protection_p_call, NULL); + + if (mips_r10k_cache_barrier == R10K_CACHE_BARRIER_STORE) + { + note_stores (PATTERN (insn), r10k_needs_protection_p_store, &insn); + return insn == NULL_RTX; + } + + return for_each_rtx (&PATTERN (insn), r10k_needs_protection_p_1, insn); +} + +/* Return true if BB is only reached by blocks in PROTECTED_BBS and if every + edge is unconditional. */ + +static bool +r10k_protected_bb_p (basic_block bb, sbitmap protected_bbs) +{ + edge_iterator ei; + edge e; + + FOR_EACH_EDGE (e, ei, bb->preds) + if (!single_succ_p (e->src) + || !TEST_BIT (protected_bbs, e->src->index) + || (e->flags & EDGE_COMPLEX) != 0) + return false; + return true; +} + +/* Implement -mr10k-cache-barrier= for the current function. */ + +static void +r10k_insert_cache_barriers (void) +{ + int *rev_post_order; + unsigned int i, n; + basic_block bb; + sbitmap protected_bbs; + rtx insn, end, unprotected_region; + + if (TARGET_MIPS16) + { + sorry ("%qs does not support MIPS16 code", "-mr10k-cache-barrier"); + return; + } + + /* Restore the BLOCK_FOR_INSN pointers, which are needed by DF. */ + compute_bb_for_insn (); + + /* Create def-use chains. */ + df_set_flags (DF_EQ_NOTES); + df_chain_add_problem (DF_UD_CHAIN); + df_analyze (); + + /* Calculate dominators. */ + calculate_dominance_info (CDI_DOMINATORS); + + /* Bit X of PROTECTED_BBS is set if the last operation in basic block + X is protected by a cache barrier. */ + protected_bbs = sbitmap_alloc (last_basic_block); + sbitmap_zero (protected_bbs); + + /* Iterate over the basic blocks in reverse post-order. */ + rev_post_order = XNEWVEC (int, last_basic_block); + n = pre_and_rev_post_order_compute (NULL, rev_post_order, false); + for (i = 0; i < n; i++) + { + bb = BASIC_BLOCK (rev_post_order[i]); + + /* If this block is only reached by unconditional edges, and if the + source of every edge is protected, the beginning of the block is + also protected. */ + if (r10k_protected_bb_p (bb, protected_bbs)) + unprotected_region = NULL_RTX; + else + unprotected_region = pc_rtx; + end = NEXT_INSN (BB_END (bb)); + + /* UNPROTECTED_REGION is: + + - null if we are processing a protected region, + - pc_rtx if we are processing an unprotected region but have + not yet found the first instruction in it + - the first instruction in an unprotected region otherwise. */ + for (insn = BB_HEAD (bb); insn != end; insn = NEXT_INSN (insn)) + { + if (unprotected_region && INSN_P (insn)) + { + if (recog_memoized (insn) == CODE_FOR_mips_cache) + /* This CACHE instruction protects the following code. */ + unprotected_region = NULL_RTX; + else + { + /* See if INSN is the first instruction in this + unprotected region. */ + if (unprotected_region == pc_rtx) + unprotected_region = insn; + + /* See if INSN needs to be protected. If so, + we must insert a cache barrier somewhere between + PREV_INSN (UNPROTECTED_REGION) and INSN. It isn't + clear which position is better performance-wise, + but as a tie-breaker, we assume that it is better + to allow delay slots to be back-filled where + possible, and that it is better not to insert + barriers in the middle of already-scheduled code. + We therefore insert the barrier at the beginning + of the region. */ + if (r10k_needs_protection_p (insn)) + { + emit_insn_before (gen_r10k_cache_barrier (), + unprotected_region); + unprotected_region = NULL_RTX; + } + } + } + + if (CALL_P (insn)) + /* The called function is not required to protect the exit path. + The code that follows a call is therefore unprotected. */ + unprotected_region = pc_rtx; + } + + /* Record whether the end of this block is protected. */ + if (unprotected_region == NULL_RTX) + SET_BIT (protected_bbs, bb->index); + } + XDELETEVEC (rev_post_order); + + sbitmap_free (protected_bbs); + + free_dominance_info (CDI_DOMINATORS); + + df_finish_pass (false); + + free_bb_for_insn (); +} + /* A temporary variable used by for_each_rtx callbacks, etc. */ static rtx mips_sim_insn; @@ -12635,6 +13083,13 @@ mips_reorg_process_insns (void) orphaned high-part relocation. */ if (mips_orphaned_high_part_p (htab, insn)) delete_insn (insn); + /* Also delete cache barriers if the last instruction + was an annulled branch. INSN will not be speculatively + executed. */ + else if (recog_memoized (insn) == CODE_FOR_r10k_cache_barrier + && last_insn + && INSN_ANNULLED_BRANCH_P (SEQ_BEGIN (last_insn))) + delete_insn (insn); else { mips_avoid_hazard (last_insn, insn, &hilo_delay, @@ -12654,6 +13109,8 @@ static void mips_reorg (void) { mips16_lay_out_constants (); + if (mips_r10k_cache_barrier != R10K_CACHE_BARRIER_NONE) + r10k_insert_cache_barriers (); if (mips_base_delayed_branch) dbr_schedule (get_insns ()); mips_reorg_process_insns (); @@ -13083,6 +13540,17 @@ mips_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) return false; return true; + case OPT_mr10k_cache_barrier_: + if (strcmp (arg, "load-store") == 0) + mips_r10k_cache_barrier = R10K_CACHE_BARRIER_LOAD_STORE; + else if (strcmp (arg, "store") == 0) + mips_r10k_cache_barrier = R10K_CACHE_BARRIER_STORE; + else if (strcmp (arg, "none") == 0) + mips_r10k_cache_barrier = R10K_CACHE_BARRIER_NONE; + else + return false; + return true; + default: return true; } @@ -13318,6 +13786,14 @@ mips_override_options (void) warning (0, "the %qs architecture does not support paired-single" " instructions", mips_arch_info->name); + if (mips_r10k_cache_barrier != R10K_CACHE_BARRIER_NONE + && !TARGET_CACHE_BUILTIN) + { + error ("%qs requires a target that provides the %qs instruction", + "-mr10k-cache-barrier", "cache"); + mips_r10k_cache_barrier = R10K_CACHE_BARRIER_NONE; + } + /* If TARGET_DSPR2, enable MASK_DSP. */ if (TARGET_DSPR2) target_flags |= MASK_DSP; diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 86b886a373f..effa34ba261 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -563,6 +563,9 @@ enum mips_code_readable_setting { \ if (mips_abi == ABI_EABI) \ builtin_define ("__mips_eabi"); \ + \ + if (TARGET_CACHE_BUILTIN) \ + builtin_define ("__GCC_HAVE_BUILTIN_MIPS_CACHE"); \ } \ while (0) @@ -1009,8 +1012,23 @@ enum mips_code_readable_setting { /* ISA includes the bbit* instructions. */ #define ISA_HAS_BBIT TARGET_OCTEON +/* ISA includes the cins instruction. */ +#define ISA_HAS_CINS TARGET_OCTEON + +/* ISA includes the exts instruction. */ +#define ISA_HAS_EXTS TARGET_OCTEON + +/* ISA includes the seq and sne instructions. */ +#define ISA_HAS_SEQ_SNE TARGET_OCTEON + /* ISA includes the pop instruction. */ #define ISA_HAS_POP TARGET_OCTEON + +/* The CACHE instruction is available in non-MIPS16 code. */ +#define TARGET_CACHE_BUILTIN (mips_isa >= 3) + +/* The CACHE instruction is available. */ +#define ISA_HAS_CACHE (TARGET_CACHE_BUILTIN && !TARGET_MIPS16) /* Add -G xx support. */ @@ -1782,6 +1800,7 @@ enum reg_class ST_REGS, /* status registers (fp status) */ DSP_ACC_REGS, /* DSP accumulator registers */ ACC_REGS, /* Hi/Lo and DSP accumulator registers */ + FRAME_REGS, /* $arg and $frame */ ALL_REGS, /* all registers */ LIM_REG_CLASSES /* max value + 1 */ }; @@ -1823,6 +1842,7 @@ enum reg_class "ST_REGS", \ "DSP_ACC_REGS", \ "ACC_REGS", \ + "FRAME_REGS", \ "ALL_REGS" \ } @@ -1865,7 +1885,8 @@ enum reg_class { 0x00000000, 0x00000000, 0x000007f8, 0x00000000, 0x00000000, 0x00000000 }, /* status registers */ \ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x003f0000 }, /* dsp accumulator registers */ \ { 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x003f0000 }, /* hi/lo and dsp accumulator registers */ \ - { 0xffffffff, 0xffffffff, 0xffff07ff, 0xffffffff, 0xffffffff, 0x0fffffff } /* all registers */ \ + { 0x00000000, 0x00000000, 0x00006000, 0x00000000, 0x00000000, 0x00000000 }, /* frame registers */ \ + { 0xffffffff, 0xffffffff, 0xffff67ff, 0xffffffff, 0xffffffff, 0x0fffffff } /* all registers */ \ } diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index 0aba384144d..593fae30ba6 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -247,6 +247,9 @@ (UNSPEC_LOONGSON_ALU2_TURN_ENABLED_INSN 531) (UNSPEC_LOONGSON_FALU1_TURN_ENABLED_INSN 532) (UNSPEC_LOONGSON_FALU2_TURN_ENABLED_INSN 533) + + (UNSPEC_MIPS_CACHE 600) + (UNSPEC_R10K_CACHE_BARRIER 601) ] ) @@ -772,6 +775,10 @@ ;; to use the same template. (define_code_iterator any_extend [sign_extend zero_extend]) +;; This code iterator allows the two right shift instructions to be +;; generated from the same template. +(define_code_iterator any_shiftrt [ashiftrt lshiftrt]) + ;; This code iterator allows the three shift instructions to be generated ;; from the same template. (define_code_iterator any_shift [ashift ashiftrt lshiftrt]) @@ -2683,17 +2690,17 @@ ;; Combiner patterns to optimize shift/truncate combinations. -(define_insn "" +(define_insn "*ashr_trunc<mode>" [(set (match_operand:SUBDI 0 "register_operand" "=d") (truncate:SUBDI (ashiftrt:DI (match_operand:DI 1 "register_operand" "d") (match_operand:DI 2 "const_arith_operand" ""))))] - "TARGET_64BIT && !TARGET_MIPS16 && INTVAL (operands[2]) >= 32" + "TARGET_64BIT && !TARGET_MIPS16 && IN_RANGE (INTVAL (operands[2]), 32, 63)" "dsra\t%0,%1,%2" [(set_attr "type" "shift") - (set_attr "mode" "SI")]) + (set_attr "mode" "<MODE>")]) -(define_insn "" +(define_insn "*lshr32_trunc<mode>" [(set (match_operand:SUBDI 0 "register_operand" "=d") (truncate:SUBDI (lshiftrt:DI (match_operand:DI 1 "register_operand" "d") @@ -2701,8 +2708,19 @@ "TARGET_64BIT && !TARGET_MIPS16" "dsra\t%0,%1,32" [(set_attr "type" "shift") - (set_attr "mode" "SI")]) + (set_attr "mode" "<MODE>")]) +;; Logical shift by 32 or more results in proper SI values so +;; truncation is removed by the middle end. +(define_insn "*<optab>_trunc<mode>_exts" + [(set (match_operand:SUBDI 0 "register_operand" "=d") + (truncate:SUBDI + (any_shiftrt:DI (match_operand:DI 1 "register_operand" "d") + (match_operand:DI 2 "const_arith_operand" ""))))] + "ISA_HAS_EXTS && TARGET_64BIT && UINTVAL (operands[2]) < 32" + "exts\t%0,%1,%2,31" + [(set_attr "type" "arith") + (set_attr "mode" "<MODE>")]) ;; Combiner patterns for truncate/sign_extend combinations. The SI versions ;; use the shift/truncate patterns above. @@ -3353,24 +3371,46 @@ (define_expand "extv" [(set (match_operand 0 "register_operand") - (sign_extract (match_operand:QI 1 "memory_operand") - (match_operand 2 "immediate_operand") - (match_operand 3 "immediate_operand")))] + (sign_extract (match_operand 1 "nonimmediate_operand") + (match_operand 2 "const_int_operand") + (match_operand 3 "const_int_operand")))] "!TARGET_MIPS16" { if (mips_expand_ext_as_unaligned_load (operands[0], operands[1], INTVAL (operands[2]), INTVAL (operands[3]))) DONE; + else if (register_operand (operands[1], GET_MODE (operands[0])) + && ISA_HAS_EXTS && UINTVAL (operands[2]) <= 32) + { + if (GET_MODE (operands[0]) == DImode) + emit_insn (gen_extvdi (operands[0], operands[1], operands[2], + operands[3])); + else + emit_insn (gen_extvsi (operands[0], operands[1], operands[2], + operands[3])); + DONE; + } else FAIL; }) +(define_insn "extv<mode>" + [(set (match_operand:GPR 0 "register_operand" "=d") + (sign_extract:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand 2 "const_int_operand" "") + (match_operand 3 "const_int_operand" "")))] + "ISA_HAS_EXTS && UINTVAL (operands[2]) <= 32" + "exts\t%0,%1,%3,%m2" + [(set_attr "type" "arith") + (set_attr "mode" "<MODE>")]) + + (define_expand "extzv" [(set (match_operand 0 "register_operand") (zero_extract (match_operand 1 "nonimmediate_operand") - (match_operand 2 "immediate_operand") - (match_operand 3 "immediate_operand")))] + (match_operand 2 "const_int_operand") + (match_operand 3 "const_int_operand")))] "!TARGET_MIPS16" { if (mips_expand_ext_as_unaligned_load (operands[0], operands[1], @@ -3395,14 +3435,25 @@ (define_insn "extzv<mode>" [(set (match_operand:GPR 0 "register_operand" "=d") (zero_extract:GPR (match_operand:GPR 1 "register_operand" "d") - (match_operand:SI 2 "immediate_operand" "I") - (match_operand:SI 3 "immediate_operand" "I")))] + (match_operand 2 "const_int_operand" "") + (match_operand 3 "const_int_operand" "")))] "mips_use_ins_ext_p (operands[1], INTVAL (operands[2]), INTVAL (operands[3]))" "<d>ext\t%0,%1,%3,%2" [(set_attr "type" "arith") (set_attr "mode" "<MODE>")]) +(define_insn "*extzv_trunc<mode>_exts" + [(set (match_operand:GPR 0 "register_operand" "=d") + (truncate:GPR + (zero_extract:DI (match_operand:DI 1 "register_operand" "d") + (match_operand 2 "const_int_operand" "") + (match_operand 3 "const_int_operand" ""))))] + "ISA_HAS_EXTS && TARGET_64BIT && IN_RANGE (INTVAL (operands[2]), 32, 63)" + "exts\t%0,%1,%3,31" + [(set_attr "type" "arith") + (set_attr "mode" "<MODE>")]) + (define_expand "insv" [(set (zero_extract (match_operand 0 "nonimmediate_operand") @@ -3441,6 +3492,28 @@ [(set_attr "type" "arith") (set_attr "mode" "<MODE>")]) +;; Combiner pattern for cins (clear and insert bit field). We can +;; implement mask-and-shift-left operation with this. Note that if +;; the upper bit of the mask is set in an SImode operation, the mask +;; itself will be sign-extended. mask_low_and_shift_len will +;; therefore be greater than our threshold of 32. + +(define_insn "*cins<mode>" + [(set (match_operand:GPR 0 "register_operand" "=d") + (and:GPR + (ashift:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:GPR 2 "const_int_operand" "")) + (match_operand:GPR 3 "const_int_operand" "")))] + "ISA_HAS_CINS + && mask_low_and_shift_p (<MODE>mode, operands[3], operands[2], 32)" +{ + operands[3] = + GEN_INT (mask_low_and_shift_len (<MODE>mode, operands[3], operands[2])); + return "cins\t%0,%1,%2,%m3"; +} + [(set_attr "type" "shift") + (set_attr "mode" "<MODE>")]) + ;; Unaligned word moves generated by the bit field patterns. ;; ;; As far as the rtl is concerned, both the left-part and right-part @@ -4652,6 +4725,25 @@ } [(set_attr "length" "20")]) +;; Cache operations for R4000-style caches. +(define_insn "mips_cache" + [(set (mem:BLK (scratch)) + (unspec:BLK [(match_operand:SI 0 "const_int_operand") + (match_operand:QI 1 "address_operand" "p")] + UNSPEC_MIPS_CACHE))] + "ISA_HAS_CACHE" + "cache\t%X0,%a1") + +;; Similar, but with the operands hard-coded to an R10K cache barrier +;; operation. We keep the pattern distinct so that we can identify +;; cache operations inserted by -mr10k-cache-barrier=, and so that +;; the operation is never inserted into a delay slot. +(define_insn "r10k_cache_barrier" + [(set (mem:BLK (scratch)) + (unspec:BLK [(const_int 0)] UNSPEC_R10K_CACHE_BARRIER))] + "ISA_HAS_CACHE" + "cache\t0x14,0(%$)" + [(set_attr "can_delay" "no")]) ;; Block moves, see mips.c for more details. ;; Argument 0 is the destination @@ -5130,24 +5222,37 @@ "" { if (mips_expand_scc (EQ, operands[0])) DONE; else FAIL; }) -(define_insn "*seq_<GPR:mode><GPR2:mode>" +(define_insn "*seq_zero_<GPR:mode><GPR2:mode>" [(set (match_operand:GPR2 0 "register_operand" "=d") (eq:GPR2 (match_operand:GPR 1 "register_operand" "d") (const_int 0)))] - "!TARGET_MIPS16" + "!TARGET_MIPS16 && !ISA_HAS_SEQ_SNE" "sltu\t%0,%1,1" [(set_attr "type" "slt") (set_attr "mode" "<GPR:MODE>")]) -(define_insn "*seq_<GPR:mode><GPR2:mode>_mips16" +(define_insn "*seq_zero_<GPR:mode><GPR2:mode>_mips16" [(set (match_operand:GPR2 0 "register_operand" "=t") (eq:GPR2 (match_operand:GPR 1 "register_operand" "d") (const_int 0)))] - "TARGET_MIPS16" + "TARGET_MIPS16 && !ISA_HAS_SEQ_SNE" "sltu\t%1,1" [(set_attr "type" "slt") (set_attr "mode" "<GPR:MODE>")]) +;; Generate sltiu unless using seq results in better code. +(define_insn "*seq_<GPR:mode><GPR2:mode>_seq" + [(set (match_operand:GPR2 0 "register_operand" "=d,d,d") + (eq:GPR2 (match_operand:GPR 1 "register_operand" "%d,d,d") + (match_operand:GPR 2 "reg_imm10_operand" "d,J,YB")))] + "ISA_HAS_SEQ_SNE" + "@ + seq\t%0,%1,%2 + sltiu\t%0,%1,1 + seqi\t%0,%1,%2" + [(set_attr "type" "slt") + (set_attr "mode" "<GPR:MODE>")]) + ;; "sne" uses sltu instructions in which the first operand is $0. ;; This isn't possible in mips16 code. @@ -5158,15 +5263,28 @@ "!TARGET_MIPS16" { if (mips_expand_scc (NE, operands[0])) DONE; else FAIL; }) -(define_insn "*sne_<GPR:mode><GPR2:mode>" +(define_insn "*sne_zero_<GPR:mode><GPR2:mode>" [(set (match_operand:GPR2 0 "register_operand" "=d") (ne:GPR2 (match_operand:GPR 1 "register_operand" "d") (const_int 0)))] - "!TARGET_MIPS16" + "!TARGET_MIPS16 && !ISA_HAS_SEQ_SNE" "sltu\t%0,%.,%1" [(set_attr "type" "slt") (set_attr "mode" "<GPR:MODE>")]) +;; Generate sltu unless using sne results in better code. +(define_insn "*sne_<GPR:mode><GPR2:mode>_sne" + [(set (match_operand:GPR2 0 "register_operand" "=d,d,d") + (ne:GPR2 (match_operand:GPR 1 "register_operand" "%d,d,d") + (match_operand:GPR 2 "reg_imm10_operand" "d,J,YB")))] + "ISA_HAS_SEQ_SNE" + "@ + sne\t%0,%1,%2 + sltu\t%0,%.,%1 + snei\t%0,%1,%2" + [(set_attr "type" "slt") + (set_attr "mode" "<GPR:MODE>")]) + (define_expand "sgt<u>" [(set (match_operand:SI 0 "register_operand") (any_gt:SI (match_dup 1) diff --git a/gcc/config/mips/mips.opt b/gcc/config/mips/mips.opt index 4e69e29a7e5..56c99ac16f8 100644 --- a/gcc/config/mips/mips.opt +++ b/gcc/config/mips/mips.opt @@ -236,6 +236,10 @@ mpaired-single Target Report Mask(PAIRED_SINGLE_FLOAT) Use paired-single floating-point instructions +mr10k-cache-barrier= +Target Joined RejectNegative +-mr10k-cache-barrier=SETTING Specify when r10k cache barriers should be inserted + mshared Target Report Var(TARGET_SHARED) Init(1) When generating -mabicalls code, make the code suitable for use in shared libraries diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 934ea8f6435..cdeb1c9c500 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -2179,11 +2179,8 @@ optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED) /* Enable section anchors by default. Skip section anchors for Objective C and Objective C++ - until front-ends fixed. - Do not enable section anchors without toplevel reorder. */ - if (!TARGET_MACHO - && lang_hooks.name[4] != 'O' - && flag_toplevel_reorder != 0) + until front-ends fixed. */ + if (!TARGET_MACHO && lang_hooks.name[4] != 'O') flag_section_anchors = 2; } diff --git a/gcc/config/rs6000/t-rs6000 b/gcc/config/rs6000/t-rs6000 index caa07153ad3..30f021e8017 100644 --- a/gcc/config/rs6000/t-rs6000 +++ b/gcc/config/rs6000/t-rs6000 @@ -1,7 +1,5 @@ # General rules that all rs6000/ targets must have. -gt-rs6000.h: s-gtype ; @true - rs6000.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(REGS_H) hard-reg-set.h \ real.h insn-config.h conditions.h insn-attr.h flags.h $(RECOG_H) \ diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c index 0b74a9c18e4..35a04a7a820 100644 --- a/gcc/config/spu/spu.c +++ b/gcc/config/spu/spu.c @@ -54,6 +54,9 @@ #include "tm-constrs.h" #include "spu-builtins.h" #include "ddg.h" +#include "sbitmap.h" +#include "timevar.h" +#include "df.h" /* Builtin types, data and prototypes. */ struct spu_builtin_range @@ -94,19 +97,19 @@ static rtx frame_emit_add_imm (rtx dst, rtx src, HOST_WIDE_INT imm, static void emit_nop_for_insn (rtx insn); static bool insn_clobbers_hbr (rtx insn); static void spu_emit_branch_hint (rtx before, rtx branch, rtx target, - int distance); + int distance, sbitmap blocks); static rtx spu_emit_vector_compare (enum rtx_code rcode, rtx op0, rtx op1, enum machine_mode dmode); static rtx get_branch_target (rtx branch); -static void insert_branch_hints (void); -static void insert_nops (void); static void spu_machine_dependent_reorg (void); static int spu_sched_issue_rate (void); static int spu_sched_variable_issue (FILE * dump, int verbose, rtx insn, int can_issue_more); static int get_pipe (rtx insn); -static int spu_sched_adjust_priority (rtx insn, int pri); static int spu_sched_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost); +static void spu_sched_init_global (FILE *, int, int); +static void spu_sched_init (FILE *, int, int); +static int spu_sched_reorder (FILE *, int, rtx *, int *, int); static tree spu_handle_fndecl_attribute (tree * node, tree name, tree args, int flags, unsigned char *no_add_attrs); @@ -139,6 +142,7 @@ static int spu_builtin_vectorization_cost (bool); static bool spu_vector_alignment_reachable (const_tree, bool); static tree spu_builtin_vec_perm (tree, tree *); static int spu_sms_res_mii (struct ddg *g); +static void asm_file_start (void); extern const char *reg_names[]; rtx spu_compare_op0, spu_compare_op1; @@ -148,6 +152,18 @@ int spu_arch; /* Which cpu are we tuning for. */ int spu_tune; +/* The hardware requires 8 insns between a hint and the branch it + effects. This variable describes how many rtl instructions the + compiler needs to see before inserting a hint, and then the compiler + will insert enough nops to make it at least 8 insns. The default is + for the compiler to allow up to 2 nops be emitted. The nops are + inserted in pairs, so we round down. */ +int spu_hint_dist = (8*4) - (2*4); + +/* Determines whether we run variable tracking in machine dependent + reorganization. */ +static int spu_flag_var_tracking; + enum spu_immediate { SPU_NONE, SPU_IL, @@ -213,11 +229,20 @@ tree spu_builtin_types[SPU_BTI_MAX]; #undef TARGET_SCHED_ISSUE_RATE #define TARGET_SCHED_ISSUE_RATE spu_sched_issue_rate +#undef TARGET_SCHED_INIT_GLOBAL +#define TARGET_SCHED_INIT_GLOBAL spu_sched_init_global + +#undef TARGET_SCHED_INIT +#define TARGET_SCHED_INIT spu_sched_init + #undef TARGET_SCHED_VARIABLE_ISSUE #define TARGET_SCHED_VARIABLE_ISSUE spu_sched_variable_issue -#undef TARGET_SCHED_ADJUST_PRIORITY -#define TARGET_SCHED_ADJUST_PRIORITY spu_sched_adjust_priority +#undef TARGET_SCHED_REORDER +#define TARGET_SCHED_REORDER spu_sched_reorder + +#undef TARGET_SCHED_REORDER2 +#define TARGET_SCHED_REORDER2 spu_sched_reorder #undef TARGET_SCHED_ADJUST_COST #define TARGET_SCHED_ADJUST_COST spu_sched_adjust_cost @@ -301,6 +326,9 @@ const struct attribute_spec spu_attribute_table[]; #undef TARGET_SCHED_SMS_RES_MII #define TARGET_SCHED_SMS_RES_MII spu_sms_res_mii +#undef TARGET_ASM_FILE_START +#define TARGET_ASM_FILE_START asm_file_start + struct gcc_target targetm = TARGET_INITIALIZER; void @@ -329,9 +357,14 @@ spu_override_options (void) flag_omit_frame_pointer = 1; + /* Functions must be 8 byte aligned so we correctly handle dual issue */ if (align_functions < 8) align_functions = 8; + spu_hint_dist = 8*4 - spu_max_nops*4; + if (spu_hint_dist < 0) + spu_hint_dist = 0; + if (spu_fixed_range_string) fix_range (spu_fixed_range_string); @@ -1983,16 +2016,6 @@ spu_const (enum machine_mode mode, HOST_WIDE_INT val) return gen_rtx_CONST_VECTOR (mode, v); } - -/* branch hint stuff */ - -/* The hardware requires 8 insns between a hint and the branch it - effects. This variable describes how many rtl instructions the - compiler needs to see before inserting a hint. (FIXME: We should - accept less and insert nops to enforce it because hinting is always - profitable for performance, but we do need to be careful of code - size.) */ -int spu_hint_dist = (8 * 4); /* Create a MODE vector constant from 4 ints. */ rtx @@ -2017,75 +2040,200 @@ spu_const_from_ints(enum machine_mode mode, int a, int b, int c, int d) arr[15] = (d >> 0) & 0xff; return array_to_constant(mode, arr); } + +/* branch hint stuff */ /* An array of these is used to propagate hints to predecessor blocks. */ struct spu_bb_info { - rtx prop_jump; /* propagated from another block */ - basic_block bb; /* the original block. */ + rtx prop_jump; /* propagated from another block */ + int bb_index; /* the original block. */ }; +static struct spu_bb_info *spu_bb_info; -/* The special $hbr register is used to prevent the insn scheduler from - moving hbr insns across instructions which invalidate them. It - should only be used in a clobber, and this function searches for - insns which clobber it. */ -static bool -insn_clobbers_hbr (rtx insn) +#define STOP_HINT_P(INSN) \ + (GET_CODE(INSN) == CALL_INSN \ + || INSN_CODE(INSN) == CODE_FOR_divmodsi4 \ + || INSN_CODE(INSN) == CODE_FOR_udivmodsi4) + +/* 1 when RTX is a hinted branch or its target. We keep track of + what has been hinted so the safe-hint code can test it easily. */ +#define HINTED_P(RTX) \ + (RTL_FLAG_CHECK3("HINTED_P", (RTX), CODE_LABEL, JUMP_INSN, CALL_INSN)->unchanging) + +/* 1 when RTX is an insn that must be scheduled on an even boundary. */ +#define SCHED_ON_EVEN_P(RTX) \ + (RTL_FLAG_CHECK2("SCHED_ON_EVEN_P", (RTX), JUMP_INSN, CALL_INSN)->in_struct) + +/* Emit a nop for INSN such that the two will dual issue. This assumes + INSN is 8-byte aligned. When INSN is inline asm we emit an lnop. + We check for TImode to handle a MULTI1 insn which has dual issued its + first instruction. get_pipe returns -1 for MULTI0, inline asm, or + ADDR_VEC insns. */ +static void +emit_nop_for_insn (rtx insn) { - if (INSN_P (insn) && GET_CODE (PATTERN (insn)) == PARALLEL) + int p; + rtx new_insn; + p = get_pipe (insn); + if ((CALL_P (insn) || JUMP_P (insn)) && SCHED_ON_EVEN_P (insn)) + new_insn = emit_insn_after (gen_lnop (), insn); + else if (p == 1 && GET_MODE (insn) == TImode) { - rtx parallel = PATTERN (insn); - rtx clobber; - int j; - for (j = XVECLEN (parallel, 0) - 1; j >= 0; j--) + new_insn = emit_insn_before (gen_nopn (GEN_INT (127)), insn); + PUT_MODE (new_insn, TImode); + PUT_MODE (insn, VOIDmode); + } + else + new_insn = emit_insn_after (gen_lnop (), insn); + recog_memoized (new_insn); +} + +/* Insert nops in basic blocks to meet dual issue alignment + requirements. Also make sure hbrp and hint instructions are at least + one cycle apart, possibly inserting a nop. */ +static void +pad_bb(void) +{ + rtx insn, next_insn, prev_insn, hbr_insn = 0; + int length; + int addr; + + /* This sets up INSN_ADDRESSES. */ + shorten_branches (get_insns ()); + + /* Keep track of length added by nops. */ + length = 0; + + prev_insn = 0; + insn = get_insns (); + if (!active_insn_p (insn)) + insn = next_active_insn (insn); + for (; insn; insn = next_insn) + { + next_insn = next_active_insn (insn); + if (INSN_CODE (insn) == CODE_FOR_iprefetch + || INSN_CODE (insn) == CODE_FOR_hbr) { - clobber = XVECEXP (parallel, 0, j); - if (GET_CODE (clobber) == CLOBBER - && GET_CODE (XEXP (clobber, 0)) == REG - && REGNO (XEXP (clobber, 0)) == HBR_REGNUM) - return 1; + if (hbr_insn) + { + int a0 = INSN_ADDRESSES (INSN_UID (hbr_insn)); + int a1 = INSN_ADDRESSES (INSN_UID (insn)); + if ((a1 - a0 == 8 && GET_MODE (insn) != TImode) + || (a1 - a0 == 4)) + { + prev_insn = emit_insn_before (gen_lnop (), insn); + PUT_MODE (prev_insn, GET_MODE (insn)); + PUT_MODE (insn, TImode); + length += 4; + } + } + hbr_insn = insn; + } + if (INSN_CODE (insn) == CODE_FOR_blockage) + { + if (GET_MODE (insn) == TImode) + PUT_MODE (next_insn, TImode); + insn = next_insn; + next_insn = next_active_insn (insn); + } + addr = INSN_ADDRESSES (INSN_UID (insn)); + if ((CALL_P (insn) || JUMP_P (insn)) && SCHED_ON_EVEN_P (insn)) + { + if (((addr + length) & 7) != 0) + { + emit_nop_for_insn (prev_insn); + length += 4; + } } + else if (GET_MODE (insn) == TImode + && ((next_insn && GET_MODE (next_insn) != TImode) + || get_attr_type (insn) == TYPE_MULTI0) + && ((addr + length) & 7) != 0) + { + /* prev_insn will always be set because the first insn is + always 8-byte aligned. */ + emit_nop_for_insn (prev_insn); + length += 4; + } + prev_insn = insn; } - return 0; } + +/* Routines for branch hints. */ + static void -spu_emit_branch_hint (rtx before, rtx branch, rtx target, int distance) +spu_emit_branch_hint (rtx before, rtx branch, rtx target, + int distance, sbitmap blocks) { - rtx branch_label; - rtx hint, insn, prev, next; + rtx branch_label = 0; + rtx hint; + rtx insn; + rtx table; if (before == 0 || branch == 0 || target == 0) return; + /* While scheduling we require hints to be no further than 600, so + we need to enforce that here too */ if (distance > 600) return; + /* If we have a Basic block note, emit it after the basic block note. */ + if (NOTE_KIND (before) == NOTE_INSN_BASIC_BLOCK) + before = NEXT_INSN (before); branch_label = gen_label_rtx (); LABEL_NUSES (branch_label)++; LABEL_PRESERVE_P (branch_label) = 1; insn = emit_label_before (branch_label, branch); branch_label = gen_rtx_LABEL_REF (VOIDmode, branch_label); + SET_BIT (blocks, BLOCK_FOR_INSN (branch)->index); + + hint = emit_insn_before (gen_hbr (branch_label, target), before); + recog_memoized (hint); + HINTED_P (branch) = 1; - /* If the previous insn is pipe0, make the hbr dual issue with it. If - the current insn is pipe0, dual issue with it. */ - prev = prev_active_insn (before); - if (prev && get_pipe (prev) == 0) - hint = emit_insn_before (gen_hbr (branch_label, target), before); - else if (get_pipe (before) == 0 && distance > spu_hint_dist) + if (GET_CODE (target) == LABEL_REF) + HINTED_P (XEXP (target, 0)) = 1; + else if (tablejump_p (branch, 0, &table)) { - next = next_active_insn (before); - hint = emit_insn_after (gen_hbr (branch_label, target), before); - if (next) - PUT_MODE (next, TImode); + rtvec vec; + int j; + if (GET_CODE (PATTERN (table)) == ADDR_VEC) + vec = XVEC (PATTERN (table), 0); + else + vec = XVEC (PATTERN (table), 1); + for (j = GET_NUM_ELEM (vec) - 1; j >= 0; --j) + HINTED_P (XEXP (RTVEC_ELT (vec, j), 0)) = 1; } - else + + if (distance >= 588) { - hint = emit_insn_before (gen_hbr (branch_label, target), before); - PUT_MODE (hint, TImode); + /* Make sure the hint isn't scheduled any earlier than this point, + which could make it too far for the branch offest to fit */ + recog_memoized (emit_insn_before (gen_blockage (), hint)); + } + else if (distance <= 8 * 4) + { + /* To guarantee at least 8 insns between the hint and branch we + insert nops. */ + int d; + for (d = distance; d < 8 * 4; d += 4) + { + insn = + emit_insn_after (gen_nopn_nv (gen_rtx_REG (SImode, 127)), hint); + recog_memoized (insn); + } + + /* Make sure any nops inserted aren't scheduled before the hint. */ + recog_memoized (emit_insn_after (gen_blockage (), hint)); + + /* Make sure any nops inserted aren't scheduled after the call. */ + if (CALL_P (branch) && distance < 8 * 4) + recog_memoized (emit_insn_before (gen_blockage (), branch)); } - recog_memoized (hint); } /* Returns 0 if we don't want a hint for this branch. Otherwise return @@ -2155,245 +2303,403 @@ get_branch_target (rtx branch) return 0; } +/* The special $hbr register is used to prevent the insn scheduler from + moving hbr insns across instructions which invalidate them. It + should only be used in a clobber, and this function searches for + insns which clobber it. */ +static bool +insn_clobbers_hbr (rtx insn) +{ + if (INSN_P (insn) + && GET_CODE (PATTERN (insn)) == PARALLEL) + { + rtx parallel = PATTERN (insn); + rtx clobber; + int j; + for (j = XVECLEN (parallel, 0) - 1; j >= 0; j--) + { + clobber = XVECEXP (parallel, 0, j); + if (GET_CODE (clobber) == CLOBBER + && GET_CODE (XEXP (clobber, 0)) == REG + && REGNO (XEXP (clobber, 0)) == HBR_REGNUM) + return 1; + } + } + return 0; +} + +/* Search up to 32 insns starting at FIRST: + - at any kind of hinted branch, just return + - at any unconditional branch in the first 15 insns, just return + - at a call or indirect branch, after the first 15 insns, force it to + an even address and return + - at any unconditional branch, after the first 15 insns, force it to + an even address. + At then end of the search, insert an hbrp within 4 insns of FIRST, + and an hbrp within 16 instructions of FIRST. + */ static void -insert_branch_hints (void) +insert_hbrp_for_ilb_runout (rtx first) { - struct spu_bb_info *spu_bb_info; - rtx branch, insn, next; - rtx branch_target = 0; - int branch_addr = 0, insn_addr, head_addr; - basic_block bb; - unsigned int j; + rtx insn, before_4 = 0, before_16 = 0; + int addr = 0, length, first_addr = -1; + int hbrp_addr0 = 128 * 4, hbrp_addr1 = 128 * 4; + int insert_lnop_after = 0; + for (insn = first; insn; insn = NEXT_INSN (insn)) + if (INSN_P (insn)) + { + if (first_addr == -1) + first_addr = INSN_ADDRESSES (INSN_UID (insn)); + addr = INSN_ADDRESSES (INSN_UID (insn)) - first_addr; + length = get_attr_length (insn); + + if (before_4 == 0 && addr + length >= 4 * 4) + before_4 = insn; + /* We test for 14 instructions because the first hbrp will add + up to 2 instructions. */ + if (before_16 == 0 && addr + length >= 14 * 4) + before_16 = insn; + + if (INSN_CODE (insn) == CODE_FOR_hbr) + { + /* Make sure an hbrp is at least 2 cycles away from a hint. + Insert an lnop after the hbrp when necessary. */ + if (before_4 == 0 && addr > 0) + { + before_4 = insn; + insert_lnop_after |= 1; + } + else if (before_4 && addr <= 4 * 4) + insert_lnop_after |= 1; + if (before_16 == 0 && addr > 10 * 4) + { + before_16 = insn; + insert_lnop_after |= 2; + } + else if (before_16 && addr <= 14 * 4) + insert_lnop_after |= 2; + } - spu_bb_info = - (struct spu_bb_info *) xcalloc (last_basic_block + 1, - sizeof (struct spu_bb_info)); + if (INSN_CODE (insn) == CODE_FOR_iprefetch) + { + if (addr < hbrp_addr0) + hbrp_addr0 = addr; + else if (addr < hbrp_addr1) + hbrp_addr1 = addr; + } - /* We need exact insn addresses and lengths. */ - shorten_branches (get_insns ()); + if (CALL_P (insn) || JUMP_P (insn)) + { + if (HINTED_P (insn)) + return; + + /* Any branch after the first 15 insns should be on an even + address to avoid a special case branch. There might be + some nops and/or hbrps inserted, so we test after 10 + insns. */ + if (addr > 10 * 4) + SCHED_ON_EVEN_P (insn) = 1; + } - FOR_EACH_BB_REVERSE (bb) - { - head_addr = INSN_ADDRESSES (INSN_UID (BB_HEAD (bb))); - branch = 0; - if (spu_bb_info[bb->index].prop_jump) - { - branch = spu_bb_info[bb->index].prop_jump; - branch_target = get_branch_target (branch); - branch_addr = INSN_ADDRESSES (INSN_UID (branch)); - } - /* Search from end of a block to beginning. In this loop, find - jumps which need a branch and emit them only when: - - it's an indirect branch and we're at the insn which sets - the register - - we're at an insn that will invalidate the hint. e.g., a - call, another hint insn, inline asm that clobbers $hbr, and - some inlined operations (divmodsi4). Don't consider jumps - because they are only at the end of a block and are - considered when we are deciding whether to propagate - - we're getting too far away from the branch. The hbr insns - only have a signed 10-bit offset - We go back as far as possible so the branch will be considered - for propagation when we get to the beginning of the block. */ - next = 0; - for (insn = BB_END (bb); insn; insn = PREV_INSN (insn)) - { - if (INSN_P (insn)) + if (CALL_P (insn) || tablejump_p (insn, 0, 0)) + return; + + + if (addr + length >= 32 * 4) { - insn_addr = INSN_ADDRESSES (INSN_UID (insn)); - if (branch && next - && ((GET_CODE (branch_target) == REG - && set_of (branch_target, insn) != NULL_RTX) - || insn_clobbers_hbr (insn) - || branch_addr - insn_addr > 600)) + gcc_assert (before_4 && before_16); + if (hbrp_addr0 > 4 * 4) { - int next_addr = INSN_ADDRESSES (INSN_UID (next)); - if (insn != BB_END (bb) - && branch_addr - next_addr >= spu_hint_dist) + insn = + emit_insn_before (gen_iprefetch (GEN_INT (1)), before_4); + recog_memoized (insn); + INSN_ADDRESSES_NEW (insn, + INSN_ADDRESSES (INSN_UID (before_4))); + PUT_MODE (insn, GET_MODE (before_4)); + PUT_MODE (before_4, TImode); + if (insert_lnop_after & 1) { - if (dump_file) - fprintf (dump_file, - "hint for %i in block %i before %i\n", - INSN_UID (branch), bb->index, INSN_UID (next)); - spu_emit_branch_hint (next, branch, branch_target, - branch_addr - next_addr); + insn = emit_insn_before (gen_lnop (), before_4); + recog_memoized (insn); + INSN_ADDRESSES_NEW (insn, + INSN_ADDRESSES (INSN_UID (before_4))); + PUT_MODE (insn, TImode); } - branch = 0; } - - /* JUMP_P will only be true at the end of a block. When - branch is already set it means we've previously decided - to propagate a hint for that branch into this block. */ - if (CALL_P (insn) || (JUMP_P (insn) && !branch)) + if ((hbrp_addr0 <= 4 * 4 || hbrp_addr0 > 16 * 4) + && hbrp_addr1 > 16 * 4) { - branch = 0; - if ((branch_target = get_branch_target (insn))) + insn = + emit_insn_before (gen_iprefetch (GEN_INT (2)), before_16); + recog_memoized (insn); + INSN_ADDRESSES_NEW (insn, + INSN_ADDRESSES (INSN_UID (before_16))); + PUT_MODE (insn, GET_MODE (before_16)); + PUT_MODE (before_16, TImode); + if (insert_lnop_after & 2) { - branch = insn; - branch_addr = insn_addr; + insn = emit_insn_before (gen_lnop (), before_16); + recog_memoized (insn); + INSN_ADDRESSES_NEW (insn, + INSN_ADDRESSES (INSN_UID + (before_16))); + PUT_MODE (insn, TImode); } } - - /* When a branch hint is emitted it will be inserted - before "next". Make sure next is the beginning of a - cycle to minimize impact on the scheduled insns. */ - if (GET_MODE (insn) == TImode) - next = insn; + return; } - if (insn == BB_HEAD (bb)) - break; } + else if (BARRIER_P (insn)) + return; - if (branch) - { - /* If we haven't emitted a hint for this branch yet, it might - be profitable to emit it in one of the predecessor blocks, - especially for loops. */ - rtx bbend; - basic_block prev = 0, prop = 0, prev2 = 0; - int loop_exit = 0, simple_loop = 0; - int next_addr = 0; - if (next) - next_addr = INSN_ADDRESSES (INSN_UID (next)); - - for (j = 0; j < EDGE_COUNT (bb->preds); j++) - if (EDGE_PRED (bb, j)->flags & EDGE_FALLTHRU) - prev = EDGE_PRED (bb, j)->src; - else - prev2 = EDGE_PRED (bb, j)->src; - - for (j = 0; j < EDGE_COUNT (bb->succs); j++) - if (EDGE_SUCC (bb, j)->flags & EDGE_LOOP_EXIT) - loop_exit = 1; - else if (EDGE_SUCC (bb, j)->dest == bb) - simple_loop = 1; - - /* If this branch is a loop exit then propagate to previous - fallthru block. This catches the cases when it is a simple - loop or when there is an initial branch into the loop. */ - if (prev && loop_exit && prev->loop_depth <= bb->loop_depth) - prop = prev; - - /* If there is only one adjacent predecessor. Don't propagate - outside this loop. This loop_depth test isn't perfect, but - I'm not sure the loop_father member is valid at this point. */ - else if (prev && single_pred_p (bb) - && prev->loop_depth == bb->loop_depth) - prop = prev; - - /* If this is the JOIN block of a simple IF-THEN then - propagate the hint to the HEADER block. */ - else if (prev && prev2 - && EDGE_COUNT (bb->preds) == 2 - && EDGE_COUNT (prev->preds) == 1 - && EDGE_PRED (prev, 0)->src == prev2 - && prev2->loop_depth == bb->loop_depth - && GET_CODE (branch_target) != REG) - prop = prev; - - /* Don't propagate when: - - this is a simple loop and the hint would be too far - - this is not a simple loop and there are 16 insns in - this block already - - the predecessor block ends in a branch that will be - hinted - - the predecessor block ends in an insn that invalidates - the hint */ - if (prop - && prop->index >= 0 - && (bbend = BB_END (prop)) - && branch_addr - INSN_ADDRESSES (INSN_UID (bbend)) < - (simple_loop ? 600 : 16 * 4) && get_branch_target (bbend) == 0 - && (JUMP_P (bbend) || !insn_clobbers_hbr (bbend))) - { - if (dump_file) - fprintf (dump_file, "propagate from %i to %i (loop depth %i) " - "for %i (loop_exit %i simple_loop %i dist %i)\n", - bb->index, prop->index, bb->loop_depth, - INSN_UID (branch), loop_exit, simple_loop, - branch_addr - INSN_ADDRESSES (INSN_UID (bbend))); - - spu_bb_info[prop->index].prop_jump = branch; - spu_bb_info[prop->index].bb = bb; - } - else if (next && branch_addr - next_addr >= spu_hint_dist) - { - if (dump_file) - fprintf (dump_file, "hint for %i in block %i before %i\n", - INSN_UID (branch), bb->index, INSN_UID (next)); - spu_emit_branch_hint (next, branch, branch_target, - branch_addr - next_addr); - } - branch = 0; - } - } - free (spu_bb_info); } - -/* Emit a nop for INSN such that the two will dual issue. This assumes - INSN is 8-byte aligned. When INSN is inline asm we emit an lnop. - We check for TImode to handle a MULTI1 insn which has dual issued its - first instruction. get_pipe returns -1 for MULTI0, inline asm, or - ADDR_VEC insns. */ + +/* The SPU might hang when it executes 48 inline instructions after a + hinted branch jumps to its hinted target. The beginning of a + function and the return from a call might have been hinted, and must + be handled as well. To prevent a hang we insert 2 hbrps. The first + should be within 6 insns of the branch target. The second should be + within 22 insns of the branch target. When determining if hbrps are + necessary, we look for only 32 inline instructions, because up to to + 12 nops and 4 hbrps could be inserted. Similarily, when inserting + new hbrps, we insert them within 4 and 16 insns of the target. */ static void -emit_nop_for_insn (rtx insn) +insert_hbrp (void) { - int p; - rtx new_insn; - p = get_pipe (insn); - if (p == 1 && GET_MODE (insn) == TImode) + rtx insn; + if (TARGET_SAFE_HINTS) { - new_insn = emit_insn_before (gen_nopn (GEN_INT (127)), insn); - PUT_MODE (new_insn, TImode); - PUT_MODE (insn, VOIDmode); + shorten_branches (get_insns ()); + /* Insert hbrp at beginning of function */ + insn = next_active_insn (get_insns ()); + if (insn) + insert_hbrp_for_ilb_runout (insn); + /* Insert hbrp after hinted targets. */ + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + if ((LABEL_P (insn) && HINTED_P (insn)) || CALL_P (insn)) + insert_hbrp_for_ilb_runout (next_active_insn (insn)); } - else - new_insn = emit_insn_after (gen_lnop (), insn); } -/* Insert nops in basic blocks to meet dual issue alignment - requirements. */ +static int in_spu_reorg; + +/* Insert branch hints. There are no branch optimizations after this + pass, so it's safe to set our branch hints now. */ static void -insert_nops (void) +spu_machine_dependent_reorg (void) { - rtx insn, next_insn, prev_insn; - int length; - int addr; + sbitmap blocks; + basic_block bb; + rtx branch, insn; + rtx branch_target = 0; + int branch_addr = 0, insn_addr, required_dist = 0; + int i; + unsigned int j; - /* This sets up INSN_ADDRESSES. */ - shorten_branches (get_insns ()); + if (!TARGET_BRANCH_HINTS || optimize == 0) + { + /* We still do it for unoptimized code because an external + function might have hinted a call or return. */ + insert_hbrp (); + pad_bb (); + return; + } - /* Keep track of length added by nops. */ - length = 0; + blocks = sbitmap_alloc (last_basic_block); + sbitmap_zero (blocks); - prev_insn = 0; - for (insn = get_insns (); insn; insn = next_insn) + in_spu_reorg = 1; + compute_bb_for_insn (); + + compact_blocks (); + + spu_bb_info = + (struct spu_bb_info *) xcalloc (n_basic_blocks, + sizeof (struct spu_bb_info)); + + /* We need exact insn addresses and lengths. */ + shorten_branches (get_insns ()); + + for (i = n_basic_blocks - 1; i >= 0; i--) { - next_insn = next_active_insn (insn); - addr = INSN_ADDRESSES (INSN_UID (insn)); - if (GET_MODE (insn) == TImode - && next_insn - && GET_MODE (next_insn) != TImode - && ((addr + length) & 7) != 0) + bb = BASIC_BLOCK (i); + branch = 0; + if (spu_bb_info[i].prop_jump) { - /* prev_insn will always be set because the first insn is - always 8-byte aligned. */ - emit_nop_for_insn (prev_insn); - length += 4; + branch = spu_bb_info[i].prop_jump; + branch_target = get_branch_target (branch); + branch_addr = INSN_ADDRESSES (INSN_UID (branch)); + required_dist = spu_hint_dist; + } + /* Search from end of a block to beginning. In this loop, find + jumps which need a branch and emit them only when: + - it's an indirect branch and we're at the insn which sets + the register + - we're at an insn that will invalidate the hint. e.g., a + call, another hint insn, inline asm that clobbers $hbr, and + some inlined operations (divmodsi4). Don't consider jumps + because they are only at the end of a block and are + considered when we are deciding whether to propagate + - we're getting too far away from the branch. The hbr insns + only have a signed 10 bit offset + We go back as far as possible so the branch will be considered + for propagation when we get to the beginning of the block. */ + for (insn = BB_END (bb); insn; insn = PREV_INSN (insn)) + { + if (INSN_P (insn)) + { + insn_addr = INSN_ADDRESSES (INSN_UID (insn)); + if (branch + && ((GET_CODE (branch_target) == REG + && set_of (branch_target, insn) != NULL_RTX) + || insn_clobbers_hbr (insn) + || branch_addr - insn_addr > 600)) + { + rtx next = NEXT_INSN (insn); + int next_addr = INSN_ADDRESSES (INSN_UID (next)); + if (insn != BB_END (bb) + && branch_addr - next_addr >= required_dist) + { + if (dump_file) + fprintf (dump_file, + "hint for %i in block %i before %i\n", + INSN_UID (branch), bb->index, + INSN_UID (next)); + spu_emit_branch_hint (next, branch, branch_target, + branch_addr - next_addr, blocks); + } + branch = 0; + } + + /* JUMP_P will only be true at the end of a block. When + branch is already set it means we've previously decided + to propagate a hint for that branch into this block. */ + if (CALL_P (insn) || (JUMP_P (insn) && !branch)) + { + branch = 0; + if ((branch_target = get_branch_target (insn))) + { + branch = insn; + branch_addr = insn_addr; + required_dist = spu_hint_dist; + } + } + } + if (insn == BB_HEAD (bb)) + break; + } + + if (branch) + { + /* If we haven't emitted a hint for this branch yet, it might + be profitable to emit it in one of the predecessor blocks, + especially for loops. */ + rtx bbend; + basic_block prev = 0, prop = 0, prev2 = 0; + int loop_exit = 0, simple_loop = 0; + int next_addr = INSN_ADDRESSES (INSN_UID (NEXT_INSN (insn))); + + for (j = 0; j < EDGE_COUNT (bb->preds); j++) + if (EDGE_PRED (bb, j)->flags & EDGE_FALLTHRU) + prev = EDGE_PRED (bb, j)->src; + else + prev2 = EDGE_PRED (bb, j)->src; + + for (j = 0; j < EDGE_COUNT (bb->succs); j++) + if (EDGE_SUCC (bb, j)->flags & EDGE_LOOP_EXIT) + loop_exit = 1; + else if (EDGE_SUCC (bb, j)->dest == bb) + simple_loop = 1; + + /* If this branch is a loop exit then propagate to previous + fallthru block. This catches the cases when it is a simple + loop or when there is an initial branch into the loop. */ + if (prev && (loop_exit || simple_loop) + && prev->loop_depth <= bb->loop_depth) + prop = prev; + + /* If there is only one adjacent predecessor. Don't propagate + outside this loop. This loop_depth test isn't perfect, but + I'm not sure the loop_father member is valid at this point. */ + else if (prev && single_pred_p (bb) + && prev->loop_depth == bb->loop_depth) + prop = prev; + + /* If this is the JOIN block of a simple IF-THEN then + propogate the hint to the HEADER block. */ + else if (prev && prev2 + && EDGE_COUNT (bb->preds) == 2 + && EDGE_COUNT (prev->preds) == 1 + && EDGE_PRED (prev, 0)->src == prev2 + && prev2->loop_depth == bb->loop_depth + && GET_CODE (branch_target) != REG) + prop = prev; + + /* Don't propagate when: + - this is a simple loop and the hint would be too far + - this is not a simple loop and there are 16 insns in + this block already + - the predecessor block ends in a branch that will be + hinted + - the predecessor block ends in an insn that invalidates + the hint */ + if (prop + && prop->index >= 0 + && (bbend = BB_END (prop)) + && branch_addr - INSN_ADDRESSES (INSN_UID (bbend)) < + (simple_loop ? 600 : 16 * 4) && get_branch_target (bbend) == 0 + && (JUMP_P (bbend) || !insn_clobbers_hbr (bbend))) + { + if (dump_file) + fprintf (dump_file, "propagate from %i to %i (loop depth %i) " + "for %i (loop_exit %i simple_loop %i dist %i)\n", + bb->index, prop->index, bb->loop_depth, + INSN_UID (branch), loop_exit, simple_loop, + branch_addr - INSN_ADDRESSES (INSN_UID (bbend))); + + spu_bb_info[prop->index].prop_jump = branch; + spu_bb_info[prop->index].bb_index = i; + } + else if (branch_addr - next_addr >= required_dist) + { + if (dump_file) + fprintf (dump_file, "hint for %i in block %i before %i\n", + INSN_UID (branch), bb->index, + INSN_UID (NEXT_INSN (insn))); + spu_emit_branch_hint (NEXT_INSN (insn), branch, branch_target, + branch_addr - next_addr, blocks); + } + branch = 0; } - prev_insn = insn; } -} + free (spu_bb_info); -static void -spu_machine_dependent_reorg (void) -{ - if (optimize > 0) + if (!sbitmap_empty_p (blocks)) + find_many_sub_basic_blocks (blocks); + + /* We have to schedule to make sure alignment is ok. */ + FOR_EACH_BB (bb) bb->flags &= ~BB_DISABLE_SCHEDULE; + + /* The hints need to be scheduled, so call it again. */ + schedule_insns (); + + insert_hbrp (); + + pad_bb (); + + + if (spu_flag_var_tracking) { - if (TARGET_BRANCH_HINTS) - insert_branch_hints (); - insert_nops (); + df_analyze (); + timevar_push (TV_VAR_TRACKING); + variable_tracking_main (); + timevar_pop (TV_VAR_TRACKING); + df_finish_pass (false); } + + free_bb_for_insn (); + + in_spu_reorg = 0; } @@ -2405,15 +2711,14 @@ spu_sched_issue_rate (void) } static int -spu_sched_variable_issue (FILE * dump ATTRIBUTE_UNUSED, - int verbose ATTRIBUTE_UNUSED, rtx insn, - int can_issue_more) +uses_ls_unit(rtx insn) { - if (GET_CODE (PATTERN (insn)) != USE - && GET_CODE (PATTERN (insn)) != CLOBBER - && get_pipe (insn) != -2) - can_issue_more--; - return can_issue_more; + rtx set = single_set (insn); + if (set != 0 + && (GET_CODE (SET_DEST (set)) == MEM + || GET_CODE (SET_SRC (set)) == MEM)) + return 1; + return 0; } static int @@ -2439,7 +2744,6 @@ get_pipe (rtx insn) case TYPE_FPD: case TYPE_FP6: case TYPE_FP7: - case TYPE_IPREFETCH: return 0; case TYPE_LNOP: @@ -2449,41 +2753,332 @@ get_pipe (rtx insn) case TYPE_BR: case TYPE_MULTI1: case TYPE_HBR: + case TYPE_IPREFETCH: return 1; default: abort (); } } + +/* haifa-sched.c has a static variable that keeps track of the current + cycle. It is passed to spu_sched_reorder, and we record it here for + use by spu_sched_variable_issue. It won't be accurate if the + scheduler updates it's clock_var between the two calls. */ +static int clock_var; + +/* This is used to keep track of insn alignment. Set to 0 at the + beginning of each block and increased by the "length" attr of each + insn scheduled. */ +static int spu_sched_length; + +/* Record when we've issued pipe0 and pipe1 insns so we can reorder the + ready list appropriately in spu_sched_reorder(). */ +static int pipe0_clock; +static int pipe1_clock; + +static int prev_clock_var; + +static int prev_priority; + +/* The SPU needs to load the next ilb sometime during the execution of + the previous ilb. There is a potential conflict if every cycle has a + load or store. To avoid the conflict we make sure the load/store + unit is free for at least one cycle during the execution of insns in + the previous ilb. */ +static int spu_ls_first; +static int prev_ls_clock; + +static void +spu_sched_init_global (FILE *file ATTRIBUTE_UNUSED, int verbose ATTRIBUTE_UNUSED, + int max_ready ATTRIBUTE_UNUSED) +{ + spu_sched_length = 0; +} + +static void +spu_sched_init (FILE *file ATTRIBUTE_UNUSED, int verbose ATTRIBUTE_UNUSED, + int max_ready ATTRIBUTE_UNUSED) +{ + if (align_labels > 4 || align_loops > 4 || align_jumps > 4) + { + /* When any block might be at least 8-byte aligned, assume they + will all be at least 8-byte aligned to make sure dual issue + works out correctly. */ + spu_sched_length = 0; + } + spu_ls_first = INT_MAX; + clock_var = -1; + prev_ls_clock = -1; + pipe0_clock = -1; + pipe1_clock = -1; + prev_clock_var = -1; + prev_priority = -1; +} + static int -spu_sched_adjust_priority (rtx insn, int pri) +spu_sched_variable_issue (FILE *file ATTRIBUTE_UNUSED, + int verbose ATTRIBUTE_UNUSED, rtx insn, int more) { - int p = get_pipe (insn); - /* Schedule UNSPEC_CONVERT's early so they have less effect on - * scheduling. */ + int len; + int p; if (GET_CODE (PATTERN (insn)) == USE || GET_CODE (PATTERN (insn)) == CLOBBER - || p == -2) - return pri + 100; - /* Schedule pipe0 insns early for greedier dual issue. */ - if (p != 1) - return pri + 50; - return pri; + || (len = get_attr_length (insn)) == 0) + return more; + + spu_sched_length += len; + + /* Reset on inline asm */ + if (INSN_CODE (insn) == -1) + { + spu_ls_first = INT_MAX; + pipe0_clock = -1; + pipe1_clock = -1; + return 0; + } + p = get_pipe (insn); + if (p == 0) + pipe0_clock = clock_var; + else + pipe1_clock = clock_var; + + if (in_spu_reorg) + { + if (clock_var - prev_ls_clock > 1 + || INSN_CODE (insn) == CODE_FOR_iprefetch) + spu_ls_first = INT_MAX; + if (uses_ls_unit (insn)) + { + if (spu_ls_first == INT_MAX) + spu_ls_first = spu_sched_length; + prev_ls_clock = clock_var; + } + + /* The scheduler hasn't inserted the nop, but we will later on. + Include those nops in spu_sched_length. */ + if (prev_clock_var == clock_var && (spu_sched_length & 7)) + spu_sched_length += 4; + prev_clock_var = clock_var; + + /* more is -1 when called from spu_sched_reorder for new insns + that don't have INSN_PRIORITY */ + if (more >= 0) + prev_priority = INSN_PRIORITY (insn); + } + + /* Always try issueing more insns. spu_sched_reorder will decide + when the cycle should be advanced. */ + return 1; +} + +/* This function is called for both TARGET_SCHED_REORDER and + TARGET_SCHED_REORDER2. */ +static int +spu_sched_reorder (FILE *file ATTRIBUTE_UNUSED, int verbose ATTRIBUTE_UNUSED, + rtx *ready, int *nreadyp, int clock) +{ + int i, nready = *nreadyp; + int pipe_0, pipe_1, pipe_hbrp, pipe_ls, schedule_i; + rtx insn; + + clock_var = clock; + + if (nready <= 0 || pipe1_clock >= clock) + return 0; + + /* Find any rtl insns that don't generate assembly insns and schedule + them first. */ + for (i = nready - 1; i >= 0; i--) + { + insn = ready[i]; + if (INSN_CODE (insn) == -1 + || INSN_CODE (insn) == CODE_FOR_blockage + || INSN_CODE (insn) == CODE_FOR__spu_convert) + { + ready[i] = ready[nready - 1]; + ready[nready - 1] = insn; + return 1; + } + } + + pipe_0 = pipe_1 = pipe_hbrp = pipe_ls = schedule_i = -1; + for (i = 0; i < nready; i++) + if (INSN_CODE (ready[i]) != -1) + { + insn = ready[i]; + switch (get_attr_type (insn)) + { + default: + case TYPE_MULTI0: + case TYPE_CONVERT: + case TYPE_FX2: + case TYPE_FX3: + case TYPE_SPR: + case TYPE_NOP: + case TYPE_FXB: + case TYPE_FPD: + case TYPE_FP6: + case TYPE_FP7: + pipe_0 = i; + break; + case TYPE_LOAD: + case TYPE_STORE: + pipe_ls = i; + case TYPE_LNOP: + case TYPE_SHUF: + case TYPE_BR: + case TYPE_MULTI1: + case TYPE_HBR: + pipe_1 = i; + break; + case TYPE_IPREFETCH: + pipe_hbrp = i; + break; + } + } + + /* In the first scheduling phase, schedule loads and stores together + to increase the chance they will get merged during postreload CSE. */ + if (!reload_completed && pipe_ls >= 0) + { + insn = ready[pipe_ls]; + ready[pipe_ls] = ready[nready - 1]; + ready[nready - 1] = insn; + return 1; + } + + /* If there is an hbrp ready, prefer it over other pipe 1 insns. */ + if (pipe_hbrp >= 0) + pipe_1 = pipe_hbrp; + + /* When we have loads/stores in every cycle of the last 15 insns and + we are about to schedule another load/store, emit an hbrp insn + instead. */ + if (in_spu_reorg + && spu_sched_length - spu_ls_first >= 4 * 15 + && !(pipe0_clock < clock && pipe_0 >= 0) && pipe_1 == pipe_ls) + { + insn = sched_emit_insn (gen_iprefetch (GEN_INT (3))); + recog_memoized (insn); + if (pipe0_clock < clock) + PUT_MODE (insn, TImode); + spu_sched_variable_issue (file, verbose, insn, -1); + return 0; + } + + /* In general, we want to emit nops to increase dual issue, but dual + issue isn't faster when one of the insns could be scheduled later + without effecting the critical path. We look at INSN_PRIORITY to + make a good guess, but it isn't perfect so -mdual-nops=n can be + used to effect it. */ + if (in_spu_reorg && spu_dual_nops < 10) + { + /* When we are at an even address and we are not issueing nops to + improve scheduling then we need to advance the cycle. */ + if ((spu_sched_length & 7) == 0 && prev_clock_var == clock + && (spu_dual_nops == 0 + || (pipe_1 != -1 + && prev_priority > + INSN_PRIORITY (ready[pipe_1]) + spu_dual_nops))) + return 0; + + /* When at an odd address, schedule the highest priority insn + without considering pipeline. */ + if ((spu_sched_length & 7) == 4 && prev_clock_var != clock + && (spu_dual_nops == 0 + || (prev_priority > + INSN_PRIORITY (ready[nready - 1]) + spu_dual_nops))) + return 1; + } + + + /* We haven't issued a pipe0 insn yet this cycle, if there is a + pipe0 insn in the ready list, schedule it. */ + if (pipe0_clock < clock && pipe_0 >= 0) + schedule_i = pipe_0; + + /* Either we've scheduled a pipe0 insn already or there is no pipe0 + insn to schedule. Put a pipe1 insn at the front of the ready list. */ + else + schedule_i = pipe_1; + + if (schedule_i > -1) + { + insn = ready[schedule_i]; + ready[schedule_i] = ready[nready - 1]; + ready[nready - 1] = insn; + return 1; + } + return 0; } /* INSN is dependent on DEP_INSN. */ static int -spu_sched_adjust_cost (rtx insn, rtx link ATTRIBUTE_UNUSED, - rtx dep_insn ATTRIBUTE_UNUSED, int cost) +spu_sched_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) { - if (GET_CODE (insn) == CALL_INSN) + rtx set; + + /* The blockage pattern is used to prevent instructions from being + moved across it and has no cost. */ + if (INSN_CODE (insn) == CODE_FOR_blockage + || INSN_CODE (dep_insn) == CODE_FOR_blockage) + return 0; + + if (INSN_CODE (insn) == CODE_FOR__spu_convert + || INSN_CODE (dep_insn) == CODE_FOR__spu_convert) + return 0; + + /* Make sure hbrps are spread out. */ + if (INSN_CODE (insn) == CODE_FOR_iprefetch + && INSN_CODE (dep_insn) == CODE_FOR_iprefetch) + return 8; + + /* Make sure hints and hbrps are 2 cycles apart. */ + if ((INSN_CODE (insn) == CODE_FOR_iprefetch + || INSN_CODE (insn) == CODE_FOR_hbr) + && (INSN_CODE (dep_insn) == CODE_FOR_iprefetch + || INSN_CODE (dep_insn) == CODE_FOR_hbr)) + return 2; + + /* An hbrp has no real dependency on other insns. */ + if (INSN_CODE (insn) == CODE_FOR_iprefetch + || INSN_CODE (dep_insn) == CODE_FOR_iprefetch) + return 0; + + /* Assuming that it is unlikely an argument register will be used in + the first cycle of the called function, we reduce the cost for + slightly better scheduling of dep_insn. When not hinted, the + mispredicted branch would hide the cost as well. */ + if (CALL_P (insn)) + { + rtx target = get_branch_target (insn); + if (GET_CODE (target) != REG || !set_of (target, insn)) + return cost - 2; + return cost; + } + + /* And when returning from a function, let's assume the return values + are completed sooner too. */ + if (CALL_P (dep_insn)) return cost - 2; + + /* Make sure an instruction that loads from the back chain is schedule + away from the return instruction so a hint is more likely to get + issued. */ + if (INSN_CODE (insn) == CODE_FOR__return + && (set = single_set (dep_insn)) + && GET_CODE (SET_DEST (set)) == REG + && REGNO (SET_DEST (set)) == LINK_REGISTER_REGNUM) + return 20; + /* The dfa scheduler sets cost to 0 for all anti-dependencies and the scheduler makes every insn in a block anti-dependent on the final jump_insn. We adjust here so higher cost insns will get scheduled earlier. */ - if (GET_CODE (insn) == JUMP_INSN && REG_NOTE_KIND (link) == REG_DEP_ANTI) + if (JUMP_P (insn) && REG_NOTE_KIND (link) == REG_DEP_ANTI) return insn_cost (dep_insn) - 3; + return cost; } @@ -5660,3 +6255,17 @@ spu_libgcc_shift_count_mode (void) for shift counts. */ return SImode; } + +/* An early place to adjust some flags after GCC has finished processing + * them. */ +static void +asm_file_start (void) +{ + /* Variable tracking should be run after all optimizations which + change order of insns. It also needs a valid CFG. */ + spu_flag_var_tracking = flag_var_tracking; + flag_var_tracking = 0; + + default_file_start (); +} + diff --git a/gcc/config/spu/spu.h b/gcc/config/spu/spu.h index 9839822885e..578c7427cf4 100644 --- a/gcc/config/spu/spu.h +++ b/gcc/config/spu/spu.h @@ -50,7 +50,8 @@ extern GTY(()) int spu_tune; /* Default target_flags if no switches specified. */ #ifndef TARGET_DEFAULT -#define TARGET_DEFAULT (MASK_ERROR_RELOC | MASK_SAFE_DMA | MASK_BRANCH_HINTS) +#define TARGET_DEFAULT (MASK_ERROR_RELOC | MASK_SAFE_DMA | MASK_BRANCH_HINTS \ + | MASK_SAFE_HINTS) #endif diff --git a/gcc/config/spu/spu.md b/gcc/config/spu/spu.md index 7b4b743fc8d..d1fa6f03508 100644 --- a/gcc/config/spu/spu.md +++ b/gcc/config/spu/spu.md @@ -4200,12 +4200,23 @@ selb\t%0,%4,%0,%3" "lnop" [(set_attr "type" "lnop")]) +;; The operand is so we know why we generated this hbrp. +;; We clobber mem to make sure it isn't moved over any +;; loads, stores or calls while scheduling. (define_insn "iprefetch" - [(unspec [(const_int 0)] UNSPEC_IPREFETCH)] + [(unspec [(match_operand:SI 0 "const_int_operand" "n")] UNSPEC_IPREFETCH) + (clobber (mem:BLK (scratch)))] "" - "hbrp" + "hbrp\t# %0" [(set_attr "type" "iprefetch")]) +;; A non-volatile version so it gets scheduled +(define_insn "nopn_nv" + [(unspec [(match_operand:SI 0 "register_operand" "r")] UNSPEC_NOP)] + "" + "nop\t%0" + [(set_attr "type" "nop")]) + (define_insn "hbr" [(set (reg:SI 130) (unspec:SI [(match_operand:SI 0 "immediate_operand" "i,i,i") diff --git a/gcc/config/spu/spu.opt b/gcc/config/spu/spu.opt index 9957e1ec7fb..9cd63a14aea 100644 --- a/gcc/config/spu/spu.opt +++ b/gcc/config/spu/spu.opt @@ -35,6 +35,14 @@ munsafe-dma Target Report RejectNegative InverseMask(SAFE_DMA) volatile must be specified on any memory that is effected by DMA +mdual-nops +Target Report Var(spu_dual_nops,10) Init(10) +Insert nops when it might improve performance by allowing dual issue (default) + +mdual-nops= +Target RejectNegative Joined UInteger Var(spu_dual_nops) +Insert nops when it might improve performance by allowing dual issue (default) + mstdmain Target Report Mask(STD_MAIN) Use standard main function as entry for startup @@ -43,6 +51,14 @@ mbranch-hints Target Report Mask(BRANCH_HINTS) Generate branch hints for branches +mhint-max-nops= +Target RejectNegative Joined UInteger Var(spu_max_nops) Init(2) +Maximum number of nops to insert for a hint (Default 2) + +mhint-max-distance= +Target RejectNegative Joined Var(spu_max_distance_str) +Approximate maximum number of instructions to allow between a hint and its branch [125] + msmall-mem Target Report RejectNegative InverseMask(LARGE_MEM) Generate code for 18 bit addressing @@ -55,6 +71,10 @@ mfixed-range= Target RejectNegative Joined Var(spu_fixed_range_string) Specify range of registers to make fixed +msafe-hints +Target Report Mask(SAFE_HINTS) +Insert hbrp instructions after hinted branch targets to avoid the SPU hang issue + march= Target RejectNegative Joined Var(spu_arch_string) Generate code for given CPU diff --git a/gcc/config/xtensa/predicates.md b/gcc/config/xtensa/predicates.md index 39a4cc16991..c96f63730c4 100644 --- a/gcc/config/xtensa/predicates.md +++ b/gcc/config/xtensa/predicates.md @@ -1,5 +1,5 @@ ;; Predicate definitions for Xtensa. -;; Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. +;; Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; @@ -37,13 +37,17 @@ ;; Non-immediate operand excluding the constant pool. (define_predicate "nonimmed_operand" (ior (and (match_operand 0 "memory_operand") - (match_test "!constantpool_address_p (XEXP (op, 0))")) + (match_test "!constantpool_mem_p (op)")) (match_operand 0 "register_operand"))) ;; Memory operand excluding the constant pool. (define_predicate "mem_operand" (and (match_operand 0 "memory_operand") - (match_test "!constantpool_address_p (XEXP (op, 0))"))) + (match_test "!constantpool_mem_p (op)"))) + +;; Memory operand in the constant pool. +(define_predicate "constantpool_operand" + (match_test "constantpool_mem_p (op)")) (define_predicate "mask_operand" (ior (and (match_code "const_int") @@ -131,7 +135,9 @@ (define_predicate "move_operand" (ior (ior (match_operand 0 "register_operand") - (match_operand 0 "memory_operand")) + (and (match_operand 0 "memory_operand") + (match_test "!constantpool_mem_p (op) + || GET_MODE_SIZE (mode) % UNITS_PER_WORD == 0"))) (ior (and (match_code "const_int") (match_test "GET_MODE_CLASS (mode) == MODE_INT && xtensa_simm12b (INTVAL (op))")) diff --git a/gcc/config/xtensa/xtensa-protos.h b/gcc/config/xtensa/xtensa-protos.h index 82d7262922d..7ecde9baf21 100644 --- a/gcc/config/xtensa/xtensa-protos.h +++ b/gcc/config/xtensa/xtensa-protos.h @@ -1,5 +1,6 @@ /* Prototypes of target machine for GNU compiler for Xtensa. - Copyright 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2008 + Free Software Foundation, Inc. Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica. This file is part of GCC. @@ -66,9 +67,10 @@ extern bool xtensa_output_addr_const_extra (FILE *, rtx); extern void xtensa_output_literal (FILE *, rtx, enum machine_mode, int); extern rtx xtensa_return_addr (int, rtx); extern enum reg_class xtensa_preferred_reload_class (rtx, enum reg_class, int); -extern enum reg_class xtensa_secondary_reload_class (enum reg_class, - enum machine_mode, rtx, - int); +struct secondary_reload_info; +extern enum reg_class xtensa_secondary_reload (bool, rtx, enum reg_class, + enum machine_mode, + struct secondary_reload_info *); extern void xtensa_initialize_trampoline (rtx, rtx, rtx); #endif /* RTX_CODE */ diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 3bb71eb5c13..1af9cbab450 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -216,6 +216,9 @@ static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] = #undef TARGET_EXPAND_BUILTIN #define TARGET_EXPAND_BUILTIN xtensa_expand_builtin +#undef TARGET_SECONDARY_RELOAD +#define TARGET_SECONDARY_RELOAD xtensa_secondary_reload + struct gcc_target targetm = TARGET_INITIALIZER; @@ -2840,22 +2843,23 @@ xtensa_preferred_reload_class (rtx x, enum reg_class rclass, int isoutput) enum reg_class -xtensa_secondary_reload_class (enum reg_class rclass, - enum machine_mode mode ATTRIBUTE_UNUSED, - rtx x, int isoutput) +xtensa_secondary_reload (bool in_p, rtx x, enum reg_class rclass, + enum machine_mode mode, secondary_reload_info *sri) { int regno; - if (GET_CODE (x) == SIGN_EXTEND) - x = XEXP (x, 0); - regno = xt_true_regnum (x); - - if (!isoutput) + if (in_p && constantpool_mem_p (x)) { - if (rclass == FP_REGS && constantpool_mem_p (x)) + if (rclass == FP_REGS) return RL_REGS; + + if (mode == QImode) + sri->icode = CODE_FOR_reloadqi_literal; + else if (mode == HImode) + sri->icode = CODE_FOR_reloadhi_literal; } + regno = xt_true_regnum (x); if (ACC_REG_P (regno)) return ((rclass == GR_REGS || rclass == RL_REGS) ? NO_REGS : RL_REGS); if (rclass == ACC_REG) diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h index fecb56996e3..ab3b648ffa4 100644 --- a/gcc/config/xtensa/xtensa.h +++ b/gcc/config/xtensa/xtensa.h @@ -508,12 +508,6 @@ extern const enum reg_class xtensa_regno_to_class[FIRST_PSEUDO_REGISTER]; #define PREFERRED_OUTPUT_RELOAD_CLASS(X, CLASS) \ xtensa_preferred_reload_class (X, CLASS, 1) -#define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \ - xtensa_secondary_reload_class (CLASS, MODE, X, 0) - -#define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) \ - xtensa_secondary_reload_class (CLASS, MODE, X, 1) - /* Return the maximum number of consecutive registers needed to represent mode MODE in a register of class CLASS. */ #define CLASS_UNITS(mode, size) \ diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index cffbcd12f94..4f831d3f22c 100644 --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -880,6 +880,31 @@ (set_attr "mode" "QI") (set_attr "length" "2,2,3,3,3,3,3,3")]) +;; Sub-word reloads from the constant pool. + +(define_expand "reload<mode>_literal" + [(parallel [(match_operand:HQI 0 "register_operand" "=r") + (match_operand:HQI 1 "constantpool_operand" "") + (match_operand:SI 2 "register_operand" "=&r")])] + "" +{ + rtx lit, scratch; + unsigned word_off, byte_off; + + gcc_assert (GET_CODE (operands[1]) == SUBREG); + lit = SUBREG_REG (operands[1]); + scratch = operands[2]; + word_off = SUBREG_BYTE (operands[1]) & ~(UNITS_PER_WORD - 1); + byte_off = SUBREG_BYTE (operands[1]) - word_off; + + lit = adjust_address (lit, SImode, word_off); + emit_insn (gen_movsi (scratch, lit)); + emit_insn (gen_mov<mode> (operands[0], + gen_rtx_SUBREG (<MODE>mode, scratch, byte_off))); + + DONE; +}) + ;; 32-bit floating point moves (define_expand "movsf" diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4166bd148da..cb5c31402e8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,15 @@ +2008-09-05 Douglas Gregor <doug.gregor@gmail.com> + + PR c++/37342 + * tree.c (cp_build_qualified_type_real): Deal with sharing of + TYPE_LANG_SPECIFIC in the canonical types of pointer-to-method + types. + +2008-09-04 Ian Lance Taylor <iant@google.com> + + * parser.c (check_no_duplicate_clause): Change code parameter to + enum omp_clause_code. + 2008-09-03 Jakub Jelinek <jakub@redhat.com> PR c++/37348 @@ -682,7 +694,7 @@ * semantics.c (classtype_has_nothrow_assign_or_copy_p): Only check copy constructors and copy assignment operators proper. -2008-07-21 Rafael Avila de Espindola <espindola@google.com> +2008-07-21 Rafael Ãvila de EspÃndola <espindola@google.com> * parser.c (cp_token): Remove in_system_header. (eof_token): Remove in_system_header. @@ -4539,7 +4551,7 @@ * init.c (avoid_placement_new_aliasing): New static function. (build_new_1): Call it. -2007-06-11 Rafael Avila de Espindola <espindola@google.com> +2007-06-11 Rafael Ãvila de EspÃndola <espindola@google.com> * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove. (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove. @@ -4768,7 +4780,7 @@ * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the type only if is a class type (5.2.8/4). -2007-05-14 Rafael Avila de Espindola <espindola@google.com> +2007-05-14 Rafael Ãvila de EspÃndola <espindola@google.com> * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove. * decl.c (grokdeclarator): Use unsigned_type_for instead of diff --git a/gcc/cp/ChangeLog-1998 b/gcc/cp/ChangeLog-1998 index 1b4e301d025..c6e8b1e6768 100644 --- a/gcc/cp/ChangeLog-1998 +++ b/gcc/cp/ChangeLog-1998 @@ -495,7 +495,7 @@ Fri Nov 27 13:07:23 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * decl.c (require_complete_types_for_parms): Call layout_decl after we've completed the type. -1998-11-21 Martin von Löwis <loewis@informatik.hu-berlin.de> +1998-11-21 Martin von Löwis <loewis@informatik.hu-berlin.de> * decl2.c (validate_nonmember_using_decl): Allow using templates from the global namespace. @@ -769,7 +769,7 @@ Fri Nov 27 13:07:23 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * method.c (build_overload_value): Handle REFERENCE_TYPE. -1998-11-08 Martin von Löwis <loewis@informatik.hu-berlin.de> +1998-11-08 Martin von Löwis <loewis@informatik.hu-berlin.de> * decl.c (grokdeclarator): Allow namespace-scoped members if they are friends. @@ -1081,11 +1081,11 @@ Sat Nov 7 15:48:02 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * decl.c (grokdeclarator): Set DECL_NONCONVERTING_P for all non-converting constructors. -1998-10-24 Martin von Löwis <loewis@informatik.hu-berlin.de> +1998-10-24 Martin von Löwis <loewis@informatik.hu-berlin.de> * gxxint.texi: Correct documentation for n, N, Q, and B. -1998-10-23 Martin von Löwis <loewis@informatik.hu-berlin.de> +1998-10-23 Martin von Löwis <loewis@informatik.hu-berlin.de> * parse.y (condition): Convert VAR_DECL from reference to indirect reference. @@ -1219,7 +1219,7 @@ Sat Nov 7 15:48:02 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * decl.c (grokdeclarator): Use them. * tree.c (canonical_type_variant): Likewise. -1998-10-22 Martin von Löwis <loewis@informatik.hu-berlin.de> +1998-10-22 Martin von Löwis <loewis@informatik.hu-berlin.de> * parse.y (named_class_head): Push into class while parsing the base class list. @@ -1264,7 +1264,7 @@ Sat Nov 7 15:48:02 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * pt.c (tsubst, TEMPLATE*PARM*): Abort if we don't have any args. -1998-10-18 Martin von Löwis <loewis@informatik.hu-berlin.de> +1998-10-18 Martin von Löwis <loewis@informatik.hu-berlin.de> * decl2.c (validate_nonmember_using_decl): Fix using-directives of std if std is ignored. @@ -1659,7 +1659,7 @@ Tue Oct 6 07:57:26 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * pt.c (instantiate_decl): Do save and restore file position. -1998-10-05 Martin von Löwis <loewis@informatik.hu-berlin.de> +1998-10-05 Martin von Löwis <loewis@informatik.hu-berlin.de> * method.c (build_decl_overload_real): Clear numeric_output_need_bar after __. @@ -1793,7 +1793,7 @@ Thu Oct 1 10:43:45 1998 Nick Clifton <nickc@cygnus.com> (finish_anon_union): Also complain about local anon unions with no members. -1998-09-25 Martin von Löwis <loewis@informatik.hu-berlin.de> +1998-09-25 Martin von Löwis <loewis@informatik.hu-berlin.de> * decl.c (lookup_namespace_name): If the name is a namespace, return it immediately. @@ -1905,7 +1905,7 @@ Tue Sep 22 21:01:19 1998 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> * decl2.c (grokfield): Likewise. * pt.c (finish_member_template_decl): Likewise. -1998-09-20 Martin von Löwis <loewis@informatik.hu-berlin.de> +1998-09-20 Martin von Löwis <loewis@informatik.hu-berlin.de> * method.c (hack_identifier): Finding multiple members is always an error. @@ -2017,7 +2017,7 @@ Mon Sep 21 01:53:05 1998 Felix Lee <flee@cygnus.com> * error.c (dump_type_real): Handle NAMESPACE_DECL. * parse.y (base_class.1): Avoid crash on error. -1998-09-08 Martin von Löwis <loewis@informatik.hu-berlin.de> +1998-09-08 Martin von Löwis <loewis@informatik.hu-berlin.de> * decl.c (make_typename_type): If context is a namespace, the code is in error. @@ -2495,7 +2495,7 @@ Wed Aug 26 10:54:51 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * lex.c (real_yylex): Don't warn about long long constants if we're allowing long long. -1998-08-24 Martin von Löwis <loewis@informatik.hu-berlin.de> +1998-08-24 Martin von Löwis <loewis@informatik.hu-berlin.de> * decl.c (pushdecl): Use IDENTIFIER_NAMESPACE_VALUE instead of accessing bindings directly. @@ -3143,7 +3143,7 @@ Fri Aug 14 16:42:27 1998 Nick Clifton <nickc@cygnus.com> * decl.c (qualify_lookup): New fn. (lookup_name_real): Use it. -1998-07-16 Martin v. Loewis <loewis@informatik.hu-berlin.de> +1998-07-16 Martin v. Löwis <loewis@informatik.hu-berlin.de> * decl2.c (add_using_namespace): When directly using a namespace that was indirect before, promote it. @@ -3184,7 +3184,7 @@ Fri Aug 14 16:42:27 1998 Nick Clifton <nickc@cygnus.com> * decl.c (push_using_directive): Iterate over namespaces used indirectly. -1998-07-15 Martin v. Löwis <loewis@informatik.hu-berlin.de> +1998-07-15 Martin v. Löwis <loewis@informatik.hu-berlin.de> * decl2.c (add_using_namespace): Iterate over namespaces used indirectly. @@ -3218,7 +3218,7 @@ Fri Aug 14 16:42:27 1998 Nick Clifton <nickc@cygnus.com> * parse.y (using_directive): New nonterminal. (extdef, simple_stmt): Use it. -1998-07-14 Martin von Löwis <loewis@informatik.hu-berlin.de> +1998-07-14 Martin von Löwis <loewis@informatik.hu-berlin.de> * decl2.c (add_function): Move error message ... (arg_assoc_namespace): ... from here. @@ -3238,7 +3238,7 @@ Tue Jul 14 20:09:22 1998 Jeffrey A Law (law@cygnus.com) * call.c (joust): Don't warn about "confusing" conversions to the same type. -1998-07-14 Martin von Löwis <loewis@informatik.hu-berlin.de> +1998-07-14 Martin von Löwis <loewis@informatik.hu-berlin.de> * class.c (push_nested_class): Complain about namespaces. * decl.c (start_decl): Enter the object's namespace. @@ -3257,7 +3257,7 @@ Tue Jul 14 20:09:22 1998 Jeffrey A Law (law@cygnus.com) * init.c (build_offset_ref): Call mark_used and convert_from_reference for namespace members. -Mon Jul 13 23:25:28 1998 Martin von Löwis <loewis@informatik.hu-berlin.de> +Mon Jul 13 23:25:28 1998 Martin von Löwis <loewis@informatik.hu-berlin.de> * search.c (my_tree_cons): The bitfield is at index 2. @@ -3266,7 +3266,7 @@ Mon Jul 13 17:21:01 1998 Nick Clifton <nickc@cygnus.com> * lang-options.h: Format changed to work with new --help support in gcc/toplev.c -1998-07-12 Martin von Löwis <loewis@informatik.hu-berlin.de> +1998-07-12 Martin von Löwis <loewis@informatik.hu-berlin.de> * decl2.c (build_expr_from_tree): Change calls of do_identifier. Do Koenig lookup in CALL_EXPR. @@ -3484,7 +3484,7 @@ Sat Jun 27 07:36:09 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * sig.c (build_signature_pointer_or_reference_type): Don't set DECL_CONTEXT. -1998-06-24 Martin v. Löwis <loewis@informatik.hu-berlin.de> +1998-06-24 Martin v. Löwis <loewis@informatik.hu-berlin.de> Set DECL_CONTEXT for globals to NULL_TREE instead of global_namespace. * cp-tree.h (FROB_CONTEXT): New macro. @@ -3858,7 +3858,7 @@ Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * error.c (cp_printers): Use 'o' instead of '_' for the null entry. -1998-06-05 Martin v. Loewis <loewis@informatik.hu-berlin.de> +1998-06-05 Martin v. Löwis <loewis@informatik.hu-berlin.de> * cp-tree.h (DECL_NAMESPACE_ALIAS, ORIGINAL_NAMESPACE): Declare. * decl.c (lookup_name_real): Add namespaces_only parameter. @@ -3886,7 +3886,7 @@ Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * error.c (dump_expr): Clean up NEW_EXPR case. -1998-06-04 Martin von Löwis <loewis@informatik.hu-berlin.de> +1998-06-04 Martin von Löwis <loewis@informatik.hu-berlin.de> Suggested by Brendan Kehoe * decl2.c (do_toplevel_using_decl): When decl is a TYPE_DECL, @@ -4039,7 +4039,7 @@ Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * decl.c (pushdecl): Don't copy the type_decl. -1998-05-26 Martin v. Löwis <loewis@informatik.hu-berlin.de> +1998-05-26 Martin v. Löwis <loewis@informatik.hu-berlin.de> * class.c (pushclass): Always store TYPE_MAIN_VARIANT in current_class_type. @@ -4060,7 +4060,7 @@ Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * decl.c (pushtag): Avoid crashing on erroneous input. -1998-05-25 Martin v. Löwis <loewis@informatik.hu-berlin.de> +1998-05-25 Martin v. Löwis <loewis@informatik.hu-berlin.de> * decl.c (push_namespace): Only produce one unique name for anonymous namespaces. @@ -4127,7 +4127,7 @@ Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> used as expression. * typeck.c (decay_conversion): Likewise. -1998-05-24 Martin von Löwis <loewis@informatik.hu-berlin.de> +1998-05-24 Martin von Löwis <loewis@informatik.hu-berlin.de> * error.c (dump_expr): Support namespaces. @@ -4248,7 +4248,7 @@ Thu May 21 11:54:44 1998 Dave Brolley <brolley@cygnus.com> * pt.c (classtype_mangled_name): Don't try DECL_CONTEXT on types. In fact, don't use DECL_CONTEXT at all here. -1998-05-20 Martin von Loewis <loewis@informatik.hu-berlin.de> +1998-05-20 Martin von Löwis <loewis@informatik.hu-berlin.de> * decl.c (record_unknown_type): New function. (init_decl_processing): Call it for the unknown and global type @@ -4366,7 +4366,7 @@ Mon May 18 03:00:57 1998 Jason Merrill <jason@yorick.cygnus.com> * class.c (instantiate_type): Don't abort on TREE_NONLOCAL_FLAG. -Mon May 18 01:43:01 1998 Martin v. Loewis <loewis@informatik.hu-berlin.de> +Mon May 18 01:43:01 1998 Martin v. Löwis <loewis@informatik.hu-berlin.de> * decl.c (lookup_name_real): Don't look at IDENTIFIER_LOCAL_VALUE for a type unless it is one. @@ -4380,7 +4380,7 @@ Mon May 18 01:24:08 1998 Jeffrey A Law (law@cygnus.com) * Makefile.in (BISON): Use bison from the build tree if it exists. (FLEX): Likewise. -Sun May 17 14:52:08 1998 Martin v. Loewis <loewis@informatik.hu-berlin.de> +Sun May 17 14:52:08 1998 Martin v. Löwis <loewis@informatik.hu-berlin.de> * typeck.c (type_unknown_p): Return true for TREE_LIST also. @@ -4620,7 +4620,7 @@ Sat May 9 14:44:37 1998 Jason Merrill <jason@yorick.cygnus.com> * decl.c (lookup_name_real): Use it. * search.c (lookup_field): Likewise. -Fri May 8 23:32:42 1998 Martin von Loewis <loewis@informatik.hu-berlin.de> +Fri May 8 23:32:42 1998 Martin von Löwis <loewis@informatik.hu-berlin.de> * cp-tree.def (OVERLOAD): New node. * cp-tree.h (BINDING_TYPE, SET_IDENTIFIER_GLOBAL_VALUE, @@ -5894,7 +5894,7 @@ Wed Feb 25 00:35:33 1998 Jason Merrill <jason@yorick.cygnus.com> * decl.c (get_unique_name): Tweak from earlier in the name. -Tue Feb 24 22:15:04 1998 Martin von Loewis <loewis@informatik.hu-berlin.de> +Tue Feb 24 22:15:04 1998 Martin von Löwis <loewis@informatik.hu-berlin.de> * cp-tree.def: Add CPLUS_BINDING node. * cp-tree.h (tree_binding): New struct. diff --git a/gcc/cp/ChangeLog-1999 b/gcc/cp/ChangeLog-1999 index 4b17345d166..86d1384e044 100644 --- a/gcc/cp/ChangeLog-1999 +++ b/gcc/cp/ChangeLog-1999 @@ -914,7 +914,7 @@ Wed Nov 10 12:43:21 1999 Philippe De Muyter <phdm@macqel.be> * semantics.c (begin_new_placement): Remove. (finish_new_placement): Likewise. -1999-11-05 Martin v. Löwis <loewis@informatik.hu-berlin.de> +1999-11-05 Martin v. Löwis <loewis@informatik.hu-berlin.de> * cp-tree.h (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK): New macro. (DECL_TEMPLATE_INFO): Use it. @@ -1714,7 +1714,7 @@ Fri Sep 24 10:48:10 1999 Bernd Schmidt <bernds@cygnus.co.uk> * typeck.c (mark_addressable): Addressed variables are implicitly used. -1999-09-23 Martin v. Löwis <loewis@informatik.hu-berlin.de> +1999-09-23 Martin v. Löwis <loewis@informatik.hu-berlin.de> * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK): New macro. (RECORD_OR_UNION_TYPE_CHECK, LANG_IDENTIFIER_CAST): Likewise. @@ -1733,7 +1733,7 @@ Fri Sep 24 10:48:10 1999 Bernd Schmidt <bernds@cygnus.co.uk> * decl.c (init_decl_processing): If -fshort-wchar, use 'short unsigned int' for wchar_t. -1999-09-23 Martin v. Löwis <loewis@informatik.hu-berlin.de> +1999-09-23 Martin v. Löwis <loewis@informatik.hu-berlin.de> * ir.texi: Fix formatting errors and typos. @@ -1769,7 +1769,7 @@ Fri Sep 24 10:48:10 1999 Bernd Schmidt <bernds@cygnus.co.uk> * decl2.c (lang_decode_option): Adjust, in the wake of recent changes to option processing. -1999-09-21 Martin v. Löwis <loewis@informatik.hu-berlin.de> +1999-09-21 Martin v. Löwis <loewis@informatik.hu-berlin.de> * typeck.c (get_member_function_from_ptrfunc): Allow extraction of function pointer from pmfs with no object given. @@ -1922,7 +1922,7 @@ Mon Sep 20 10:49:05 1999 Bernd Schmidt <bernds@cygnus.co.uk> (cp_finish_decl): Adjust call to layout_var_decl. * pt.c (tsubst_expr): Make sure to initialize stmt before using it. -1999-09-18 Martin von Loewis <loewis@informatik.hu-berlin.de> +1999-09-18 Martin von Löwis <loewis@informatik.hu-berlin.de> * typeck.c (get_member_function_from_ptrfunc): Always consider virtuality inside member pointer. @@ -3751,11 +3751,11 @@ Mon Aug 23 22:17:20 1999 Mumit Khan <khan@xraylith.wisc.edu> (build_functional_cast): Likewise. * xref.c (GNU_xref_decl): Likewise. -1999-08-10 Martin v. Loewis <martin@mira.isdn.cs.tu-berlin.de> +1999-08-10 Martin v. Löwis <martin@mira.isdn.cs.tu-berlin.de> * lex.c (do_identifier): Remove unnecessary lookup of class field. -1999-08-09 Martin v. Loewis <martin@mira.isdn.cs.tu-berlin.de> +1999-08-09 Martin v. Löwis <martin@mira.isdn.cs.tu-berlin.de> * decl2.c (set_decl_namespace): Do not complain about non-matching decls if processing a template. @@ -4559,7 +4559,7 @@ Wed Jul 7 01:26:47 1999 Alexandre Oliva <oliva@dcc.unicamp.br> maybe_push_cache_obstack. * search.c (push_class_decls): Likewise. -1999-06-14 Martin von Löwis <loewis@informatik.hu-berlin.de> +1999-06-14 Martin von Löwis <loewis@informatik.hu-berlin.de> * pt.c (tsubst_friend_function): Push into namespace of friend function before pushdecl'ing it. @@ -4972,7 +4972,7 @@ Tue May 18 00:21:34 1999 Zack Weinberg <zack@rabi.phys.columbia.edu> * pt.c (check_explicit_specialization): Improve error messages. -1999-05-04 Martin von Löwis <loewis@informatik.hu-berlin.de> +1999-05-04 Martin von Löwis <loewis@informatik.hu-berlin.de> * typeck.c (string_conv_p): Use same_type_p to check whether we try to convert between char and wchar_t. @@ -4989,7 +4989,7 @@ Tue May 18 00:21:34 1999 Zack Weinberg <zack@rabi.phys.columbia.edu> * typeck.c (build_const_cast): Tighten checks for legality. -1999-05-02 Martin von Löwis <loewis@informatik.hu-berlin.de> +1999-05-02 Martin von Löwis <loewis@informatik.hu-berlin.de> * init.c (build_member_call): Lookup names coming from namespace-scoped LOOKUP_EXPR. @@ -4998,7 +4998,7 @@ Tue May 18 00:21:34 1999 Zack Weinberg <zack@rabi.phys.columbia.edu> * gxxint.texi: Add documentation for 'I'. -1999-05-02 Martin von Löwis <loewis@informatik.hu-berlin.de> +1999-05-02 Martin von Löwis <loewis@informatik.hu-berlin.de> * tinfo.cc (operator==): Qualify type_info with std::. @@ -5391,7 +5391,7 @@ Wed Apr 28 11:42:22 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> * typeck.c (build_unary_op): Handle taking the address of a unique bound non-static member function. -1999-04-13 Martin von Loewis <loewis@informatik.hu-berlin.de> +1999-04-13 Martin von Löwis <loewis@informatik.hu-berlin.de> * lang-options.h (-Wdeprecated): New flag. * decl2.c (warn_deprecated): New flag. @@ -5833,7 +5833,7 @@ Fri Mar 26 10:20:34 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> (GNU_xref_end_scope, GNU_xref_ref, GNU_xref_decl, GNU_xref_call, gen_assign, GNU_xref_member): Const-ify a char*. -1999-03-25 Martin von Löwis <loewis@informatik.hu-berlin.de> +1999-03-25 Martin von Löwis <loewis@informatik.hu-berlin.de> * gxxint.texi: Remove old discussion on copying virtual bases. @@ -5866,7 +5866,7 @@ Fri Mar 26 10:20:34 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * lex.c (do_identifier): If we got error_mark_node, call lookup_name again. -1999-03-24 Martin von Löwis <loewis@informatik.hu-berlin.de> +1999-03-24 Martin von Löwis <loewis@informatik.hu-berlin.de> * class.c (finish_struct_1): Always reset TYPE_FIELDS for empty classes. @@ -5984,7 +5984,7 @@ Fri Mar 26 10:20:34 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * Make-lang.in: ($(INTL_TARGETS)): Depend on cp/parse.c. ($(srcdir)/cp/parse.c): Moved from ../Makefile.in. -1999-03-17 Martin von Löwis <loewis@informatik.hu-berlin.de> +1999-03-17 Martin von Löwis <loewis@informatik.hu-berlin.de> * parse.y (named_complex_class_head_sans_basetype): Do not push a scope for error_mark_node. @@ -6064,7 +6064,7 @@ Mon Mar 15 21:57:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * sig.c (build_signature_table_constructor): Use cp_error. -1999-03-13 Martin von Löwis <loewis@informatik.hu-berlin.de> +1999-03-13 Martin von Löwis <loewis@informatik.hu-berlin.de> * semantics.c (finish_switch_cond): Handle error cases gracefully. Detected by g++.law/enum5.C. @@ -6078,7 +6078,7 @@ Mon Mar 15 21:57:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * typeck2.c (process_init_constructor): Return error if one argument is in error. Detected by g++.benjamin/13478.C. -1999-03-12 Martin von Löwis <loewis@informatik.hu-berlin.de> +1999-03-12 Martin von Löwis <loewis@informatik.hu-berlin.de> * decl.c (select_decl): Allow class templates when we need types. * decl2.c (ambiguous_decl): Likewise. @@ -6217,7 +6217,7 @@ Mon Mar 15 21:57:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * decl2.c (import_export_class): Also return if CLASSTYPE_INTERFACE_ONLY is set. -1999-03-03 Martin von Löwis <loewis@informatik.hu-berlin.de> +1999-03-03 Martin von Löwis <loewis@informatik.hu-berlin.de> * decl.c (push_overloaded_decl): Only overwrite the old binding if there was one. @@ -6304,7 +6304,7 @@ Mon Mar 15 21:57:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * typeck.c (convert_for_assignment): Allow boolean integral constant expressions to convert to null pointer. -1999-02-24 Martin von Loewis <loewis@informatik.hu-berlin.de> +1999-02-24 Martin von Löwis <loewis@informatik.hu-berlin.de> * decl.c (lookup_namespace_name): Resolve namespace aliases. @@ -6558,7 +6558,7 @@ Sun Jan 31 20:34:29 1999 Zack Weinberg <zack@rabi.columbia.edu> expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc, expand_generic_desc): Likewise. -1999-01-25 Martin von Löwis <loewis@informatik.hu-berlin.de> +1999-01-25 Martin von Löwis <loewis@informatik.hu-berlin.de> * tree.c (equal_functions): New function. (ovl_member): Call it. @@ -6567,7 +6567,7 @@ Sun Jan 31 20:34:29 1999 Zack Weinberg <zack@rabi.columbia.edu> * cvt.c (cp_convert_to_pointer): Fix conversion of 0 to pmf. -1999-01-25 Martin von Loewis <loewis@informatik.hu-berlin.de> +1999-01-25 Martin von Löwis <loewis@informatik.hu-berlin.de> * decl.c (decls_match): Return 1 if old and new are identical. (push_overloaded_decl): Set OVL_USED when PUSH_USING. diff --git a/gcc/cp/ChangeLog-2000 b/gcc/cp/ChangeLog-2000 index 4855669fd62..ff72fb68f66 100644 --- a/gcc/cp/ChangeLog-2000 +++ b/gcc/cp/ChangeLog-2000 @@ -2256,7 +2256,7 @@ * parse.y (member_init): Just pass in the type. * init.c (expand_member_init): Handle getting a type. -2000-07-04 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-07-04 Martin v. Löwis <loewis@informatik.hu-berlin.de> Jason Merrill <jason@redhat.com> * decl.c (finish_function): Warn if a function has no return @@ -2602,7 +2602,7 @@ * decl.c (pushdecl): Don't set DECL_CONTEXT from current_namespace. (push_namespace): Set DECL_CONTEXT for a new NAMESPACE_DECL. -2000-06-24 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-06-24 Martin v. Löwis <loewis@informatik.hu-berlin.de> * parse.y (complex_direct_notype_declarator): Support global_scope. * Makefile.in: Adjust conflict count. @@ -3787,7 +3787,7 @@ * semantics.c (finish_member_declaration): Don't mark members of classes declared in an extern "C" region as extern "C". -2000-05-22 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-05-22 Martin v. Löwis <loewis@informatik.hu-berlin.de> * decl2.c (qualified_lookup_using_namespace): Look through namespace aliases. @@ -4241,7 +4241,7 @@ * ir.texi: Correct typo. -2000-04-25 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-04-25 Martin v. Löwis <loewis@informatik.hu-berlin.de> * decl.c (grokdeclarator): Reject VLAs as members. @@ -4540,7 +4540,7 @@ (interface_only): Don't declare. (interface_unknown): Likewise. -2000-04-11 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-04-11 Martin v. Löwis <loewis@informatik.hu-berlin.de> * tree.h (HAVE_TEMPLATES): Remove definition. * lang-options.h (-fthis-is-variable): Remove documentation. @@ -4595,7 +4595,7 @@ (__pointer_to_member_type_info::__do_catch): Remove. (__pointer_to_member_type_info::__pointer_catch): Implement. -2000-04-10 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-04-10 Martin v. Löwis <loewis@informatik.hu-berlin.de> * lex.c (init_parse): Remove traces of classof and headof. * decl2.c (flag_operator_names): Default to 1. @@ -5308,7 +5308,7 @@ Wed Apr 5 15:12:18 MET DST 2000 Jan Hubicka <jh@suse.cz> * init.c (build_offset_ref): Handle the case of a templated member function. -2000-03-19 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-03-19 Martin v. Löwis <loewis@informatik.hu-berlin.de> * except.c (expand_exception_blocks): Clear catch_clauses_last. @@ -5334,7 +5334,7 @@ Wed Apr 5 15:12:18 MET DST 2000 Jan Hubicka <jh@suse.cz> (layout_class_type): Implement new ABI handling of bitfields longer than their types. -2000-03-18 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-03-18 Martin v. Löwis <loewis@informatik.hu-berlin.de> * parse.y (extdefs): Call ggc_collect. * parse.c: Regenerated. @@ -5785,7 +5785,7 @@ Wed Apr 5 15:12:18 MET DST 2000 Jan Hubicka <jh@suse.cz> * init.c (construct_virtual_bases): Fix thinko. * typeck.c (expand_ptrmemfunc_cst): Fix thinko. -2000-03-01 Martin von Loewis <loewis@informatik.hu-berlin.de> +2000-03-01 Martin von Löwis <loewis@informatik.hu-berlin.de> * decl.c (current_function_decl): Move to toplev.c. @@ -5944,7 +5944,7 @@ Wed Apr 5 15:12:18 MET DST 2000 Jan Hubicka <jh@suse.cz> * decl.c (decls_match): Remove obsolete static member nadgering. -2000-02-21 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-02-21 Martin v. Löwis <loewis@informatik.hu-berlin.de> * decl.c (grokdeclarator): Change ANSI to ISO. * lex.c (consume_string, readescape, do_identifier): Likewise. @@ -6088,7 +6088,7 @@ Wed Apr 5 15:12:18 MET DST 2000 Jan Hubicka <jh@suse.cz> * decl.c (redeclaration_error_message): Allow redeclaration of namespace-scope decls. -2000-02-18 Martin von Loewis <loewis@informatik.hu-berlin.de> +2000-02-18 Martin von Löwis <loewis@informatik.hu-berlin.de> * typeck2.c (my_friendly_abort): Use GCCBUGURL. @@ -6971,7 +6971,7 @@ Wed Apr 5 15:12:18 MET DST 2000 Jan Hubicka <jh@suse.cz> * optimize.c (copy_body_r): Clear the operand three of a TARGET_EXPR when copying it. -2000-01-14 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-01-14 Martin v. Löwis <loewis@informatik.hu-berlin.de> * method.c (build_decl_overload_real): Check whether we are in :: before returning __builtin_new/delete. @@ -7268,7 +7268,7 @@ Wed Apr 5 15:12:18 MET DST 2000 Jan Hubicka <jh@suse.cz> (fixup_vtable_deltas1): Likewise. (finish_struct_1): Likewise. -2000-01-01 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-01-01 Martin v. Löwis <loewis@informatik.hu-berlin.de> * call.c (build_new_method_call): Also check destructors. diff --git a/gcc/cp/ChangeLog-2005 b/gcc/cp/ChangeLog-2005 index 02f0b9d846f..ca81e26c80d 100644 --- a/gcc/cp/ChangeLog-2005 +++ b/gcc/cp/ChangeLog-2005 @@ -113,7 +113,7 @@ * mangle.c (write_bare_function_type): Mangle return type for methods of Java classes -2005-12-08 Th�dore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr> +2005-12-08 Théodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr> * call.c (build_conditional_expr): Print types in error messages. @@ -125,11 +125,11 @@ * cp-gimplify.c (gimplify_cp_loop): Use fold_build3. -2005-12-07 Rafael �ila de Esp�dola <rafael.espindola@gmail.com> +2005-12-07 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in (c++.all.build, c++.install-normal): Remove. -2005-12-07 Rafael �ila de Esp�dola <rafael.espindola@gmail.com> +2005-12-07 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in: Remove all dependencies on s-gtype. diff --git a/gcc/cp/ChangeLog-2006 b/gcc/cp/ChangeLog-2006 index bbdfbc2aaa2..0481bc3adb4 100644 --- a/gcc/cp/ChangeLog-2006 +++ b/gcc/cp/ChangeLog-2006 @@ -458,7 +458,7 @@ * typeck.c (build_binary_op): Duplicate warning message for better translation. -2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com> +2006-10-23 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * decl.c (builtin_function_1): Move common code to add_builtin_function. @@ -2846,7 +2846,7 @@ * decl.c (grok_op_properties): Check for ellipsis in arguments of operators. -2006-02-20 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> +2006-02-20 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in (C++): Remove. (.PHONY): Remove C++. @@ -3336,7 +3336,7 @@ (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. -2006-01-16 Rafael �ila de Esp�dola <rafael.espindola@gmail.com> +2006-01-16 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * g++spec.c (lang_specific_spec_functions): Remove. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 32907b243e4..3f6e3701127 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -20039,7 +20039,7 @@ cp_parser_omp_clause_name (cp_parser *parser) /* Validate that a clause of the given type does not already exist. */ static void -check_no_duplicate_clause (tree clauses, enum tree_code code, +check_no_duplicate_clause (tree clauses, enum omp_clause_code code, const char *name, location_t location) { tree c; diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index f9df932221f..912676393d0 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -877,6 +877,17 @@ cp_build_qualified_type_real (tree type, && TYPE_LANG_SPECIFIC (result) == TYPE_LANG_SPECIFIC (type)) TYPE_LANG_SPECIFIC (result) = NULL; + /* We may also have ended up building a new copy of the canonical + type of a pointer-to-method type, which could have the same + sharing problem described above. */ + if (TYPE_CANONICAL (result) != TYPE_CANONICAL (type) + && TREE_CODE (type) == POINTER_TYPE + && TREE_CODE (TREE_TYPE (type)) == METHOD_TYPE + && (TYPE_LANG_SPECIFIC (TYPE_CANONICAL (result)) + == TYPE_LANG_SPECIFIC (TYPE_CANONICAL (type)))) + TYPE_LANG_SPECIFIC (TYPE_CANONICAL (result)) = NULL; + + return result; } diff --git a/gcc/df-scan.c b/gcc/df-scan.c index 0ce48b5d1e0..7e6796b40e7 100644 --- a/gcc/df-scan.c +++ b/gcc/df-scan.c @@ -3681,6 +3681,9 @@ df_get_entry_block_def_set (bitmap entry_block_defs) #endif } + /* The always important stack pointer. */ + bitmap_set_bit (entry_block_defs, STACK_POINTER_REGNUM); + /* Once the prologue has been generated, all of these registers should just show up in the first regular block. */ if (HAVE_prologue && epilogue_completed) @@ -3693,9 +3696,6 @@ df_get_entry_block_def_set (bitmap entry_block_defs) } else { - /* The always important stack pointer. */ - bitmap_set_bit (entry_block_defs, STACK_POINTER_REGNUM); - /* If STATIC_CHAIN_INCOMING_REGNUM == STATIC_CHAIN_REGNUM only STATIC_CHAIN_REGNUM is defined. If they are different, we only care about the STATIC_CHAIN_INCOMING_REGNUM. */ diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 21debf74679..32ca1f0b3b0 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -6985,6 +6985,7 @@ instructions, but allow the compiler to schedule those calls. * MIPS DSP Built-in Functions:: * MIPS Paired-Single Support:: * MIPS Loongson Built-in Functions:: +* Other MIPS Built-in Functions:: * picoChip Built-in Functions:: * PowerPC AltiVec Built-in Functions:: * SPARC VIS Built-in Functions:: @@ -9440,6 +9441,18 @@ implementing assertions. @end table +@node Other MIPS Built-in Functions +@subsection Other MIPS Built-in Functions + +GCC provides other MIPS-specific built-in functions: + +@table @code +@item void __builtin_mips_cache (int @var{op}, const volatile void *@var{addr}) +Insert a @samp{cache} instruction with operands @var{op} and @var{addr}. +GCC defines the preprocessor macro @code{___GCC_HAVE_BUILTIN_MIPS_CACHE} +when this function is available. +@end table + @node PowerPC AltiVec Built-in Functions @subsection PowerPC AltiVec Built-in Functions diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index e3560c80138..b51a2405aaa 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -1582,6 +1582,13 @@ these options. This allows the compile-time linker to resolve dependencies when statically linking to libgcj. However it makes it impossible to override the affected portions of libgcj at run-time. +@item --enable-reduced-reflection +Build most of libgcj with @option{-freduced-reflection}. This reduces +the size of libgcj at the expense of not being able to do accurate +reflection on the classes it contains. This option is safe if you +know that code using libgcj will never use reflection on the standard +runtime classes in libgcj (including using serialization, RMI or CORBA). + @item --with-ecos Enable runtime eCos target support. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index f72f551c793..d08651a24c7 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -12813,6 +12813,73 @@ Work around certain SB-1 CPU core errata. (This flag currently works around the SB-1 revision 2 ``F1'' and ``F2'' floating point errata.) +@item -mr10k-cache-barrier=@var{setting} +@opindex mr10k-cache-barrier +Specify whether GCC should insert cache barriers to avoid the +side-effects of speculation on R10K processors. + +In common with many processors, the R10K tries to predict the outcome +of a conditional branch and speculatively executes instructions from +the ``taken'' branch. It later aborts these instructions if the +predicted outcome was wrong. However, on the R10K, even aborted +instructions can have side effects. + +This problem only affects kernel stores and, depending on the system, +kernel loads. As an example, a speculatively-executed store may load +the target memory into cache and mark the cache line as dirty, even if +the store itself is later aborted. If a DMA operation writes to the +same area of memory before the ``dirty'' line is flushed, the cached +data will overwrite the DMA-ed data. See the R10K processor manual +for a full description, including other potential problems. + +One workaround is to insert cache barrier instructions before every memory +access that might be speculatively executed and that might have side +effects even if aborted. @option{-mr10k-cache-barrier=@var{setting}} +controls GCC's implementation of this workaround. It assumes that +aborted accesses to any byte in the following regions will not have +side effects: + +@enumerate +@item +the memory occupied by the current function's stack frame; + +@item +the memory occupied by an incoming stack argument; + +@item +the memory occupied by an object with a link-time-constant address. +@end enumerate + +It is the kernel's responsibility to ensure that speculative +accesses to these regions are indeed safe. + +If the input program contains a function declaration such as: + +@smallexample +void foo (void); +@end smallexample + +then the implementation of @code{foo} must allow @code{j foo} and +@code{jal foo} to be executed speculatively. GCC honors this +restriction for functions it compiles itself. It expects non-GCC +functions (such as hand-written assembly code) to do the same. + +The option has three forms: + +@table @gcctabopt +@item -mr10k-cache-barrier=load-store +Insert a cache barrier before a load or store that might be +speculatively executed and that might have side effects even +if aborted. + +@item -mr10k-cache-barrier=store +Insert a cache barrier before a store that might be speculatively +executed and that might have side effects even if aborted. + +@item -mr10k-cache-barrier=none +Disable the insertion of cache barriers. This is the default setting. +@end table + @item -mflush-func=@var{func} @itemx -mno-flush-func @opindex mflush-func @@ -14802,6 +14869,33 @@ useful when compiling kernel code. A register range is specified as two registers separated by a dash. Multiple register ranges can be specified separated by a comma. +@item -mdual-nops +@itemx -mdual-nops=@var{n} +@opindex mdual-nops +By default, GCC will insert nops to increase dual issue when it expects +it to increase performance. @var{n} can be a value from 0 to 10. A +smaller @var{n} will insert fewer nops. 10 is the default, 0 is the +same as @option{-mno-dual-nops}. Disabled with @option{-Os}. + +@item -mhint-max-nops=@var{n} +@opindex mhint-max-nops +Maximum number of nops to insert for a branch hint. A branch hint must +be at least 8 instructions away from the branch it is effecting. GCC +will insert up to @var{n} nops to enforce this, otherwise it will not +generate the branch hint. + +@item -mhint-max-distance=@var{n} +@opindex mhint-max-distance +The encoding of the branch hint instruction limits the hint to be within +256 instructions of the branch it is effecting. By default, GCC makes +sure it is within 125. + +@item -msafe-hints +@opindex msafe-hints +Work around a hardware bug which causes the SPU to stall indefinitely. +By default, GCC will insert the @code{hbrp} instruction to make sure +this stall won't happen. + @end table @node System V Options diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index d27dfbf9ab2..eba39cde164 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -2830,10 +2830,10 @@ as below: The macro defines cover classes for the Integrated Register Allocator (@acronym{IRA}). Cover classes are a set of non-intersecting register classes covering all hard registers used for register allocation -purposes. Any move between two registers in the same cover class -should be cheaper than load or store of the registers. The macro -value should be the initializer for an array of register class values, -with @code{LIM_REG_CLASSES} used as the end marker. +purposes. If a move between two registers in the same cover class is +possible, it should be cheaper than a load or store of the registers. +The macro value should be the initializer for an array of register +class values, with @code{LIM_REG_CLASSES} used as the end marker. You must define this macro in order to use the integrated register allocator for the target. diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 9a887f6d6df..0efce7e2434 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -793,35 +793,29 @@ gen_lowpart_SUBREG (enum machine_mode mode, rtx reg) subreg_lowpart_offset (mode, inmode)); } -/* gen_rtvec (n, [rt1, ..., rtn]) -** -** This routine creates an rtvec and stores within it the -** pointers to rtx's which are its arguments. -*/ -/*VARARGS1*/ +/* Create an rtvec and stores within it the RTXen passed in the arguments. */ + rtvec gen_rtvec (int n, ...) { - int i, save_n; - rtx *vector; + int i; + rtvec rt_val; va_list p; va_start (p, n); + /* Don't allocate an empty rtvec... */ if (n == 0) - return NULL_RTVEC; /* Don't allocate an empty rtvec... */ + return NULL_RTVEC; - vector = XALLOCAVEC (rtx, n); + rt_val = rtvec_alloc (n); for (i = 0; i < n; i++) - vector[i] = va_arg (p, rtx); + rt_val->elem[i] = va_arg (p, rtx); - /* The definition of VA_* in K&R C causes `n' to go out of scope. */ - save_n = n; va_end (p); - - return gen_rtvec_v (save_n, vector); + return rt_val; } rtvec @@ -830,10 +824,11 @@ gen_rtvec_v (int n, rtx *argp) int i; rtvec rt_val; + /* Don't allocate an empty rtvec... */ if (n == 0) - return NULL_RTVEC; /* Don't allocate an empty rtvec... */ + return NULL_RTVEC; - rt_val = rtvec_alloc (n); /* Allocate an rtvec... */ + rt_val = rtvec_alloc (n); for (i = 0; i < n; i++) rt_val->elem[i] = *argp++; diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 561fb809314..7c4c522b2c4 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -7225,7 +7225,7 @@ native_encode_real (const_tree expr, unsigned char *ptr, int len) if (total_bytes > len) return 0; - words = 32 / UNITS_PER_WORD; + words = (32 / BITS_PER_UNIT) / UNITS_PER_WORD; real_to_target (tmp, TREE_REAL_CST_PTR (expr), TYPE_MODE (type)); @@ -7415,7 +7415,7 @@ native_interpret_real (tree type, const unsigned char *ptr, int len) total_bytes = GET_MODE_SIZE (TYPE_MODE (type)); if (total_bytes > len || total_bytes > 24) return NULL_TREE; - words = 32 / UNITS_PER_WORD; + words = (32 / BITS_PER_UNIT) / UNITS_PER_WORD; memset (tmp, 0, sizeof (tmp)); for (bitpos = 0; bitpos < total_bytes * BITS_PER_UNIT; diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 213af61193a..0e64d91652b 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,50 @@ +2008-09-06 Steven G. Kargl <kargls@comcast.net> + + PR fortran/36153 + * fortran/resolve.c (resolve_function): Shortcircuit for SIZE and + UBOUND if 2nd argument is KIND. + +2008-09-06 Steven G. Kargl <kargls@comcast.net> + + PR fortran/33229 + * resolve.c (resolve_function): An intrinsic subroutine should not be + called as a function. + +2008-09-05 Daniel Kraft <d@domob.eu> + + PR fortran/35837 + * resolve.c (resolve_types): Restore gfc_current_ns on exit. + * symbol.c (gfc_save_all): Removed blank line. + +2008-09-05 Daniel Kraft <d@domob.eu> + + PR fortran/36746 + * primary.c (gfc_match_rvalue): Removed logic to handle implicit + typing to a derived-type if a component reference is found. + (gfc_match_varspec): Moved it here. + +2008-09-04 Richard Guenther <rguenther@suse.de> + + * trans-array.c (gfc_conv_array_parameter): Use correct types + in building COND_EXPRs. + * trans-expr.c (gfc_conv_missing_dummy): Likewise. + * trans-intrinsics.c (gfc_conv_intrinsic_merge): Likewise. + +2008-09-04 Daniel Kraft <d@domob.eu> + + * PR fortran/37099 + * expr.c (simplify_const_ref): Update expression's character length + when pulling out a substring reference. + +2008-09-04 Ian Lance Taylor <iant@google.com> + + * symbol.c (generate_isocbinding_symbol): Compare + gfc_notification_std with ERROR rather than FAILURE. + * resolve.c (check_assumed_size_reference): Compare array type + with AR_FULL rather than DIMEN_ELEMENT. + (resolve_actual_arglist): Compare with EXPR_VARIABLE rather than + FL_VARIABLE. + 2008-09-01 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/37228 diff --git a/gcc/fortran/ChangeLog-2004 b/gcc/fortran/ChangeLog-2004 index 209ff5a88df..27b966a20f7 100644 --- a/gcc/fortran/ChangeLog-2004 +++ b/gcc/fortran/ChangeLog-2004 @@ -2169,7 +2169,7 @@ * symbol.c (gfc_add_common): Disable checks to work around other more fundamental inadequacies. -2004-05-22 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2004-05-22 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> * trans-decl.c (gfc_get_extern_function_decl): Set DECL_IS_PURE only for functions. @@ -2377,7 +2377,7 @@ * decl.c (variable_decl): Always apply default initializer. -2004-05-08 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2004-05-08 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/15206 * trans-intrinsic.c (gfc_conv_intrinsic_rrspacing): Fixed to @@ -2451,7 +2451,7 @@ Remove "set DEVELOPMENT". (Compiling GFORTRAN): Remove. -2004-05-09 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2004-05-09 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> * array.c (match_subscript, match_array_ref): Add comments explaining argument 'init'. @@ -2461,20 +2461,20 @@ * primary.c (match_digits, match_integer_constant): Add comment explaining signflag. -2004-05-01 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2004-05-01 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/13940 * primary.c: Include system.h and flags.h, needed for pedantic. (match_boz_constant): Allow "x" for hexadecimal constants, warn if pedantic is set. -2004-05-01 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2004-05-01 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/13940 * match.c (match_data_constant): Handle case where gfc_find_symbol sets sym to NULL -2004-04-28 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2004-04-28 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> * Make-lang.in (f95-lang.o, trans-intrinsic.o): Add missing dependency on mathbuiltins.def @@ -2488,7 +2488,7 @@ * gfortranspec.c: Do not include multilib.h. -2004-04-24 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2004-04-24 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> * trans-intrinsic.c: Fix comment, this is not trans-expr.c. Add 2004 to copyright years. diff --git a/gcc/fortran/ChangeLog-2005 b/gcc/fortran/ChangeLog-2005 index 2a0f26dfdbc..71fbf68cee7 100644 --- a/gcc/fortran/ChangeLog-2005 +++ b/gcc/fortran/ChangeLog-2005 @@ -21,7 +21,7 @@ PR fortran/25587 * trans-io.c (gfc_build_st_parameter): Correct off by one error. -2005-12-28 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> +2005-12-28 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in: Remove distdir from comment. @@ -399,11 +399,11 @@ as actual arguments to ASSOCIATED. Moved a misplaced comment. -2005-12-07 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> +2005-12-07 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in (fortran.all.build, fortran.install-normal): Remove. -2005-12-07 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> +2005-12-07 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in: Remove all dependencies on s-gtype, except for gt-fortran-trans.h. diff --git a/gcc/fortran/ChangeLog-2006 b/gcc/fortran/ChangeLog-2006 index de32f26fd6c..1a622ee0171 100644 --- a/gcc/fortran/ChangeLog-2006 +++ b/gcc/fortran/ChangeLog-2006 @@ -112,7 +112,7 @@ the nullifying of intent(out) arguments rather than the backend declaration. -2006-12-20 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-12-20 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/25392 * trans-stmt.c (gfc_trans_return): Fix comment formatting. @@ -215,7 +215,7 @@ function declarations to match the library changes. Mark allocation functions with DECL_IS_MALLOC. -2006-12-12 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-12-12 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> * trans-expr.c (gfc_conv_substring): Check for empty substring. @@ -669,7 +669,7 @@ * trans-expr.c (gfc_conv_expr_reference): Set TREE_STATIC on the new CONST_DECL. -2006-11-11 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-11-11 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> * array.c: Add 2006 to copyright years. * data.c: Same. @@ -969,7 +969,7 @@ * expr.c (simplify_parameter_variable): Keep rank of original expression. -2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com> +2006-10-23 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in (f951$(exeext)): Depend on and link with attribs.o. * trans.h (builtin_function): Rename to gfc_builtin_function. @@ -1566,7 +1566,7 @@ PR fortran/29097 * scanner.c (include_line): Handle conditional include. -2006-09-25 Tobias Schluter <tobias.schlueter@physik.uni-muenchen.de> +2006-09-25 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/21203 * error.c (show_loci): No need to risk an ICE to output a @@ -1599,7 +1599,7 @@ * iresolve.c (resolve_spread): Build shape for result if the source shape is available and dim and ncopies are constants. -2006-09-18 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-09-18 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/28817 PR fortran/21918 @@ -2121,7 +2121,7 @@ * intrinsic.texi: Document new intrinsics. -2006-07-01 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-07-01 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/19259 * parse.c (next_free): Error out on line starting with semicolon. @@ -2728,7 +2728,7 @@ * parse.c (next_statement): Add check to avoid an ICE when gfc_current_locus.lb is not set. -2006-05-07 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-05-07 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/27457 * match.c (match_case_eos): Error out on garbage following @@ -2749,7 +2749,7 @@ -fall-intrinsics is used. (gfc_handle_option): Permit -Wno-nonstd-intrinsics. -2006-05-04 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-05-04 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> * simplify.c (ascii_table): Fix wrong entry. @@ -3357,7 +3357,7 @@ * module.c (read_module): Remove redundant code lines. -2006-02-20 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> +2006-02-20 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in (FORTRAN): Remove (.PHONY): Remove F95 and f95. Add fortran @@ -3456,7 +3456,7 @@ PR fortran/26054 * options.c: Do not warn for Fortran 2003 features by default. -2006-02-15 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-02-15 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> * check.c: Update copyright years. @@ -3479,7 +3479,7 @@ to check dim argument. (check_reduction): Likewise. -2006-02-14 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-02-14 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/26277 * io.c (match_ltag): Mark label as referenced. @@ -3930,14 +3930,14 @@ are set. -2006-02-10 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-02-10 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/14771 * arith.c (eval_intrinsic): Accept INTRINSIC_PARENTHESES. * expr.c (check_intrinsic_op): Likewise. * module.c (mio_expr): Likewise. -2006-02-09 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-02-09 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> * dump-parse-tree.c: Update copyright years. * matchexp.c: Likewise. @@ -4319,7 +4319,7 @@ is_aliased_array and convert it to a temporary and back again using gfc_conv_aliased_arg. -2006-01-19 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-01-19 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> * gfortranspec.c: Update copyright years. * trans.c: Likewise. @@ -4330,7 +4330,7 @@ * trans-stmt.h: Likewise. * trans-types.c: Likewise. -2006-01-18 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-01-18 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/18540 PR fortran/18937 @@ -4375,7 +4375,7 @@ argument checking. Replace strcmp's with comparisons with generic codes. -2006-01-16 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> +2006-01-16 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * gfortranspec.c (lang_specific_spec_functions): Remove. @@ -4412,7 +4412,7 @@ * trans.c (gfc_add_expr_to_block): Do not fold tcc_statement nodes. -2006-01-11 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-01-11 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> * parse.c (next_fixed): Remove superfluous string concatenation. diff --git a/gcc/fortran/ChangeLog-2007 b/gcc/fortran/ChangeLog-2007 index 8b92ad1aa31..9c34c79ca02 100644 --- a/gcc/fortran/ChangeLog-2007 +++ b/gcc/fortran/ChangeLog-2007 @@ -870,7 +870,7 @@ (gfc_dep_resolver): Correct the logic for substrings so that overlapping arrays are handled correctly. -2007-10-28 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-28 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/32147 * module.c (write_symbol): Fix whitespace. @@ -985,7 +985,7 @@ namespaces and start search for symbol in current namespace. 2007-10-18 Paul Thomas <pault@gcc.gnu.org> - Dominique d'Humieres <dominiq@lps.ens.fr> + Dominique d'Humières <dominiq@lps.ens.fr> PR fortran/33733 * simplify.c (gfc_simplify_transfer): Return null if the source @@ -1028,7 +1028,7 @@ * resolve.c (check_dimension): Fix dimension-type switch; improve error message. -2007-10-13 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-13 Tobias Schlüter <tobi@gcc.gnu.org> Paul Thomas <pault@gcc.gnu.org> PR fortran/33254 @@ -1055,7 +1055,7 @@ PR fortran/33636 * expr.c (find_array_section): Check for constructor constantness. -2007-10-08 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-08 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/33689 * resolve.c (gfc_resolve_expr): Fix indentation. @@ -1069,7 +1069,7 @@ * mathbuiltins.def (GAMMA): Change function name to "tgamma" instad of "gamma". -2007-10-07 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-07 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/20851 * expr.c (check_inquiry): Typo fix in error message. @@ -1085,11 +1085,11 @@ * simplify.c (range_check): Return gfc_bad_expr if incoming expression is NULL. -2007-10-06 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-06 Tobias Schlüter <tobi@gcc.gnu.org> * simplify.c (gfc_simplify_size): Fix typo. -2007-10-06 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-06 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/25076 * resolve.c (gfc_find_forall_index): Move towards top, @@ -1148,7 +1148,7 @@ * gfortran.h (gfc_linebuf): Add dbg_emitted field. (gfc_define_undef_line): New prototype. -2007-10-04 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-04 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/33626 * resolve.c (resolve_operator): Always copy the type for @@ -1166,7 +1166,7 @@ * trans-decl.c (build_function_decl): Set "externally_visible" attribute on the MAIN program decl. -2007-10-03 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-03 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/33198 * resolve.c (has_default_initializer): Move to top. Make bool. @@ -1239,7 +1239,7 @@ * module.c (mio_expr): Avoid -Wcast-qual warning. -2007-09-27 Tobias Schlüter <tobi@gcc.gnu.org> +2007-09-27 Tobias Schlüter <tobi@gcc.gnu.org> * arith.c (reduce_binary_aa): Fix capitalization. * check.c (gfc_check_dot_product): Likewise. @@ -1264,7 +1264,7 @@ PR fortran/30780 * invoke.texi: Add note to -ffpe-trap option. Fix typos. -2007-09-23 Tobias Schlüter <tobi@gcc.gnu.org> +2007-09-23 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/33269 * io.c (check_format_string): Move NULL and constant checks into @@ -1373,7 +1373,7 @@ reduce_binary_aa): Call ourselves recursively if an element of the constructor is itself a constant array. -2007-09-20 Tobias Schlüter <tobi@gcc.gnu.org> +2007-09-20 Tobias Schlüter <tobi@gcc.gnu.org> * io.c (resolve_tag_format): New function using code split out and simplified from ... @@ -1663,7 +1663,7 @@ * match.c (gfc_match_strings): Delete unused function. * match.h (gfc_match_strings): Delete prototype. -2007-09-02 Tobias Schlüuter <tobi@gcc.gnu.org> +2007-09-02 Tobias Schlüter <tobi@gcc.gnu.org> * dump-parse-tree.c (show_char_const): New function. (gfc_show_expr): Use it. @@ -1879,7 +1879,7 @@ runtime error checking. 2007-08-22 Roger Sayle <roger@eyesopen.com> - Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> + Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> * match.c (intrinsic_operators): Delete. (gfc_match_intrinsic_op): Rewrite matcher to avoid calling @@ -2897,7 +2897,7 @@ dummy arguments, tell middle-end not to emit additional warnings. 2007-07-08 Daniel Franke <franke.daniel@gmail.com> - Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> + Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/17711 * gfortran.h (gfc_intrinsic_op): Added INTRINSIC_EQ_OS, @@ -3430,7 +3430,7 @@ the total offset to the field. * target-memory.h : Add prototype for gfc_merge_initializers. -2007-06-11 Rafael Avila de Espindola <espindola@google.com> +2007-06-11 Rafael Ãvila de EspÃndola <espindola@google.com> * trans-types.c (gfc_signed_type): Remove. * trans-types.h (gfc_signed_type): Remove. @@ -3839,7 +3839,7 @@ * trans-expr.c (gfc_conv_substring): Evaluate substring bounds only once. -2007-05-14 Rafael Avila de Espindola <espindola@google.com> +2007-05-14 Rafael Ãvila de EspÃndola <espindola@google.com> * f95-lang.c (LANG_HOOKS_UNSIGNED_TYPE): Remove. * trans-intrinsic.c (gfc_conv_intrinsic_ishft): Use unsigned_type_for @@ -4392,7 +4392,7 @@ * gfortran.texi: Add a section for the %VAL, %REF and %LOC extensions. -2007-03-30 Rafael Avila de Espindola <espindola@google.com> +2007-03-30 Rafael Ãvila de EspÃndola <espindola@google.com> * trans-types.c (gfc_signed_or_unsigned_type): Remove. (gfc_unsigned_type): Use get_signed_or_unsigned_type instead of diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index b5a17c0d5d8..6ff6d10c6af 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -1454,7 +1454,40 @@ simplify_const_ref (gfc_expr *p) for (; cons; cons = cons->next) { cons->expr->ref = gfc_copy_ref (p->ref->next); - simplify_const_ref (cons->expr); + if (simplify_const_ref (cons->expr) == FAILURE) + return FAILURE; + } + + /* If this is a CHARACTER array and we possibly took a + substring out of it, update the type-spec's character + length according to the first element (as all should have + the same length). */ + if (p->ts.type == BT_CHARACTER) + { + int string_len; + + gcc_assert (p->ref->next); + gcc_assert (!p->ref->next->next); + gcc_assert (p->ref->next->type == REF_SUBSTRING); + + if (p->value.constructor) + { + const gfc_expr* first = p->value.constructor->expr; + gcc_assert (first->expr_type == EXPR_CONSTANT); + gcc_assert (first->ts.type == BT_CHARACTER); + string_len = first->value.character.length; + } + else + string_len = 0; + + if (!p->ts.cl) + { + p->ts.cl = gfc_get_charlen (); + p->ts.cl->next = NULL; + p->ts.cl->length = NULL; + } + gfc_free_expr (p->ts.cl->length); + p->ts.cl->length = gfc_int_expr (string_len); } } gfc_free_ref_list (p->ref); diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 6689443200e..04c24eb7fe9 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -1745,6 +1745,10 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag) if (equiv_flag) return MATCH_YES; + if (sym->ts.type == BT_UNKNOWN && gfc_peek_ascii_char () == '%' + && gfc_get_default_type (sym, sym->ns)->type == BT_DERIVED) + gfc_set_default_type (sym, 0, sym->ns); + if (sym->ts.type != BT_DERIVED || gfc_match_char ('%') != MATCH_YES) goto check_substring; @@ -2434,10 +2438,6 @@ gfc_match_rvalue (gfc_expr **result) { case FL_VARIABLE: variable: - if (sym->ts.type == BT_UNKNOWN && gfc_peek_ascii_char () == '%' - && gfc_get_default_type (sym, sym->ns)->type == BT_DERIVED) - gfc_set_default_type (sym, 0, sym->ns); - e = gfc_get_expr (); e->expr_type = EXPR_VARIABLE; diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 61053c3463c..05f2c14f4b3 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -994,9 +994,11 @@ check_assumed_size_reference (gfc_symbol *sym, gfc_expr *e) if (need_full_assumed_size || !(sym->as && sym->as->type == AS_ASSUMED_SIZE)) return false; + /* FIXME: The comparison "e->ref->u.ar.type == AR_FULL" is wrong. + What should it be? */ if ((e->ref->u.ar.end[e->ref->u.ar.as->rank - 1] == NULL) && (e->ref->u.ar.as->type == AS_ASSUMED_SIZE) - && (e->ref->u.ar.type == DIMEN_ELEMENT)) + && (e->ref->u.ar.type == AR_FULL)) { gfc_error ("The upper bound in the last dimension must " "appear in the reference to the assumed size " @@ -1070,7 +1072,7 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype) continue; } - if (e->expr_type == FL_VARIABLE && e->symtree->ambiguous) + if (e->expr_type == EXPR_VARIABLE && e->symtree->ambiguous) { gfc_error ("'%s' at %L is ambiguous", e->symtree->n.sym->name, &e->where); @@ -1080,7 +1082,7 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype) if (e->ts.type != BT_PROCEDURE) { save_need_full_assumed_size = need_full_assumed_size; - if (e->expr_type != FL_VARIABLE) + if (e->expr_type != EXPR_VARIABLE) need_full_assumed_size = 0; if (gfc_resolve_expr (e) != SUCCESS) return FAILURE; @@ -1224,7 +1226,7 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype) is a variable instead, it needs to be resolved as it was not done at the beginning of this function. */ save_need_full_assumed_size = need_full_assumed_size; - if (e->expr_type != FL_VARIABLE) + if (e->expr_type != EXPR_VARIABLE) need_full_assumed_size = 0; if (gfc_resolve_expr (e) != SUCCESS) return FAILURE; @@ -2202,6 +2204,16 @@ resolve_function (gfc_expr *expr) if (expr->symtree) sym = expr->symtree->n.sym; + if (sym && sym->attr.intrinsic + && !gfc_find_function (sym->name) + && gfc_find_subroutine (sym->name) + && sym->attr.function) + { + gfc_error ("Intrinsic subroutine '%s' used as " + "a function at %L", sym->name, &expr->where); + return FAILURE; + } + if (sym && sym->attr.flavor == FL_VARIABLE) { gfc_error ("'%s' at %L is not a function", sym->name, &expr->where); @@ -2324,17 +2336,18 @@ resolve_function (gfc_expr *expr) assumed size array argument. UBOUND and SIZE have to be excluded from the check if the second argument is anything than a constant. */ - int inquiry; - inquiry = GENERIC_ID == GFC_ISYM_UBOUND - || GENERIC_ID == GFC_ISYM_SIZE; for (arg = expr->value.function.actual; arg; arg = arg->next) { - if (inquiry && arg->next != NULL && arg->next->expr) + if ((GENERIC_ID == GFC_ISYM_UBOUND || GENERIC_ID == GFC_ISYM_SIZE) + && arg->next != NULL && arg->next->expr) { if (arg->next->expr->expr_type != EXPR_CONSTANT) break; + if (arg->next->name && strncmp(arg->next->name, "kind", 4) == 0) + break; + if ((int)mpz_get_si (arg->next->expr->value.integer) < arg->expr->rank) break; @@ -10114,8 +10127,7 @@ resolve_types (gfc_namespace *ns) gfc_charlen *cl; gfc_data *d; gfc_equiv *eq; - - gfc_current_ns = ns; + gfc_namespace* old_ns = gfc_current_ns; /* Check that all IMPLICIT types are ok. */ if (!ns->seen_implicit_none) @@ -10129,6 +10141,8 @@ resolve_types (gfc_namespace *ns) return; } + gfc_current_ns = ns; + resolve_entries (ns); resolve_common_vars (ns->blank_common.head, false); @@ -10183,6 +10197,8 @@ resolve_types (gfc_namespace *ns) warn_unused_fortran_label (ns->st_labels); gfc_resolve_uops (ns->uop_root); + + gfc_current_ns = old_ns; } diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 7c8b7bc7f38..0b580794ea2 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -3194,7 +3194,6 @@ save_symbol (gfc_symbol *sym) void gfc_save_all (gfc_namespace *ns) { - gfc_traverse_ns (ns, save_symbol); } @@ -3922,7 +3921,7 @@ generate_isocbinding_symbol (const char *mod_name, iso_c_binding_symbol s, char comp_name[(GFC_MAX_SYMBOL_LEN * 2) + 1]; int index; - if (gfc_notification_std (std_for_isocbinding_symbol (s)) == FAILURE) + if (gfc_notification_std (std_for_isocbinding_symbol (s)) == ERROR) return; tmp_symtree = gfc_find_symtree (gfc_current_ns->sym_root, name); diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 2d574a3bc77..e0ebbf0e9b0 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -5250,8 +5250,9 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77, if (fsym && fsym->attr.optional && sym && sym->attr.optional) { tmp = gfc_conv_expr_present (sym); - ptr = build3 (COND_EXPR, TREE_TYPE (se->expr), tmp, ptr, - null_pointer_node); + ptr = build3 (COND_EXPR, TREE_TYPE (se->expr), tmp, + fold_convert (TREE_TYPE (se->expr), ptr), + fold_convert (TREE_TYPE (se->expr), null_pointer_node)); } ptr = gfc_evaluate_now (ptr, &se->pre); diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 8ebda494588..d253976af1b 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -161,7 +161,8 @@ gfc_conv_missing_dummy (gfc_se * se, gfc_expr * arg, gfc_typespec ts, int kind) tmp = fold_convert (tmp, build_fold_indirect_ref (se->expr)); /* Test for a NULL value. */ - tmp = build3 (COND_EXPR, TREE_TYPE (tmp), present, tmp, integer_one_node); + tmp = build3 (COND_EXPR, TREE_TYPE (tmp), present, tmp, + fold_convert (TREE_TYPE (tmp), integer_one_node)); tmp = gfc_evaluate_now (tmp, &se->pre); se->expr = build_fold_addr_expr (tmp); } diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index ecb568767ff..aa5ee45a00b 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -2918,7 +2918,8 @@ gfc_conv_intrinsic_merge (gfc_se * se, gfc_expr * expr) se->string_length = len; } type = TREE_TYPE (tsource); - se->expr = fold_build3 (COND_EXPR, type, mask, tsource, fsource); + se->expr = fold_build3 (COND_EXPR, type, mask, tsource, + fold_convert (type, fsource)); } diff --git a/gcc/function.c b/gcc/function.c index da26dc7d114..8f614b69ed6 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1515,6 +1515,7 @@ instantiate_virtual_regs_in_insn (rtx insn) } x = simplify_gen_subreg (recog_data.operand_mode[i], new_rtx, GET_MODE (new_rtx), SUBREG_BYTE (x)); + gcc_assert (x); break; default: diff --git a/gcc/gimple.c b/gcc/gimple.c index 7419d853dc0..9075b2e58e2 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -1085,7 +1085,7 @@ gimple_build_predict (enum br_predictor predictor, enum prediction outcome) { gimple p = gimple_alloc (GIMPLE_PREDICT, 0); /* Ensure all the predictors fit into the lower bits of the subcode. */ - gcc_assert (END_PREDICTORS <= GF_PREDICT_TAKEN); + gcc_assert ((int) END_PREDICTORS <= GF_PREDICT_TAKEN); gimple_predict_set_predictor (p, predictor); gimple_predict_set_outcome (p, outcome); return p; @@ -2066,7 +2066,7 @@ gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *gsi, enum tree_code code, tree gimple_get_lhs (const_gimple stmt) { - enum tree_code code = gimple_code (stmt); + enum gimple_code code = gimple_code (stmt); if (code == GIMPLE_ASSIGN) return gimple_assign_lhs (stmt); @@ -2083,7 +2083,7 @@ gimple_get_lhs (const_gimple stmt) void gimple_set_lhs (gimple stmt, tree lhs) { - enum tree_code code = gimple_code (stmt); + enum gimple_code code = gimple_code (stmt); if (code == GIMPLE_ASSIGN) gimple_assign_set_lhs (stmt, lhs); diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 2b5130c66b9..833e1552b31 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -4979,4 +4979,15 @@ sched_create_empty_bb_1 (basic_block after) return create_empty_bb (after); } +/* Insert PAT as an INSN into the schedule and update the necessary data + structures to account for it. */ +rtx +sched_emit_insn (rtx pat) +{ + rtx insn = emit_insn_after (pat, last_scheduled_insn); + last_scheduled_insn = insn; + haifa_init_insn (insn); + return insn; +} + #endif /* INSN_SCHEDULING */ diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 845fa2104c2..aef71a7511e 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -2289,7 +2289,7 @@ noce_process_if_block (struct noce_if_info *if_info) if (GET_MODE (x) == BLKmode) return FALSE; - if (GET_MODE (x) == ZERO_EXTRACT + if (GET_CODE (x) == ZERO_EXTRACT && (GET_CODE (XEXP (x, 1)) != CONST_INT || GET_CODE (XEXP (x, 2)) != CONST_INT)) return FALSE; diff --git a/gcc/ira-build.c b/gcc/ira-build.c index 4f2fb8f5396..b1f496c41df 100644 --- a/gcc/ira-build.c +++ b/gcc/ira-build.c @@ -310,7 +310,7 @@ form_loop_tree (void) ira_loop_nodes[i].children = NULL; ira_loop_nodes[i].subloops = NULL; } - FOR_EACH_BB_REVERSE (bb) + FOR_EACH_BB (bb) { bb_node = &ira_bb_nodes[bb->index]; bb_node->bb = bb; @@ -1097,6 +1097,40 @@ ira_add_allocno_copy (ira_allocno_t first, ira_allocno_t second, int freq, return cp; } +/* Print info about copy CP into file F. */ +static void +print_copy (FILE *f, ira_copy_t cp) +{ + fprintf (f, " cp%d:a%d(r%d)<->a%d(r%d)@%d\n", cp->num, + ALLOCNO_NUM (cp->first), ALLOCNO_REGNO (cp->first), + ALLOCNO_NUM (cp->second), ALLOCNO_REGNO (cp->second), cp->freq); +} + +/* Print info about copy CP into stderr. */ +void +ira_debug_copy (ira_copy_t cp) +{ + print_copy (stderr, cp); +} + +/* Print info about all copies into file F. */ +static void +print_copies (FILE *f) +{ + ira_copy_t cp; + ira_copy_iterator ci; + + FOR_EACH_COPY (cp, ci) + print_copy (f, cp); +} + +/* Print info about all copies into stderr. */ +void +ira_debug_copies (void) +{ + print_copies (stderr); +} + /* Print info about copies involving allocno A into file F. */ static void print_allocno_copies (FILE *f, ira_allocno_t a) @@ -1343,7 +1377,7 @@ create_bb_allocnos (ira_loop_tree_node_t bb_node) curr_bb = bb = bb_node->bb; ira_assert (bb != NULL); - FOR_BB_INSNS (bb, insn) + FOR_BB_INSNS_REVERSE (bb, insn) if (INSN_P (insn)) create_insn_allocnos (PATTERN (insn), false); /* It might be a allocno living through from one subloop to @@ -2409,6 +2443,8 @@ ira_build (bool loops_p) sort_conflict_id_allocno_map (); setup_min_max_conflict_allocno_ids (); ira_build_conflicts (); + if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL) + print_copies (ira_dump_file); if (internal_flag_ira_verbose > 0 && ira_dump_file != NULL) { int n, nr; diff --git a/gcc/ira-color.c b/gcc/ira-color.c index 8afc01078ee..833048e2541 100644 --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -1274,7 +1274,7 @@ setup_allocno_left_conflicts_num (ira_allocno_t allocno) AND_HARD_REG_SET (temp_set, reg_class_contents[cover_class]); AND_COMPL_HARD_REG_SET (temp_set, ira_no_alloc_regs); conflict_allocnos_size = 0; - if (! hard_reg_set_equal_p (temp_set, ira_zero_hard_reg_set)) + if (! hard_reg_set_empty_p (temp_set)) for (i = 0; i < (int) hard_regs_num; i++) { hard_regno = ira_class_hard_regs[cover_class][i]; @@ -1282,7 +1282,7 @@ setup_allocno_left_conflicts_num (ira_allocno_t allocno) { conflict_allocnos_size++; CLEAR_HARD_REG_BIT (temp_set, hard_regno); - if (hard_reg_set_equal_p (temp_set, ira_zero_hard_reg_set)) + if (hard_reg_set_empty_p (temp_set)) break; } } @@ -2985,17 +2985,13 @@ ira_fast_allocation (void) for (i = 0; i < num; i++) { a = sorted_allocnos[i]; - ALLOCNO_ASSIGNED_P (a) = true; - ALLOCNO_HARD_REGNO (a) = -1; - /* Live info about hard registers are absent when OPTIMIZE==0. - So try to assign hard-registers only to local allocnos. */ - if (!optimize && REG_BASIC_BLOCK (ALLOCNO_REGNO (a)) == REG_BLOCK_GLOBAL) - continue; COPY_HARD_REG_SET (conflict_hard_regs, ALLOCNO_CONFLICT_HARD_REGS (a)); for (r = ALLOCNO_LIVE_RANGES (a); r != NULL; r = r->next) for (j = r->start; j <= r->finish; j++) IOR_HARD_REG_SET (conflict_hard_regs, used_hard_regs[j]); cover_class = ALLOCNO_COVER_CLASS (a); + ALLOCNO_ASSIGNED_P (a) = true; + ALLOCNO_HARD_REGNO (a) = -1; if (hard_reg_set_subset_p (reg_class_contents[cover_class], conflict_hard_regs)) continue; diff --git a/gcc/ira-conflicts.c b/gcc/ira-conflicts.c index 97da7c563df..8b8c48582ea 100644 --- a/gcc/ira-conflicts.c +++ b/gcc/ira-conflicts.c @@ -371,8 +371,8 @@ process_regs_for_copy (rtx reg1, rtx reg2, rtx insn, int freq) cover_class = ALLOCNO_COVER_CLASS (a); if (! ira_class_subset_p[rclass][cover_class]) return false; - if (reg_class_size[rclass] <= (unsigned) CLASS_MAX_NREGS (rclass, mode) - && only_regs_p) + if (only_regs_p && insn != NULL_RTX + && reg_class_size[rclass] <= (unsigned) CLASS_MAX_NREGS (rclass, mode)) /* It is already taken into account in ira-costs.c. */ return false; index = ira_class_hard_reg_index[cover_class][hard_regno]; diff --git a/gcc/ira-int.h b/gcc/ira-int.h index 5f88e271a48..ccd65e6683f 100644 --- a/gcc/ira-int.h +++ b/gcc/ira-int.h @@ -702,10 +702,6 @@ ira_allocno_set_iter_next (ira_allocno_set_iterator *i) /* ira.c: */ -/* Hard regsets whose all bits are correspondingly zero or one. */ -extern HARD_REG_SET ira_zero_hard_reg_set; -extern HARD_REG_SET ira_one_hard_reg_set; - /* Map: hard regs X modes -> set of hard registers for storing value of given mode starting with given hard register. */ extern HARD_REG_SET ira_reg_mode_hard_regset @@ -838,6 +834,8 @@ extern rtx *ira_reg_equiv_const; extern ira_loop_tree_node_t ira_curr_loop_tree_node; extern ira_allocno_t *ira_curr_regno_allocno_map; +extern void ira_debug_copy (ira_copy_t); +extern void ira_debug_copies (void); extern void ira_debug_allocno_copies (ira_allocno_t); extern void ira_traverse_loop_tree (bool, ira_loop_tree_node_t, diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c index 7d6b29fedf1..a66bbf6698c 100644 --- a/gcc/ira-lives.c +++ b/gcc/ira-lives.c @@ -149,15 +149,6 @@ make_regno_dead (int regno) update_allocno_pressure_excess_length (a); } -/* Process the birth and, right after then, death of register - REGNO. */ -static void -make_regno_born_and_dead (int regno) -{ - make_regno_born (regno); - make_regno_dead (regno); -} - /* The current register pressures for each cover class for the current basic block. */ static int curr_reg_pressure[N_REG_CLASSES]; @@ -218,40 +209,21 @@ clear_allocno_live (ira_allocno_t a) sparseset_clear_bit (allocnos_live, ALLOCNO_NUM (a)); } -/* Record all regs that are set in any one insn. Communication from - mark_reg_{store,clobber}. */ -static VEC(rtx, heap) *regs_set; - -/* Handle the case where REG is set by the insn being scanned, during - the scan to build live ranges and calculate reg pressure info. +/* Mark the register referenced by use or def REF as live Store a 1 in hard_regs_live or allocnos_live for this register or the corresponding allocno, record how many consecutive hardware - registers it actually needs. - - Note that even if REG does not remain alive after this insn, we - must mark it here as live, to ensure a conflict between REG and any - other reg allocnos set in this insn that really do live. This is - because those other allocnos could be considered after this. + registers it actually needs. */ - REG might actually be something other than a register; if so, we do - nothing. - - SETTER is 0 if this register was modified by an auto-increment - (i.e., a REG_INC note was found for it). */ static void -mark_reg_store (rtx reg, const_rtx setter ATTRIBUTE_UNUSED, - void *data ATTRIBUTE_UNUSED) +mark_ref_live (struct df_ref *ref) { + rtx reg; int regno; + reg = DF_REF_REG (ref); if (GET_CODE (reg) == SUBREG) reg = SUBREG_REG (reg); - - if (! REG_P (reg)) - return; - - VEC_safe_push (rtx, heap, regs_set, reg); - + gcc_assert (REG_P (reg)); regno = REGNO (reg); if (regno >= FIRST_PSEUDO_REGISTER) @@ -297,55 +269,36 @@ mark_reg_store (rtx reg, const_rtx setter ATTRIBUTE_UNUSED, } } -/* Like mark_reg_store except notice just CLOBBERs; ignore SETs. */ -static void -mark_reg_clobber (rtx reg, const_rtx setter, void *data) +/* Return true if the definition described by DEF conflicts with the + instruction's inputs. */ +static bool +def_conflicts_with_inputs_p (struct df_ref *def) { - if (GET_CODE (setter) == CLOBBER) - mark_reg_store (reg, setter, data); + /* Conservatively assume that the condition is true for all clobbers. */ + return DF_REF_FLAGS_IS_SET (def, DF_REF_MUST_CLOBBER); } -/* Record that hard register REG (if it is a hard register) has - conflicts with all the allocno currently live or the corresponding - allocno lives at just the current program point. Do not mark REG - (or the allocno) itself as live. */ +/* Mark the register referenced by definition DEF as dead, if the + definition is a total one. Store a 0 in hard_regs_live or + allocnos_live for the register. */ static void -mark_reg_conflicts (rtx reg) +mark_ref_dead (struct df_ref *def) { + unsigned int i; + rtx reg; int regno; - if (GET_CODE (reg) == SUBREG) - reg = SUBREG_REG (reg); - - if (! REG_P (reg)) + if (DF_REF_FLAGS_IS_SET (def, DF_REF_PARTIAL) + || DF_REF_FLAGS_IS_SET (def, DF_REF_CONDITIONAL)) return; + reg = DF_REF_REG (def); + if (GET_CODE (reg) == SUBREG) + reg = SUBREG_REG (reg); + gcc_assert (REG_P (reg)); regno = REGNO (reg); if (regno >= FIRST_PSEUDO_REGISTER) - make_regno_born_and_dead (regno); - else if (! TEST_HARD_REG_BIT (ira_no_alloc_regs, regno)) - { - int last = regno + hard_regno_nregs[regno][GET_MODE (reg)]; - - while (regno < last) - { - make_regno_born_and_dead (regno); - regno++; - } - } -} - -/* Mark REG (or the corresponding allocno) as being dead (following - the insn being scanned now). Store a 0 in hard_regs_live or - allocnos_live for the register. */ -static void -mark_reg_death (rtx reg) -{ - unsigned int i; - int regno = REGNO (reg); - - if (regno >= FIRST_PSEUDO_REGISTER) { ira_allocno_t a = ira_curr_regno_allocno_map[regno]; @@ -618,14 +571,14 @@ process_single_reg_class_operands (bool in_p, int freq) static void process_bb_node_lives (ira_loop_tree_node_t loop_tree_node) { - int i; + int i, freq; unsigned int j; basic_block bb; rtx insn; edge e; edge_iterator ei; bitmap_iterator bi; - bitmap reg_live_in; + bitmap reg_live_out; unsigned int px; bb = loop_tree_node->bb; @@ -637,9 +590,9 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node) high_pressure_start_point[ira_reg_class_cover[i]] = -1; } curr_bb_node = loop_tree_node; - reg_live_in = DF_LR_IN (bb); + reg_live_out = DF_LR_OUT (bb); sparseset_clear (allocnos_live); - REG_SET_TO_HARD_REG_SET (hard_regs_live, reg_live_in); + REG_SET_TO_HARD_REG_SET (hard_regs_live, reg_live_out); AND_COMPL_HARD_REG_SET (hard_regs_live, eliminable_regset); AND_COMPL_HARD_REG_SET (hard_regs_live, ira_no_alloc_regs); for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) @@ -659,7 +612,7 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node) ira_assert (curr_reg_pressure[cover_class] <= ira_available_class_regs[cover_class]); } - EXECUTE_IF_SET_IN_BITMAP (reg_live_in, FIRST_PSEUDO_REGISTER, j, bi) + EXECUTE_IF_SET_IN_BITMAP (reg_live_out, FIRST_PSEUDO_REGISTER, j, bi) { ira_allocno_t a = ira_curr_regno_allocno_map[j]; @@ -670,96 +623,103 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node) make_regno_born (j); } -#ifdef EH_RETURN_DATA_REGNO - if (bb_has_eh_pred (bb)) - { - for (j = 0; ; ++j) - { - unsigned int regno = EH_RETURN_DATA_REGNO (j); - - if (regno == INVALID_REGNUM) - break; - make_regno_born_and_dead (regno); - } - } -#endif - - /* Allocnos can't go in stack regs at the start of a basic block - that is reached by an abnormal edge. Likewise for call - clobbered regs, because caller-save, fixup_abnormal_edges and - possibly the table driven EH machinery are not quite ready to - handle such allocnos live across such edges. */ - FOR_EACH_EDGE (e, ei, bb->preds) - if (e->flags & EDGE_ABNORMAL) - break; - - if (e != NULL) - { -#ifdef STACK_REGS - EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, px) - { - ALLOCNO_NO_STACK_REG_P (ira_allocnos[px]) = true; - ALLOCNO_TOTAL_NO_STACK_REG_P (ira_allocnos[px]) = true; - } - for (px = FIRST_STACK_REG; px <= LAST_STACK_REG; px++) - make_regno_born_and_dead (px); -#endif - /* No need to record conflicts for call clobbered regs if we - have nonlocal labels around, as we don't ever try to - allocate such regs in this case. */ - if (!cfun->has_nonlocal_label) - for (px = 0; px < FIRST_PSEUDO_REGISTER; px++) - if (call_used_regs[px]) - make_regno_born_and_dead (px); - } - + freq = REG_FREQ_FROM_BB (bb); + if (freq == 0) + freq = 1; + /* Scan the code of this basic block, noting which allocnos and - hard regs are born or die. */ - FOR_BB_INSNS (bb, insn) + hard regs are born or die. + + Note that this loop treats uninitialized values as live until + the beginning of the block. For example, if an instruction + uses (reg:DI foo), and only (subreg:SI (reg:DI foo) 0) is ever + set, FOO will remain live until the beginning of the block. + Likewise if FOO is not set at all. This is unnecessarily + pessimistic, but it probably doesn't matter much in practice. */ + FOR_BB_INSNS_REVERSE (bb, insn) { - rtx link; - int freq; + struct df_ref **def_rec, **use_rec; + bool call_p; if (! INSN_P (insn)) continue; - freq = REG_FREQ_FROM_BB (BLOCK_FOR_INSN (insn)); - if (freq == 0) - freq = 1; - if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL) fprintf (ira_dump_file, " Insn %u(l%d): point = %d\n", INSN_UID (insn), loop_tree_node->parent->loop->num, curr_point); - /* Check regs_set is an empty set. */ - gcc_assert (VEC_empty (rtx, regs_set)); - - /* Mark any allocnos clobbered by INSN as live, so they - conflict with the inputs. */ - note_stores (PATTERN (insn), mark_reg_clobber, NULL); + /* Mark each defined value as live. We need to do this for + unused values because they still conflict with quantities + that are live at the time of the definition. + + Ignore DF_REF_MAY_CLOBBERs on a call instruction. Such + references represent the effect of the called function + on a call-clobbered register. Marking the register as + live would stop us from allocating it to a call-crossing + allocno. */ + call_p = CALL_P (insn); + for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++) + if (!call_p || !DF_REF_FLAGS_IS_SET (*def_rec, DF_REF_MAY_CLOBBER)) + mark_ref_live (*def_rec); + + /* If INSN has multiple outputs, then any value used in one + of the outputs conflicts with the other outputs. Model this + by making the used value live during the output phase. + + It is unsafe to use !single_set here since it will ignore + an unused output. Just because an output is unused does + not mean the compiler can assume the side effect will not + occur. Consider if ALLOCNO appears in the address of an + output and we reload the output. If we allocate ALLOCNO + to the same hard register as an unused output we could + set the hard register before the output reload insn. */ + if (GET_CODE (PATTERN (insn)) == PARALLEL && multiple_sets (insn)) + for (use_rec = DF_INSN_USES (insn); *use_rec; use_rec++) + { + int i; + rtx reg; + + reg = DF_REF_REG (*use_rec); + for (i = XVECLEN (PATTERN (insn), 0) - 1; i >= 0; i--) + { + rtx set; + + set = XVECEXP (PATTERN (insn), 0, i); + if (GET_CODE (set) == SET + && reg_overlap_mentioned_p (reg, SET_DEST (set))) + { + /* After the previous loop, this is a no-op if + REG is contained within SET_DEST (SET). */ + mark_ref_live (*use_rec); + break; + } + } + } extract_insn (insn); - process_single_reg_class_operands (true, freq); - - /* Mark any allocnos dead after INSN as dead now. */ - for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) - if (REG_NOTE_KIND (link) == REG_DEAD) - mark_reg_death (XEXP (link, 0)); + process_single_reg_class_operands (false, freq); - curr_point++; + /* See which defined values die here. */ + for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++) + if (!call_p || !DF_REF_FLAGS_IS_SET (*def_rec, DF_REF_MAY_CLOBBER)) + mark_ref_dead (*def_rec); - if (CALL_P (insn)) + if (call_p) { + /* The current set of live allocnos are live across the call. */ EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, i) { ira_allocno_t a = ira_allocnos[i]; ALLOCNO_CALL_FREQ (a) += freq; ALLOCNO_CALLS_CROSSED_NUM (a)++; - /* Don't allocate allocnos that cross calls, if this - function receives a nonlocal goto. */ - if (cfun->has_nonlocal_label) + /* Don't allocate allocnos that cross setjmps or any + call, if this function receives a nonlocal + goto. */ + if (cfun->has_nonlocal_label + || find_reg_note (insn, REG_SETJMP, + NULL_RTX) != NULL_RTX) { SET_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a)); SET_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a)); @@ -767,67 +727,62 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node) } } - /* Mark any allocnos set in INSN as live. Clobbers are - processed again, so they will conflict with the reg - allocnos that are set. */ - note_stores (PATTERN (insn), mark_reg_store, NULL); - -#ifdef AUTO_INC_DEC - for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) - if (REG_NOTE_KIND (link) == REG_INC) - mark_reg_store (XEXP (link, 0), NULL_RTX, NULL); -#endif - - /* If INSN has multiple outputs, then any allocno that dies - here and is used inside of an output must conflict with - the other outputs. - - It is unsafe to use !single_set here since it will ignore - an unused output. Just because an output is unused does - not mean the compiler can assume the side effect will not - occur. Consider if ALLOCNO appears in the address of an - output and we reload the output. If we allocate ALLOCNO - to the same hard register as an unused output we could - set the hard register before the output reload insn. */ - if (GET_CODE (PATTERN (insn)) == PARALLEL && multiple_sets (insn)) - for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) - if (REG_NOTE_KIND (link) == REG_DEAD) - { - int i; - int used_in_output = 0; - rtx reg = XEXP (link, 0); - - for (i = XVECLEN (PATTERN (insn), 0) - 1; i >= 0; i--) - { - rtx set = XVECEXP (PATTERN (insn), 0, i); - - if (GET_CODE (set) == SET - && ! REG_P (SET_DEST (set)) - && ! rtx_equal_p (reg, SET_DEST (set)) - && reg_overlap_mentioned_p (reg, SET_DEST (set))) - used_in_output = 1; - } - if (used_in_output) - mark_reg_conflicts (reg); - } - - process_single_reg_class_operands (false, freq); + curr_point++; + + /* Mark each used value as live. */ + for (use_rec = DF_INSN_USES (insn); *use_rec; use_rec++) + mark_ref_live (*use_rec); + + /* If any defined values conflict with the inputs, mark those + defined values as live. */ + for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++) + if (def_conflicts_with_inputs_p (*def_rec)) + mark_ref_live (*def_rec); + + process_single_reg_class_operands (true, freq); - /* Mark any allocnos set in INSN and then never used. */ - while (! VEC_empty (rtx, regs_set)) - { - rtx reg = VEC_pop (rtx, regs_set); - rtx note = find_regno_note (insn, REG_UNUSED, REGNO (reg)); + /* See which of the defined values we marked as live are dead + before the instruction. */ + for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++) + if (def_conflicts_with_inputs_p (*def_rec)) + mark_ref_dead (*def_rec); - if (note) - mark_reg_death (XEXP (note, 0)); - } curr_point++; } + + /* Allocnos can't go in stack regs at the start of a basic block + that is reached by an abnormal edge. Likewise for call + clobbered regs, because caller-save, fixup_abnormal_edges and + possibly the table driven EH machinery are not quite ready to + handle such allocnos live across such edges. */ + FOR_EACH_EDGE (e, ei, bb->preds) + if (e->flags & EDGE_ABNORMAL) + break; + + if (e != NULL) + { +#ifdef STACK_REGS + EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, px) + { + ALLOCNO_NO_STACK_REG_P (ira_allocnos[px]) = true; + ALLOCNO_TOTAL_NO_STACK_REG_P (ira_allocnos[px]) = true; + } + for (px = FIRST_STACK_REG; px <= LAST_STACK_REG; px++) + make_regno_born (px); +#endif + /* No need to record conflicts for call clobbered regs if we + have nonlocal labels around, as we don't ever try to + allocate such regs in this case. */ + if (!cfun->has_nonlocal_label) + for (px = 0; px < FIRST_PSEUDO_REGISTER; px++) + if (call_used_regs[px]) + make_regno_born (px); + } + EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, i) - { - make_regno_dead (ALLOCNO_REGNO (ira_allocnos[i])); - } + { + make_regno_dead (ALLOCNO_REGNO (ira_allocnos[i])); + } curr_point++; @@ -944,9 +899,6 @@ void ira_create_allocno_live_ranges (void) { allocnos_live = sparseset_alloc (ira_allocnos_num); - /* Make a vector that mark_reg_{store,clobber} will store in. */ - if (!regs_set) - regs_set = VEC_alloc (rtx, heap, 10); curr_point = 0; ira_traverse_loop_tree (true, ira_loop_tree_root, NULL, process_bb_node_lives); diff --git a/gcc/ira.c b/gcc/ira.c index 5170769e2a3..dfaf34fa4aa 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -670,7 +670,7 @@ setup_reg_subclasses (void) COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[i]); AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs); - if (hard_reg_set_equal_p (temp_hard_regset, ira_zero_hard_reg_set)) + if (hard_reg_set_empty_p (temp_hard_regset)) continue; for (j = 0; j < N_REG_CLASSES; j++) if (i != j) @@ -734,7 +734,7 @@ setup_cover_and_important_classes (void) gcc_unreachable (); COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl]); AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs); - if (! hard_reg_set_equal_p (temp_hard_regset, ira_zero_hard_reg_set)) + if (! hard_reg_set_empty_p (temp_hard_regset)) ira_reg_class_cover[ira_reg_class_cover_size++] = cl; } ira_important_classes_num = 0; @@ -742,7 +742,7 @@ setup_cover_and_important_classes (void) { COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl]); AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs); - if (! hard_reg_set_equal_p (temp_hard_regset, ira_zero_hard_reg_set)) + if (! hard_reg_set_empty_p (temp_hard_regset)) for (j = 0; j < ira_reg_class_cover_size; j++) { COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl]); @@ -794,8 +794,7 @@ setup_class_translate (void) { COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl]); AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs); - if (! hard_reg_set_subset_p (temp_hard_regset, - ira_zero_hard_reg_set)) + if (! hard_reg_set_empty_p (temp_hard_regset)) gcc_unreachable (); } #endif @@ -818,7 +817,7 @@ setup_class_translate (void) reg_class_contents[cover_class]); AND_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl]); AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs); - if (! hard_reg_set_equal_p (temp_hard_regset, ira_zero_hard_reg_set)) + if (! hard_reg_set_empty_p (temp_hard_regset)) { min_cost = INT_MAX; for (mode = 0; mode < MAX_MACHINE_MODE; mode++) @@ -875,8 +874,8 @@ setup_reg_class_intersect_union (void) AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs); COPY_HARD_REG_SET (temp_set2, reg_class_contents[cl2]); AND_COMPL_HARD_REG_SET (temp_set2, no_unit_alloc_regs); - if (hard_reg_set_equal_p (temp_hard_regset, ira_zero_hard_reg_set) - && hard_reg_set_equal_p (temp_set2, ira_zero_hard_reg_set)) + if (hard_reg_set_empty_p (temp_hard_regset) + && hard_reg_set_empty_p (temp_set2)) { for (i = 0;; i++) { @@ -1081,10 +1080,6 @@ ira_init_register_move_cost (enum machine_mode mode) -/* Hard regsets whose all bits are correspondingly zero or one. */ -HARD_REG_SET ira_zero_hard_reg_set; -HARD_REG_SET ira_one_hard_reg_set; - /* This is called once during compiler work. It sets up different arrays whose values don't depend on the compiled function. */ @@ -1093,8 +1088,6 @@ ira_init_once (void) { enum machine_mode mode; - CLEAR_HARD_REG_SET (ira_zero_hard_reg_set); - SET_HARD_REG_SET (ira_one_hard_reg_set); for (mode = 0; mode < MAX_MACHINE_MODE; mode++) { ira_register_move_cost[mode] = NULL; diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 6178327d369..f80688f0d21 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,7 @@ +2008-09-05 David Daney <ddaney@avtrex.com> + + * gcj.texi (-freduced-reflection): Clarify option's restrictions. + 2008-08-21 David Daney <ddaney@avtrex.com> * class.c (make_class_data): Don't add field_index when @@ -634,7 +638,7 @@ NEGATIVE and then a POINTER_PLUS_EXPR instead of a MINUS_EXPR. -2007-06-11 Rafael Avila de Espindola <espindola@google.com> +2007-06-11 Rafael Ãvila de EspÃndola <espindola@google.com> * typeck.c (java_signed_type): Remove. * lang.c (LANG_HOOKS_SIGNED_TYPE): Remove. @@ -645,7 +649,7 @@ * jcf-dump.c (HANDLE_MAGIC): Use 'unsigned long' for %lx. (print_constant): Likewise. -2007-05-14 Rafael Avila de Espindola <espindola@google.com> +2007-05-14 Rafael Ãvila de EspÃndola <espindola@google.com> * expr.c (build_java_binop): Use unsigned_type_for instead of java_unsigned_type. @@ -680,7 +684,7 @@ * jcf-parse.c (give_name_to_class): Don't set input_location from DECL_ARTIFICIAL decls. -2007-03-30 Rafael Avila de Espindola <espindola@google.com> +2007-03-30 Rafael Ãvila de EspÃndola <espindola@google.com> * typeck.c (java_signed_or_unsigned_type): Removed. (java_signed_type): use get_signed_or_unsigned_type instead of @@ -1560,7 +1564,7 @@ * jcf-path.c (jcf_path_compute): New function. * jcf.h (jcf_path_compute): Declare. -2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com> +2006-10-23 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * decl.c: Include langhooks.h. (builtin_function): Remove. @@ -2027,7 +2031,7 @@ * jv-scan.c (version), jcf-dump.c (version), gjavah.c (version): Update copyright notice dates. -2006-01-16 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> +2006-01-16 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * jvspec.c (lang_specific_spec_functions): Remove. @@ -2080,11 +2084,11 @@ * expr.c (build_field_ref): Add in-line check for missing field. * decl.c (java_init_decl_processing): Add soft_nosuchfield_node. -2005-12-07 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> +2005-12-07 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in (java.all.build, java.install-normal): Remove. -2005-12-07 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> +2005-12-07 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in: Remove all dependencies on s-gtype, except for gt-java-parse.h. @@ -13016,7 +13020,7 @@ properly initialize `finished_label'. Don't emit gotos for empty try statements. -2000-03-19 Martin v. Loewis <loewis@informatik.hu-berlin.de> +2000-03-19 Martin v. Löwis <loewis@informatik.hu-berlin.de> * except.c (emit_handlers): Clear catch_clauses_last. @@ -13294,7 +13298,7 @@ (build_current_thisn): Likewise. (patch_method_invocation): Likewise. -2000-03-01 Martin von Loewis <loewis@informatik.hu-berlin.de> +2000-03-01 Martin von Löwis <loewis@informatik.hu-berlin.de> * decl.c (current_function_decl): Move to toplev.c. @@ -13391,7 +13395,7 @@ (expand_java_return): Handle the case of a native integer smaller than a JVM integer. -2000-02-18 Martin von Loewis <loewis@informatik.hu-berlin.de> +2000-02-18 Martin von Löwis <loewis@informatik.hu-berlin.de> * gjavah.c (help): Use GCCBUGURL. * jv-scan.c (help): Likewise. diff --git a/gcc/java/gcj.texi b/gcc/java/gcj.texi index af5b06615b0..00ac9f7dee0 100644 --- a/gcc/java/gcj.texi +++ b/gcc/java/gcj.texi @@ -557,9 +557,10 @@ the ability to use certain reflection capabilities of the standard Java runtime environment. When set all meta-data except for that which is needed to obtain correct runtime semantics is eliminated. -For code that does not use reflection (i.e. the methods in the -@code{java.lang.reflect} package), @code{-freduced-reflection} -will result in proper operation with a savings in executable code size. +For code that does not use reflection (i.e. serialization, RMI, CORBA +or call methods in the @code{java.lang.reflect} package), +@code{-freduced-reflection} will result in proper operation with a +savings in executable code size. JNI (@code{-fjni}) and the binary compatibility ABI (@code{-findirect-dispatch}) do not work properly without full diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 8eea3dbfd67..e4f952d8475 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -42,7 +42,7 @@ PR objc++/36723 * objc-act.c (objc_build_constructor): Update C++ tweak. -2007-07-14 Rafael Avila de Espindola <espindola@google.com> +2007-07-14 Rafael Ãvila de EspÃndola <espindola@google.com> * objc-act.c (synth_module_prologue): Use TREE_NO_WARNING instead of DECL_IN_SYSTEM_HEADER. @@ -175,7 +175,7 @@ * objc-act.c (objc_finish_file): Remove ifdef clause for OBJCPLUS and content where we called cp_finish_file. -2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com> +2006-10-23 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * objc-act.c (synth_module_prologue): Replace calls to builtin_function with add_builtin_function. @@ -228,7 +228,7 @@ module descriptor. (gen_type_name_0): Fix ICE when issuing warning. -2006-02-20 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> +2006-02-20 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in (OBJC): Remove (OBJECTIVE-C): Remove (objective-c): Remove @@ -245,11 +245,11 @@ PR objc/25348 * objc-act.c (encode_array): Handle arrays to zero sized types. -2005-12-07 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> +2005-12-07 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in (objc.all.build, objc.install-normal): Remove. -2005-12-07 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> +2005-12-07 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in: Remove all dependencies on s-gtype. diff --git a/gcc/objcp/ChangeLog b/gcc/objcp/ChangeLog index 5a7f73e58d0..e8bf0d6ccfa 100644 --- a/gcc/objcp/ChangeLog +++ b/gcc/objcp/ChangeLog @@ -50,7 +50,7 @@ * Make-lang.in: Add dummy lang.install-pdf target. -2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com> +2006-10-23 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * objcp-decl.h (objcp_builtin_function): Remove. @@ -82,7 +82,7 @@ * Make-lang.in (objcp/objcp-decl.o): Add dependency on $(TARGET_H). -2006-02-20 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> +2006-02-20 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in (OBJ-C++): Remove (.PHONY): Remove Obj-c++ and obj-C++. Add obj-c++ @@ -91,11 +91,11 @@ * Make-lang.in (objcp/objcp-decl.o): Add depends on $(EXPR_H). -2005-12-07 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> +2005-12-07 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in (obj-c++.all.build, obj-c++.install-normal): Remove. -2005-12-07 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> +2005-12-07 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> * Make-lang.in: Remove all dependencies on s-gtype. diff --git a/gcc/omp-low.c b/gcc/omp-low.c index d6c5500319a..7d32f21781f 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -164,7 +164,7 @@ static tree maybe_lookup_decl_in_outer_ctx (tree, omp_context *); /* Find an OpenMP clause of type KIND within CLAUSES. */ tree -find_omp_clause (tree clauses, enum tree_code kind) +find_omp_clause (tree clauses, enum omp_clause_code kind) { for (; clauses ; clauses = OMP_CLAUSE_CHAIN (clauses)) if (OMP_CLAUSE_CODE (clauses) == kind) diff --git a/gcc/opts.c b/gcc/opts.c index 9bae6ea8349..591094d6182 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -1008,21 +1008,32 @@ decode_options (unsigned int argc, const char **argv) handle_options (argc, argv, lang_mask); - /* -fno-unit-at-a-time and -fno-toplevel-reorder handling. */ + /* Handle related options for unit-at-a-time, toplevel-reorder, and + section-anchors. */ if (!flag_unit_at_a_time) { + if (flag_section_anchors == 1) + error ("Section anchors must be disabled when unit-at-a-time " + "is disabled."); flag_section_anchors = 0; + if (flag_toplevel_reorder == 1) + error ("Toplevel reorder must be disabled when unit-at-a-time " + "is disabled."); flag_toplevel_reorder = 0; } - else if (!optimize && flag_toplevel_reorder == 2) - /* We disable toplevel reordering at -O0 to disable transformations that - might be surprising to end users and to get -fno-toplevel-reorder - tested, but we keep section anchors. */ - flag_toplevel_reorder = 0; - else if (!flag_toplevel_reorder) + /* Unless the user has asked for section anchors, we disable toplevel + reordering at -O0 to disable transformations that might be surprising + to end users and to get -fno-toplevel-reorder tested. */ + if (!optimize && flag_toplevel_reorder == 2 && flag_section_anchors != 1) + { + flag_toplevel_reorder = 0; + flag_section_anchors = 0; + } + if (!flag_toplevel_reorder) { if (flag_section_anchors == 1) - error ("section anchors must be disabled when toplevel reorder is disabled"); + error ("section anchors must be disabled when toplevel reorder" + " is disabled"); flag_section_anchors = 0; } diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog index 23f72f3fd9f..c2c2d653805 100644 --- a/gcc/po/ChangeLog +++ b/gcc/po/ChangeLog @@ -700,11 +700,11 @@ * exgettext: Merge changes from diffutils. Scan .def files in addition to .c and .h. Add --language=c to xgettext command line. -2001-12-05 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2001-12-05 Martin v. Löwis <loewis@informatik.hu-berlin.de> * es.po: Update to 3.0 template. -2001-12-05 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2001-12-05 Martin v. Löwis <loewis@informatik.hu-berlin.de> * da.po, es.po, fr.po, ja.po: New files. diff --git a/gcc/regrename.c b/gcc/regrename.c index 0ed810e6393..bd2373cbb5a 100644 --- a/gcc/regrename.c +++ b/gcc/regrename.c @@ -89,7 +89,7 @@ static void scan_rtx (rtx, rtx *, enum reg_class, enum scan_actions, static struct du_chain *build_def_use (basic_block); static void dump_def_use_chain (struct du_chain *); static void note_sets (rtx, const_rtx, void *); -static void clear_dead_regs (HARD_REG_SET *, enum machine_mode, rtx); +static void clear_dead_regs (HARD_REG_SET *, enum reg_note, rtx); static void merge_overlapping_regs (basic_block, HARD_REG_SET *, struct du_chain *); @@ -114,7 +114,7 @@ note_sets (rtx x, const_rtx set ATTRIBUTE_UNUSED, void *data) in the list NOTES. */ static void -clear_dead_regs (HARD_REG_SET *pset, enum machine_mode kind, rtx notes) +clear_dead_regs (HARD_REG_SET *pset, enum reg_note kind, rtx notes) { rtx note; for (note = notes; note; note = XEXP (note, 1)) @@ -1990,4 +1990,3 @@ struct rtl_opt_pass pass_cprop_hardreg = TODO_dump_func | TODO_verify_rtl_sharing /* todo_flags_finish */ } }; - diff --git a/gcc/reload1.c b/gcc/reload1.c index f9d924c779b..1ea41091260 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -2709,7 +2709,7 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn, /* If this is a REG_DEAD note, it is not valid anymore. Using the eliminated version could result in creating a REG_DEAD note for the stack or frame pointer. */ - if (GET_MODE (x) == REG_DEAD) + if (REG_NOTE_KIND (x) == REG_DEAD) return (XEXP (x, 1) ? eliminate_regs_1 (XEXP (x, 1), mem_mode, insn, true) : NULL_RTX); diff --git a/gcc/rtl.h b/gcc/rtl.h index 4b04d286927..5d2e793e2dc 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -1246,8 +1246,7 @@ do { \ /* Likewise in an expr_list for a REG_LABEL_OPERAND or REG_LABEL_TARGET note. */ #define LABEL_REF_NONLOCAL_P(RTX) \ - (RTL_FLAG_CHECK3("LABEL_REF_NONLOCAL_P", (RTX), LABEL_REF, \ - REG_LABEL_OPERAND, REG_LABEL_TARGET)->volatil) + (RTL_FLAG_CHECK1("LABEL_REF_NONLOCAL_P", (RTX), LABEL_REF)->volatil) /* 1 if RTX is a code_label that should always be considered to be needed. */ #define LABEL_PRESERVE_P(RTX) \ diff --git a/gcc/sched-int.h b/gcc/sched-int.h index d358650e8fe..7fd3b5526a2 100644 --- a/gcc/sched-int.h +++ b/gcc/sched-int.h @@ -1147,6 +1147,7 @@ extern void unlink_bb_notes (basic_block, basic_block); extern void add_block (basic_block, basic_block); extern rtx bb_note (basic_block); extern void concat_note_lists (rtx, rtx *); +extern rtx sched_emit_insn (rtx); /* Types and functions in sched-rgn.c. */ diff --git a/gcc/see.c b/gcc/see.c index a465d529e30..55b37bf7c2a 100644 --- a/gcc/see.c +++ b/gcc/see.c @@ -712,13 +712,13 @@ see_get_extension_reg (rtx extension, bool return_dest_reg) Otherwise, set SOURCE_MODE to be the mode of the extended expr and return the rtx code of the extension. */ -static enum rtx_code +static enum entry_type see_get_extension_data (rtx extension, enum machine_mode *source_mode) { rtx rhs, lhs, set; if (!extension || !INSN_P (extension)) - return UNKNOWN; + return NOT_RELEVANT; /* Parallel pattern for extension not supported for the moment. */ if (GET_CODE (PATTERN (extension)) == PARALLEL) @@ -733,21 +733,21 @@ see_get_extension_data (rtx extension, enum machine_mode *source_mode) /* Don't handle extensions to something other then register or subregister. */ if (!REG_P (lhs) && GET_CODE (lhs) != SUBREG) - return UNKNOWN; + return NOT_RELEVANT; if (GET_CODE (rhs) != SIGN_EXTEND && GET_CODE (rhs) != ZERO_EXTEND) - return UNKNOWN; + return NOT_RELEVANT; if (!REG_P (XEXP (rhs, 0)) && !(GET_CODE (XEXP (rhs, 0)) == SUBREG && REG_P (SUBREG_REG (XEXP (rhs, 0))))) - return UNKNOWN; + return NOT_RELEVANT; *source_mode = GET_MODE (XEXP (rhs, 0)); if (GET_CODE (rhs) == SIGN_EXTEND) - return SIGN_EXTEND; - return ZERO_EXTEND; + return SIGN_EXTENDED_DEF; + return ZERO_EXTENDED_DEF; } @@ -760,7 +760,7 @@ see_get_extension_data (rtx extension, enum machine_mode *source_mode) Otherwise, return the generated instruction. */ static rtx -see_gen_normalized_extension (rtx reg, enum rtx_code extension_code, +see_gen_normalized_extension (rtx reg, enum entry_type extension_code, enum machine_mode mode) { rtx subreg, insn; @@ -768,11 +768,12 @@ see_gen_normalized_extension (rtx reg, enum rtx_code extension_code, if (!reg || !REG_P (reg) - || (extension_code != SIGN_EXTEND && extension_code != ZERO_EXTEND)) + || (extension_code != SIGN_EXTENDED_DEF + && extension_code != ZERO_EXTENDED_DEF)) return NULL; subreg = gen_lowpart_SUBREG (mode, reg); - if (extension_code == SIGN_EXTEND) + if (extension_code == SIGN_EXTENDED_DEF) extension = gen_rtx_SIGN_EXTEND (GET_MODE (reg), subreg); else extension = gen_rtx_ZERO_EXTEND (GET_MODE (reg), subreg); @@ -1019,14 +1020,14 @@ see_seek_pre_extension_expr (rtx extension, enum extension_type type) { struct see_pre_extension_expr **slot_pre_exp, temp_pre_exp; rtx dest_extension_reg = see_get_extension_reg (extension, 1); - enum rtx_code extension_code; + enum entry_type extension_code; enum machine_mode source_extension_mode; if (type == DEF_EXTENSION) { extension_code = see_get_extension_data (extension, &source_extension_mode); - gcc_assert (extension_code != UNKNOWN); + gcc_assert (extension_code != NOT_RELEVANT); extension = see_gen_normalized_extension (dest_extension_reg, extension_code, source_extension_mode); @@ -2807,7 +2808,7 @@ see_merge_one_def_extension (void **slot, void *b) rtx simplified_temp_extension = NULL; rtx *pat; enum rtx_code code; - enum rtx_code extension_code; + enum entry_type extension_code; enum machine_mode source_extension_mode; enum machine_mode source_mode = VOIDmode; enum machine_mode dest_extension_mode; @@ -2866,7 +2867,7 @@ see_merge_one_def_extension (void **slot, void *b) { rtx orig_src = SET_SRC (*sub); - if (extension_code == SIGN_EXTEND) + if (extension_code == SIGN_EXTENDED_DEF) temp_extension = gen_rtx_SIGN_EXTEND (dest_extension_mode, orig_src); else @@ -2898,7 +2899,7 @@ see_merge_one_def_extension (void **slot, void *b) { rtx orig_src = SET_SRC (*pat); - if (extension_code == SIGN_EXTEND) + if (extension_code == SIGN_EXTENDED_DEF) temp_extension = gen_rtx_SIGN_EXTEND (dest_extension_mode, orig_src); else temp_extension = gen_rtx_ZERO_EXTEND (dest_extension_mode, orig_src); @@ -3245,7 +3246,7 @@ see_handle_relevant_defs (struct df_ref *ref, rtx insn) { struct web_entry *root_entry = NULL; rtx se_insn = NULL; - enum rtx_code extension_code; + enum entry_type extension_code; rtx reg = DF_REF_REAL_REG (ref); rtx ref_insn = NULL; unsigned int i = DF_REF_ID (ref); @@ -3274,9 +3275,9 @@ see_handle_relevant_defs (struct df_ref *ref, rtx insn) { if (ENTRY_EI (root_entry)->relevancy == SIGN_EXTENDED_DEF) - extension_code = SIGN_EXTEND; + extension_code = SIGN_EXTENDED_DEF; else - extension_code = ZERO_EXTEND; + extension_code = ZERO_EXTENDED_DEF; se_insn = see_gen_normalized_extension (reg, extension_code, @@ -3314,7 +3315,7 @@ see_handle_relevant_uses (struct df_ref *ref, rtx insn) { struct web_entry *root_entry = NULL; rtx se_insn = NULL; - enum rtx_code extension_code; + enum entry_type extension_code; rtx reg = DF_REF_REAL_REG (ref); root_entry = unionfind_root (&use_entry[DF_REF_ID (ref)]); @@ -3333,9 +3334,9 @@ see_handle_relevant_uses (struct df_ref *ref, rtx insn) /* Generate the use extension. */ if (ENTRY_EI (root_entry)->relevancy == SIGN_EXTENDED_DEF) - extension_code = SIGN_EXTEND; + extension_code = SIGN_EXTENDED_DEF; else - extension_code = ZERO_EXTEND; + extension_code = ZERO_EXTENDED_DEF; se_insn = see_gen_normalized_extension (reg, extension_code, @@ -3468,7 +3469,7 @@ static enum entry_type see_analyze_one_def (rtx insn, enum machine_mode *source_mode, enum machine_mode *source_mode_unsigned) { - enum rtx_code extension_code; + enum entry_type extension_code; rtx rhs = NULL; rtx lhs = NULL; rtx set = NULL; @@ -3487,8 +3488,8 @@ see_analyze_one_def (rtx insn, enum machine_mode *source_mode, extension_code = see_get_extension_data (insn, source_mode); switch (extension_code) { - case SIGN_EXTEND: - case ZERO_EXTEND: + case SIGN_EXTENDED_DEF: + case ZERO_EXTENDED_DEF: source_register = see_get_extension_reg (insn, 0); /* FIXME: This restriction can be relaxed. The only thing that is important is that the reference would be inside the same basic block @@ -3521,12 +3522,9 @@ see_analyze_one_def (rtx insn, enum machine_mode *source_mode, return NOT_RELEVANT; } - if (extension_code == SIGN_EXTEND) - return SIGN_EXTENDED_DEF; - else - return ZERO_EXTENDED_DEF; + return extension_code; - case UNKNOWN: + case NOT_RELEVANT: /* This may still be an EXTENDED_DEF. */ /* FIXME: This restriction can be relaxed. It is possible to handle @@ -3894,4 +3892,3 @@ struct rtl_opt_pass pass_see = TODO_dump_func /* todo_flags_finish */ } }; - diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 29a4002c2b7..aaeb46c1464 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,96 @@ +2008-09-06 Tobias Burnus <burnus@net-b.de> + + PR fortran/36153 + * gfortran.dg/size_kind.f90: New test. + +2008-09-06 Steven G. Kargl <kargls@comcast.net> + + PR fortran/33229 + * gfortran.dg/intrinsic_subroutine.f90: New test. + +2008-09-06 Richard Sandiford <rdsandiford@googlemail.com> + + * gcc.target/mips/mips.exp (dg-mips-options): Make + -mr10k-cache-barrier=* imply -mips3 or above. + * gcc.target/mips/cache-1.c: New test. + * gcc.target/mips/r10k-cache-barrier-1.c: Likewise. + * gcc.target/mips/r10k-cache-barrier-2.c: Likewise. + * gcc.target/mips/r10k-cache-barrier-3.c: Likewise. + * gcc.target/mips/r10k-cache-barrier-4.c: Likewise. + * gcc.target/mips/r10k-cache-barrier-5.c: Likewise. + * gcc.target/mips/r10k-cache-barrier-6.c: Likewise. + * gcc.target/mips/r10k-cache-barrier-7.c: Likewise. + * gcc.target/mips/r10k-cache-barrier-8.c: Likewise. + * gcc.target/mips/r10k-cache-barrier-9.c: Likewise. + * gcc.target/mips/r10k-cache-barrier-10.c: Likewise. + * gcc.target/mips/r10k-cache-barrier-11.c: Likewise. + * gcc.target/mips/r10k-cache-barrier-12.c: Likewise. + * gcc.target/mips/r10k-cache-barrier-13.c: Likewise. + * gcc.target/mips/r10k-cache-barrier-14.c: Likewise. + * gcc.target/mips/r10k-cache-barrier-15.c: Likewise. + +2008-09-05 Daniel Kraft <d@domob.eu> + + PR fortran/35837 + * gfortran.dg/save_3.f90: New test. + +2008-09-05 Douglas Gregor <doug.gregor@gmail.com> + + PR c++/37342 + * g++.dg/other/canon-37342.C: New. + +2008-09-05 Joseph Myers <joseph@codesourcery.com> + + * gcc.c-torture/compile/20080903-1.c: New test. + +2008-09-05 Daniel Kraft <d@domob.eu> + + PR fortran/36746 + * gfortran.dg/implicit_derived_type_1.f90: New test. + * gfortran.dg/used_before_typed_5.f90: New test. + +2008-09-04 Jan Hubicka <jh@suse.cz> + + * gcc.target/i386/cold-attribute-1.c: Update testcase. + +2008-09-04 Ian Lance Taylor <iant@google.com> + + * g++.dg/init/const7.C: New test. + +2008-09-04 Adam Nemet <anemet@caviumnetworks.com> + + * gcc.target/mips/seq-1.c: New test. + * gcc.target/mips/octeon-seq-1.c: New test. + * gcc.target/mips/octeon-seq-2.c: New test. + * gcc.target/mips/octeon-seq-3.c: New test. + * gcc.target/mips/octeon-seq-4.c: New test. + * gcc.target/mips/scc-2.c: Also pass on sltiu. + * gcc.target/mips/scc-3.c: Likewise. + +2008-09-04 Adam Nemet <anemet@caviumnetworks.com> + + * gcc.target/mips/truncate-2.c: New test. + * gcc.target/mips/octeon-exts-1.c: New test. + * gcc.target/mips/octeon-exts-2.c: New test. + * gcc.target/mips/octeon-exts-3.c: New test. + * gcc.target/mips/octeon-exts-4.c: New test. + +2008-09-04 Adam Nemet <anemet@caviumnetworks.com> + + * gcc.target/mips/octeon-cins-1.c: New test. + * gcc.target/mips/octeon-cins-2.c: New test. + +2008-09-04 Richard Guenther <rguenther@suse.de> + + * gfortran.dg/internal_pack_4.f90: Adjust pattern. + +2008-09-04 Daniel Kraft <d@domob.eu> + + PR fortran/37099 + * gfortran.dg/string_compare_1.f90: New text. + * gfortran.dg/string_compare_2.f90: New text. + * gfortran.dg/string_compare_3.f90: New text. + 2008-09-04 H.J. Lu <hongjiu.lu@intel.com> PR rtl-optimization/37243 @@ -130,7 +223,7 @@ 2008-09-02 Victor Kaplansky <victork@il.ibm.com> * gcc.dg/fastmath-2.c: New. - + 2008-09-02 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/37095 @@ -1716,7 +1809,7 @@ * gfortran.dg/cshift_char_3.f90: New test case. * gfortran.dg/cshift_nan_1.f90: New test case. -2008-08-14 Rafael Avila de Espindola <espindola@google.com> +2008-08-14 Rafael Ãvila de EspÃndola <espindola@google.com> * gcc.dg/visibility-14.c: New test. * gcc.dg/visibility-15.c: New test. @@ -2438,7 +2531,7 @@ PR tree-optimization/36967 * gfortran.dg/pr36967.f: New testcase. -2008-07-30 Rafael Avila de Espindola <espindola@google.com> +2008-07-30 Rafael Ãvila de EspÃndola <espindola@google.com> * gcc.dg/visibility-14.c: New test. * gcc.dg/visibility-15.c: New test. @@ -4132,7 +4225,7 @@ dg-additional-sources. (profopt-execute): Handle additional sources. -2008-05-28 Rafael Espindola <espindola@google.com> +2008-05-28 Rafael EspÃndola <espindola@google.com> * gcc.dg/20080528-1.c: New test. @@ -4269,7 +4362,7 @@ * g++.dg/template/inline1.C: For the not-defined symbol, use the pattern from g++.dg/template/qualttp17.C. -2008-05-23 Rafael Espindola <espindola@google.com> +2008-05-23 Rafael EspÃndola <espindola@google.com> * gcc.c-torture/compile/20080522-1.c: Move to gcc.dg. * gcc.dg/20080522-1.c: Moved from gcc.c-torture. @@ -4307,7 +4400,7 @@ * gfortran.dg/cshift_large_1.f90: New test. * gfortran.dg/eoshift_large_1.f90: New test. -2008-05-22 Rafael Espindola <espindola@google.com> +2008-05-22 Rafael EspÃndola <espindola@google.com> * gcc.c-torture/compile/20080522-1.c: New testcase. @@ -5072,7 +5165,7 @@ PR fortran/36162 * gfortran.dg/module_widestring_1.f90: New test. -2008-05-08 Rafael Espindola <espindola@google.com> +2008-05-08 Rafael EspÃndola <espindola@google.com> * gcc.dg/vect/vect-111.c: Rename to no-trapping-math-vect-111.c * gcc.dg/vect/vect-ifcvt-11.c: Rename to no-trapping-math-vect-ifcvt-11.c @@ -6011,7 +6104,7 @@ PR fortran/35780 * gfortran.dg/simplify_argN_1.f90: New test. -2008-04-06 Tobias Schl�ter <tobi@gcc.gnu.org> +2008-04-06 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/35832 * gfortran.dg/io_constraints_2.f90: Adapt to new error message. @@ -7772,7 +7865,7 @@ * g++.dg/torture/pr35164-1.C: New testcase. * g++.dg/torture/pr35164-2.C: Likewise. -2008-02-15 Dominique d'Humieres <dominiq@lps.ens.fr> +2008-02-15 Dominique d'Humières <dominiq@lps.ens.fr> PR testsuite/35119 * g++.dg/template/spec35.C: Change the regular expressions diff --git a/gcc/testsuite/ChangeLog-1993-2007 b/gcc/testsuite/ChangeLog-1993-2007 index 2447b7f8593..158f0f78e9d 100644 --- a/gcc/testsuite/ChangeLog-1993-2007 +++ b/gcc/testsuite/ChangeLog-1993-2007 @@ -1794,7 +1794,7 @@ * gcc.dg/vect/vect-ifcvt-16.c: Likewise. * gcc.dg/vect/vect-ifcvt-17.c: Likewise. -2007-10-31 Dominique d'Humieres <dominiq@lps.ens.fr> +2007-10-31 Dominique d'Humières <dominiq@lps.ens.fr> Tobias Burnus <burnus@net-b.de> PR fortran/33941 @@ -2010,7 +2010,7 @@ PR c++/30659 * g++.dg/template/crash71.C: New. -2007-10-28 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-28 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/32147 * gfortran.dg/module_md5_1.f90: Update hash-value. @@ -2469,7 +2469,7 @@ * gfortran.dg/bounds_check_10.f90: Fix testcase. -2007-10-13 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-13 Tobias Schlüter <tobi@gcc.gnu.org> Paul Thomas <pault@gcc.gnu.org> PR fortran/33254 @@ -2611,7 +2611,7 @@ PR tree-optimization/33572 * g++.dg/torture/pr33572.C: Replace with complete test. -2007-10-08 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-08 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/33689 * gfortran.dg/spec_expr_5.f90: New. @@ -2643,7 +2643,7 @@ PR libfortran/33683 * gfortran.dg/gamma_5.f90: New test case -2007-10-07 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-07 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/20851 * initialization_1.f90: Fix dg-error annotations. @@ -2680,7 +2680,7 @@ PR tree-optimization/33572 * g++.dg/torture/pr33572.C: New. -2007-10-06 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-06 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/25076 * gfortran.dg/forall_11.f90: New. @@ -2740,7 +2740,7 @@ PR tree-optimization/33627 * g++.dg/torture/pr33627.C: New testcase. -2007-10-04 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-04 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/33626 * gfortran.dg/parens_6.f90: New. @@ -2780,7 +2780,7 @@ * gfortran.dg/default_format_1.f90: XFAIL on ppc-darwin. * gfortran.dg/default_format_2.f90: XFAIL on ppc-darwin. -2007-10-03 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-03 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/33198 * gfortran.dg/common_errors_1.f90: New. @@ -2901,7 +2901,7 @@ * gcc.target/i386/sse5-convert.c: Fix target selector and rename to... * gcc.target/i386/pr33524.c: ...this. -2007-09-28 Tobias Schlüter <tobi@gcc.gnu.org> +2007-09-28 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/33354 * gfortran.dg/minmaxloc_4.f90: New. @@ -2943,7 +2943,7 @@ PR middle-end/7003 * gcc.target/powerpc/gcse-1.c: New test. -2007-09-27 Tobias Schlüter <tobi@gcc.gnu.org> +2007-09-27 Tobias Schlüter <tobi@gcc.gnu.org> * gfortran.dg/array_initializer_3.f90: Adapt error annotations for fixed capitalizations. @@ -3045,7 +3045,7 @@ PR c++/14688 * g++.dg/inherit/override_attribs.C: New file. -2007-09-23 Tobias Schlüter <tobi@gcc.gnu.org> +2007-09-23 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/33269 * io.c (check_format_string): Move NULL and constant checks into @@ -3471,7 +3471,7 @@ * gcc.dg/sibcall-4.c: As for gcc.dg/sibcall-3.c. * gcc.dg/tree-ssa/ssa-fre-3.c: Require !mips64. -2007-09-20 Tobias Schlüter <tobi@gcc.gnu.org> +2007-09-20 Tobias Schlüter <tobi@gcc.gnu.org> * gfortran.dg/g77/19981216-0.f: Remove dg-warning annotation. * gfortran.dg/io_constraints_1.f90: Make a -std=f95 test. Add @@ -4644,7 +4644,7 @@ * gcc.target/cris/builtin_clz_v0.c: New testcase. * gcc.target/cris/builtin_clz_v3.c: New testcase. -2007-09-02 Tobias Schlüuter <tobi@gcc.gnu.org> +2007-09-02 Tobias Schlüter <tobi@gcc.gnu.org> * gfortran.dg/substr_6.f90: New test. @@ -4851,7 +4851,7 @@ PR c++/32596 * g++.dg/ext/visibility/anon5.C: New test. -2007-08-28 Dominique d'Humieres <dominiq@lps.ens.fr> +2007-08-28 Dominique d'Humières <dominiq@lps.ens.fr> * gfortran.dg/gamma_4.f90: Fix large-real kind selection. @@ -6115,7 +6115,7 @@ * gcc.dg/torture/pr30364-2.c (f)(main): Likewise. * gcc.dg/torture/pr30364-3.c (f)(main): Likewise. -2007-07-27 Dominique d'Humieres <dominiq@lps.ens.fr> +2007-07-27 Dominique d'Humières <dominiq@lps.ens.fr> * gfortran.dg/operator_3.f90: Fix dg directive. * gfortran.dg/min_max_conformance.f90: Fix dg directive. @@ -6308,7 +6308,7 @@ PR fortran/30814 * gfortran.dg/pack_bounds_1.f90: New test case. -2007-07-23 Daniel Franke <franke.daniel@gmail.com> +2007-07-23 Daniel Franke <franke.daniel@gmail.com> PR fortran/31639 * gfortran.dg/initialization_9.f90: New test. @@ -6861,7 +6861,7 @@ * gcc.target/m68k/interrupt_thread-2.c: Likewise. * gcc.target/m68k/interrupt_thread-3.c: Likewise. -2007-07-12 Daniel Franke <franke.daniel@gmail.com> +2007-07-12 Daniel Franke <franke.daniel@gmail.com> PR fortran/31639 * gfortran.dg/func_decl_4.f90: New test. @@ -8393,7 +8393,7 @@ * gcc.dg/tree-ssa/prefetch-6.c: New test. -2007-05-29 Tobias Schlüter <tobi@gcc.gnu.org> +2007-05-29 Tobias Schlüter <tobi@gcc.gnu.org> * gfortran.dg/sizeof.f90: New. @@ -9098,7 +9098,7 @@ * transfer_simplify_1.f90: New test. * transfer_simplify_2.f90: New test. -2007-05-15 Dominique d'Humieres <dominiq@lps.ens.fr> +2007-05-15 Dominique d'Humières <dominiq@lps.ens.fr> * gfortran.dg/unf_io_convert_3.f90: Fix dg directive. @@ -9131,7 +9131,7 @@ gcc.target/m68k/interrupt_thread-3.c: New. * gcc.target/m68k/m68k.exp: Accept fido. -2007-05-13 Dominique d'Humieres <dominiq@lps.ens.fr> +2007-05-13 Dominique d'Humières <dominiq@lps.ens.fr> * gfortran.dg/alloc_comp_basics_1.f90: Fix dg directive. * gfortran.dg/altreturn_3.f90: Likewise. @@ -9226,7 +9226,7 @@ PR tree-optimization/31885 * gcc.dg/tree-ssa/loop-29.c: New test. -2007-05-10 Dominique d'Humières <dominiq@lps.ens.fr> +2007-05-10 Dominique d'Humières <dominiq@lps.ens.fr> * assumed_dummy_1.f90: Fix dg directive. * char_initialiser_actual.f90: Likewise. @@ -9900,7 +9900,7 @@ * gcc.dg/cpp/_Pragma6.c: Skip on fido-*-* and m68k-*-*. -2007-04-17 Tobias Schlüter <tobi@gcc.gnu.org> +2007-04-17 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/31144 * gfortran.dg/module_naming_1.f90: New. @@ -10003,7 +10003,7 @@ PR fortran/31550 * gfortran.dg/used_types_16.f90: New test. -2007-04-13 Tobias Schlüter <tobi@gcc.gnu.org> +2007-04-13 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/18937 * gfortran.dg/goto_2.f90: New. @@ -10033,7 +10033,7 @@ * gfortran.dg/c_by_val.c: Use GCC extensions instead of including <complex.h>. -2007-04-12 Tobias Schlüter <tobi@gcc.gnu.org> +2007-04-12 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/31250 * gfortran.dg/char_length_2.f90: New. @@ -10601,7 +10601,7 @@ PR fortran/31193 * gfortran.dg/transfer_array_intrinsic_3.f90: New test. -2007-03-22 Tobias Schlüter <tobi@gcc.gnu.org> +2007-03-22 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/20897 * gfortran.dg/derived_name_1.f90: New. @@ -11765,7 +11765,7 @@ * gcc.target/ia64/builtin-popcount-1.c: New test case. * gcc.target/ia64/builtin-popcount-2.c: Likewise. -2007-02-11 Tobias Schlüter <tobi@gcc.gnu.org> +2007-02-11 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/30478 * gfortran.dg/enum_4.f90: Update error message checks. @@ -13019,7 +13019,7 @@ PR target/29248 * gcc.dg/rs6000-leaf.c: New. -2006-12-20 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-12-20 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/25392 * gfortran.dg/f2c_8.f90: New test. @@ -13342,7 +13342,7 @@ * gcc.c-torture/compile/vector-2.c: New test. * gcc.c-torture/compile/vector-3.c: New test. -2006-12-12 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-12-12 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> * lib/fortran-torture.exp: Update copyright years. Remove obsolete comment. Test -ftree-vectorize where it makes sense. @@ -17138,7 +17138,7 @@ * gnat.dg/string_slice.adb: New test. -2006-07-01 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-07-01 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/19259 * gfortran.dg/semicolon_fixed.c: New. @@ -18417,7 +18417,7 @@ PR tree-optimization/27409 * gcc.dg/torture/pr27409.c: New testcase. -2006-05-07 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-05-07 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/27457 * gfortran.dg/select_6.f90: New. @@ -19966,7 +19966,7 @@ PR fortran/25045 * optional_dim.f90: New test. -2006-02-14 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-02-14 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/26277 * gfortran.dg/label_4.f90: New. @@ -20056,7 +20056,7 @@ gfortran.dg/null_1.f90: New test. -2006-02-10 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-02-10 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/14771 * gfortran.dg/parens_4.f90: New. @@ -20066,7 +20066,7 @@ * gcc.dg/pr23372-1.c: Remove empty file. -2006-02-09 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-02-09 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> Paul Thomas <pault@gcc.gnu.org> PR fortran/14771 @@ -20160,7 +20160,7 @@ * gcc.dg/gomp/critical-3.c: Call cleanup-tree-dump. * gcc.dg/tree-ssa/pr23382.c: Ditto. -2006-02-07 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-02-07 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/25577 * gfortran.dg/mvbits_1.f90: New. @@ -20580,7 +20580,7 @@ * gcc.target/i386/20060125-1.c: New test case. * gcc.target/i386/20060125-2.c: New test case. -2006-01-25 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-01-25 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/18540 * gfortran.dg/goto_1.f: New. @@ -56925,7 +56925,7 @@ Thu Apr 27 15:58:18 MET DST 2000 Jan Hubicka <jh@suse.cz> * gcc.c-torture/compile/labels-2.c: New test. -1999-12-27 Martin von L�is <loewis@informatik.hu-berlin.de> +1999-12-27 Martin von Löwis <loewis@informatik.hu-berlin.de> * gcc.c-torture/execute/991227-1.c: New test. @@ -56933,7 +56933,7 @@ Thu Apr 27 15:58:18 MET DST 2000 Jan Hubicka <jh@suse.cz> * g++.old-deja/g++.pt/instantiate6.C: Remove excess errors XFAIL. -1999-12-21 Martin von L�is <loewis@informatik.hu-berlin.de> +1999-12-21 Martin von Löwis <loewis@informatik.hu-berlin.de> * gcc.c-torture/execute/991221-1.c: New test. @@ -58515,7 +58515,7 @@ Thu Apr 27 15:58:18 MET DST 2000 Jan Hubicka <jh@suse.cz> * g77.f-torture/execute/970816-3.f: New test from Craig. -1998-07-10 Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de> +1998-07-10 Martin von Löwis <martin@mira.isdn.cs.tu-berlin.de> * g++.other/singleton.C: Return error value instead of taking SIGSEGV. @@ -58525,7 +58525,7 @@ Thu Apr 27 15:58:18 MET DST 2000 Jan Hubicka <jh@suse.cz> * g++.other/singleton.C: New test. Warning is under dispute. Runtime crash is not. -1998-07-09 Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de> +1998-07-09 Martin von Löwis <martin@mira.isdn.cs.tu-berlin.de> * g++.ns/{alias2.C, alias5.C, koenig4.C, lookup3.C ns13.C, ns14.C, ns15.C, template3.C, undef1.C, using4.C, using5.C, diff --git a/gcc/testsuite/g++.dg/init/const7.C b/gcc/testsuite/g++.dg/init/const7.C new file mode 100644 index 00000000000..18d04625db2 --- /dev/null +++ b/gcc/testsuite/g++.dg/init/const7.C @@ -0,0 +1,13 @@ +// { dg-do compile } +// { dg-options "-fdump-tree-gimple" } + +struct s { int x, y; }; +short offsets[1] = { + ((char*) &(((struct s*)16)->y) - (char *)16), +}; + +// This ensures that we get a dump whether or not the bug is present. +void fn() { } + +// { dg-final { scan-tree-dump-not "initialization" "gimple" } } +// { dg-final { cleanup-tree-dump "gimple" } } diff --git a/gcc/testsuite/g++.dg/other/canon-37342.C b/gcc/testsuite/g++.dg/other/canon-37342.C new file mode 100644 index 00000000000..dd96e40ebd2 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/canon-37342.C @@ -0,0 +1,8 @@ +class Asm; +template<typename _CharT> class basic_ostream; +typedef basic_ostream<char> ostream; +class Options { + typedef void (Asm::* emitfunc_t) (ostream &); + emitfunc_t getemit () const { return emitfunc; } + emitfunc_t emitfunc; +}; diff --git a/gcc/testsuite/gcc.c-torture/compile/20080903-1.c b/gcc/testsuite/gcc.c-torture/compile/20080903-1.c new file mode 100644 index 00000000000..180b926bf3d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20080903-1.c @@ -0,0 +1,12 @@ +struct bar { unsigned short length; }; + +int +dummy(void) +{ + char c[4096]; + struct bar *a; + struct bar *b; + + a->length = ((char *) b - c); + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/cold-attribute-1.c b/gcc/testsuite/gcc.target/i386/cold-attribute-1.c index 22615b38790..db81ee837ad 100644 --- a/gcc/testsuite/gcc.target/i386/cold-attribute-1.c +++ b/gcc/testsuite/gcc.target/i386/cold-attribute-1.c @@ -10,7 +10,7 @@ my_cold_memset (void *a, int b,int c) t(void *a,int b,int c) { if (a) - my_cold_memset (a,b,c); + my_cold_memset (a,b,40); } /* The IF conditional should be predicted as cold and my_cold_memset inlined diff --git a/gcc/testsuite/gcc.target/mips/cache-1.c b/gcc/testsuite/gcc.target/mips/cache-1.c new file mode 100644 index 00000000000..40c22e08cdc --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/cache-1.c @@ -0,0 +1,30 @@ +/* { dg-mips-options "-O2" } */ + +void +f1 (int *area) +{ + __builtin_mips_cache (20, area); +} + +void +f2 (const short *area) +{ + __builtin_mips_cache (24, area + 10); +} + +void +f3 (volatile unsigned int *area, int offset) +{ + __builtin_mips_cache (0, area + offset); +} + +void +f4 (const volatile unsigned char *area) +{ + __builtin_mips_cache (4, area - 80); +} + +/* { dg-final { scan-assembler "\tcache\t0x14,0\\(\\\$4\\)" } } */ +/* { dg-final { scan-assembler "\tcache\t0x18,20\\(\\\$4\\)" } } */ +/* { dg-final { scan-assembler "\tcache\t0x0,0\\(\\\$.\\)" } } */ +/* { dg-final { scan-assembler "\tcache\t0x4,-80\\(\\\$4\\)" } } */ diff --git a/gcc/testsuite/gcc.target/mips/mips.exp b/gcc/testsuite/gcc.target/mips/mips.exp index 526bbdb14f2..832633900c9 100644 --- a/gcc/testsuite/gcc.target/mips/mips.exp +++ b/gcc/testsuite/gcc.target/mips/mips.exp @@ -238,6 +238,10 @@ proc dg-mips-options {args} { } else { append flags " -msoft-float" } + } elseif {[regexp -- {^-mr10k-cache-barrier=(load|store)} $flag] + && $mips_isa < 3 + && [lsearch -regexp $flags {^(-mips|-march)}] < 0} { + append flags " -mips3" } } foreach flag $flags { diff --git a/gcc/testsuite/gcc.target/mips/octeon-cins-1.c b/gcc/testsuite/gcc.target/mips/octeon-cins-1.c new file mode 100644 index 00000000000..27dc6b3d2b7 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/octeon-cins-1.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* The tests also work with -mgp32. For long long tests, only one of + the 32-bit parts is used. */ +/* { dg-mips-options "-O -march=octeon" } */ +/* { dg-final { scan-assembler-times "\tcins\t" 3 } } */ +/* { dg-final { scan-assembler-not "\tandi\t|sll\t" } } */ + +NOMIPS16 long long +f (long long i) +{ + return (i & 0xff) << 34; +} + +NOMIPS16 int +g (int i) +{ + return (i << 4) & 0xff0; +} + +NOMIPS16 long long +h (long long i) +{ + return (i << 4) & 0xfff; +} diff --git a/gcc/testsuite/gcc.target/mips/octeon-cins-2.c b/gcc/testsuite/gcc.target/mips/octeon-cins-2.c new file mode 100644 index 00000000000..c60ee933ffa --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/octeon-cins-2.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-mips-options "-O -march=octeon -mgp64" } */ +/* { dg-final { scan-assembler-not "\tcins\t" } } */ + +NOMIPS16 unsigned +f (unsigned i) +{ + return (i & 0xff) << 24; +} + +NOMIPS16 unsigned long long +g (unsigned long long i) +{ + return (i & 0x1ffffffffULL) << 4; +} diff --git a/gcc/testsuite/gcc.target/mips/octeon-exts-1.c b/gcc/testsuite/gcc.target/mips/octeon-exts-1.c new file mode 100644 index 00000000000..bdaa0b927ef --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/octeon-exts-1.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-mips-options "-march=octeon" } */ +/* { dg-final { scan-assembler "\texts\t" } } */ + +struct foo +{ + long long a:3; + long long b:23; + long long c:38; +}; + +NOMIPS16 int +f (struct foo s) +{ + return s.b; +} diff --git a/gcc/testsuite/gcc.target/mips/octeon-exts-2.c b/gcc/testsuite/gcc.target/mips/octeon-exts-2.c new file mode 100644 index 00000000000..a87c5fb45db --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/octeon-exts-2.c @@ -0,0 +1,37 @@ +/* { dg-do compile } */ +/* { dg-mips-options "-O -march=octeon" } */ +/* { dg-final { scan-assembler-times "\texts\t" 4 } } */ + +struct bar +{ + unsigned long long a:1; + long long b:14; + unsigned long long c:48; + long long d:1; +}; + +NOMIPS16 int +f1 (struct bar *s, int a) +{ + return (int) s->b + a; +} + +NOMIPS16 char +f2 (struct bar *s) +{ + return s->d + 1; +} + +NOMIPS16 int +f3 () +{ + struct bar s; + asm ("" : "=r"(s)); + return (int) s.b + 1; +} + +NOMIPS16 long long +f4 (struct bar *s) +{ + return s->d; +} diff --git a/gcc/testsuite/gcc.target/mips/octeon-exts-3.c b/gcc/testsuite/gcc.target/mips/octeon-exts-3.c new file mode 100644 index 00000000000..d7610f82e32 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/octeon-exts-3.c @@ -0,0 +1,35 @@ +/* { dg-do compile } */ +/* { dg-mips-options "-O -march=octeon -mgp64" } */ +/* { dg-final { scan-assembler-times "\texts\t" 3 } } */ + +struct foo +{ + unsigned long long a:10; + unsigned long long b:32; + unsigned long long c:22; +}; + +NOMIPS16 unsigned +f (struct foo s) +{ + return s.b; +} + +struct bar +{ + unsigned long long a:15; + unsigned long long b:48; + unsigned long long c:1; +}; + +NOMIPS16 int +g (struct bar s) +{ + return (int) s.b; +} + +NOMIPS16 int +h (int i) +{ + return (i << 4) >> 24; +} diff --git a/gcc/testsuite/gcc.target/mips/octeon-exts-4.c b/gcc/testsuite/gcc.target/mips/octeon-exts-4.c new file mode 100644 index 00000000000..475fa21e8dc --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/octeon-exts-4.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-mips-options "-O -march=octeon -mgp64" } */ +/* { dg-final { scan-assembler-not "\tsll\t\[^\n\]*,0" } } */ +/* { dg-final { scan-assembler-times "\texts\t" 6 } } */ + +#define TEST(ID, TYPE, SHIFT) \ + int NOMIPS16 \ + f##ID (long long y) \ + { \ + return (TYPE) ((TYPE) (y >> SHIFT) + 1); \ + } \ + int NOMIPS16 \ + g##ID (unsigned long long y) \ + { \ + return (TYPE) ((TYPE) (y >> SHIFT) + 1); \ + } + +TEST (1, int, 10) +TEST (2, short, 5) +TEST (3, char, 31) diff --git a/gcc/testsuite/gcc.target/mips/octeon-seq-1.c b/gcc/testsuite/gcc.target/mips/octeon-seq-1.c new file mode 100644 index 00000000000..3199cd7ad2a --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/octeon-seq-1.c @@ -0,0 +1,19 @@ +/* Check if we expand seq and sne. */ + +/* { dg-do compile } */ +/* { dg-mips-options "-march=octeon" } */ +/* { dg-final { scan-assembler-times "\tseq\t|\tseqi\t" 4 } } */ +/* { dg-final { scan-assembler-times "\tsne\t|\tsnei\t" 4 } } */ + +#define TEST(N, LHS, REL, RHS) \ + NOMIPS16 int f##N (int a, int b) { return LHS REL RHS; } + +TEST (0, a, ==, b); +TEST (1, a, ==, 23); +TEST (2, a, ==, 511); +TEST (3, a, ==, -200); + +TEST (10, a, !=, b); +TEST (11, a, !=, 1); +TEST (12, a, !=, 350); +TEST (13, a, !=, -512); diff --git a/gcc/testsuite/gcc.target/mips/octeon-seq-2.c b/gcc/testsuite/gcc.target/mips/octeon-seq-2.c new file mode 100644 index 00000000000..994e51b7738 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/octeon-seq-2.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-mips-options "-march=octeon -mgp64" } */ +/* { dg-final { scan-assembler-times "\tseq\t|\tseqi\t" 3 } } */ +/* { dg-final { scan-assembler-times "\tsne\t|\tsnei\t" 3 } } */ + +#define TEST(N, LHS, REL, RHS) \ + NOMIPS16 long long f##N (long long a, long long b) { return LHS REL RHS; } + +TEST (0, a, ==, b); +TEST (1, a, ==, 23); +TEST (2, a, ==, 511); + +TEST (3, a, !=, b); +TEST (4, a, !=, 1); +TEST (5, a, !=, 350); diff --git a/gcc/testsuite/gcc.target/mips/octeon-seq-3.c b/gcc/testsuite/gcc.target/mips/octeon-seq-3.c new file mode 100644 index 00000000000..522d0eaa4e3 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/octeon-seq-3.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-mips-options "-O -march=octeon -mgp64" } */ + +/* { dg-final { scan-assembler-not "and\t\|andi\t\|ext\t\|sll\t\|srl\t" } } */ +/* { dg-final { scan-assembler-times "\tseqi\t\|\tsnei\t" 4 } } */ + + +#define TEST(N, LHS, REL, RHS) \ + NOMIPS16 long long w##N (int a, int b) {return LHS REL RHS;} \ + NOMIPS16 int n##N (long long a, long long b) {return LHS REL RHS;} \ + +TEST (eq, a, ==, 10); +TEST (ne, a, !=, 32); diff --git a/gcc/testsuite/gcc.target/mips/octeon-seq-4.c b/gcc/testsuite/gcc.target/mips/octeon-seq-4.c new file mode 100644 index 00000000000..88a71001be9 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/octeon-seq-4.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-mips-options "-O2 -march=octeon" } */ +/* { dg-final { scan-assembler-not "xor" } } */ + +unsigned +m (unsigned e); + +NOMIPS16 void +f (unsigned i) +{ + unsigned j = m (i); + h (j, i != j); +} diff --git a/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-1.c b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-1.c new file mode 100644 index 00000000000..fd13d8ac876 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-1.c @@ -0,0 +1,45 @@ +/* { dg-mips-options "-O2 -mabi=64 -mr10k-cache-barrier=store" } */ + +/* Test that stores to uncached addresses do not get unnecessary + cache barriers. */ + +#define TEST(ADDR) \ + NOMIPS16 void \ + test_##ADDR (int n) \ + { \ + while (n--) \ + { \ + *(volatile char *) (0x##ADDR##UL) = 1; \ + *(volatile short *) (0x##ADDR##UL + 2) = 2; \ + *(volatile int *) (0x##ADDR##UL + 4) = 0; \ + } \ + } + +TEST (9000000000000000) +TEST (900000fffffffff8) + +TEST (9200000000000000) +TEST (920000fffffffff8) + +TEST (9400000000000000) +TEST (940000fffffffff8) + +TEST (9600000000000000) +TEST (960000fffffffff8) + +TEST (b800000000000000) +TEST (b80000fffffffff8) + +TEST (ba00000000000000) +TEST (ba0000fffffffff8) + +TEST (bc00000000000000) +TEST (bc0000fffffffff8) + +TEST (be00000000000000) +TEST (be0000fffffffff8) + +TEST (ffffffffa0000000) +TEST (ffffffffbffffff8) + +/* { dg-final { scan-assembler-not "\tcache\t" } } */ diff --git a/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-10.c b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-10.c new file mode 100644 index 00000000000..405d7fcf033 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-10.c @@ -0,0 +1,18 @@ +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -mips4 -mbranch-likely -mno-abicalls" } */ +int bar (int); + +/* Test that code after a branch-likely does not get an unnecessary + cache barrier. */ + +NOMIPS16 void +foo (int n, int *x) +{ + do + n = bar (n * 4 + 1); + while (n); + /* The preceding branch should be a branch likely, with the shift as + its delay slot. We therefore don't need a cache barrier here. */ + x[0] = 0; +} + +/* { dg-final { scan-assembler-not "\tcache\t" } } */ diff --git a/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-11.c b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-11.c new file mode 100644 index 00000000000..be6816fda9b --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-11.c @@ -0,0 +1,13 @@ +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -mno-abicalls" } */ + +/* Test that loads are not unnecessarily protected. */ + +int bar (int); + +NOMIPS16 void +foo (int *ptr) +{ + *ptr = bar (*ptr); +} + +/* { dg-final { scan-assembler-times "\tcache\t" 1 } } */ diff --git a/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-12.c b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-12.c new file mode 100644 index 00000000000..7e8026f1e5f --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-12.c @@ -0,0 +1,13 @@ +/* { dg-mips-options "-O2 -mr10k-cache-barrier=load-store -mno-abicalls" } */ + +/* Test that loads are correctly protected. */ + +int bar (int); + +NOMIPS16 void +foo (int *ptr) +{ + *ptr = bar (*ptr); +} + +/* { dg-final { scan-assembler-times "\tcache\t" 2 } } */ diff --git a/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-13.c b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-13.c new file mode 100644 index 00000000000..fa5a416ce20 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-13.c @@ -0,0 +1,14 @@ +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store" } */ + +/* Test that indirect calls are protected. */ + +int bar (int); + +NOMIPS16 void +foo (void (*fn) (void), int x) +{ + if (x) + (*fn) (); +} + +/* { dg-final { scan-assembler-times "\tcache\t" 1 } } */ diff --git a/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-14.c b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-14.c new file mode 100644 index 00000000000..4d807833abb --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-14.c @@ -0,0 +1,7 @@ +/* { dg-do compile { target mips16_attribute } } */ +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store" } */ +/* { dg-add-options mips16_attribute } */ + +/* Test that indirect calls are protected. */ + +MIPS16 void foo (void) { } /* { dg-message "sorry, unimplemented" } */ diff --git a/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-15.c b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-15.c new file mode 100644 index 00000000000..5b03838ca2c --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-15.c @@ -0,0 +1,2 @@ +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -mips2" } */ +/* { dg-error "requires.*cache.*instruction" "" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-2.c b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-2.c new file mode 100644 index 00000000000..ed439b143f5 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-2.c @@ -0,0 +1,40 @@ +/* { dg-mips-options "-O2 -mabi=64 -mr10k-cache-barrier=store" } */ + +/* Test that stores to constant cached addresses are protected + by cache barriers. */ + +#define TEST(ADDR) \ + NOMIPS16 void \ + test_##ADDR (int n) \ + { \ + *(volatile int *) (0x##ADDR##UL) = 1; \ + } + +TEST (8ffffffffffffffc) +TEST (9000010000000000) + +TEST (91fffffffffffffc) +TEST (9200010000000000) + +TEST (93fffffffffffffc) +TEST (9500010000000000) + +TEST (95fffffffffffffc) +TEST (9600010000000000) + +TEST (b7fffffffffffffc) +TEST (b800010000000000) + +TEST (b9fffffffffffffc) +TEST (ba00010000000000) + +TEST (bbfffffffffffffc) +TEST (bc00010000000000) + +TEST (bdfffffffffffffc) +TEST (be00010000000000) + +TEST (ffffffff9ffffffc) +TEST (ffffffffc0000000) + +/* { dg-final { scan-assembler-times "\tcache\t" 18 } } */ diff --git a/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-3.c b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-3.c new file mode 100644 index 00000000000..8238f39b04c --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-3.c @@ -0,0 +1,17 @@ +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -mno-abicalls" } */ + +/* Test that in-range stores to the frame are not protected by + cache barriers. */ + +void bar (int *x); + +NOMIPS16 void +foo (int v) +{ + int x[0x100000]; + bar (x); + x[0x20] = v; + bar (x); +} + +/* { dg-final { scan-assembler-not "\tcache\t" } } */ diff --git a/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-4.c b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-4.c new file mode 100644 index 00000000000..e8280e8af27 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-4.c @@ -0,0 +1,20 @@ +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -mno-abicalls" } */ + +void bar (int *x); + +/* Test that out-of-range stores to the frame are protected by cache + barriers. */ + +NOMIPS16 void +foo (int v) +{ + int x[8]; + bar (x); + if (v & 1) + x[0x100] = 0; + if (v & 2) + x[-0x100] = 0; + bar (x); +} + +/* { dg-final { scan-assembler-times "\tcache\t" 2 } } */ diff --git a/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-5.c b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-5.c new file mode 100644 index 00000000000..6e21ec3e393 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-5.c @@ -0,0 +1,19 @@ +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -mno-abicalls -mabi=64" } */ + +/* Test that in-range stores to static objects do not get an unnecessary + cache barrier. */ + +int x[4]; +void bar (void); + +NOMIPS16 void +foo (int n) +{ + while (n--) + { + x[3] = 1; + bar (); + } +} + +/* { dg-final { scan-assembler-not "\tcache\t" } } */ diff --git a/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-6.c b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-6.c new file mode 100644 index 00000000000..f014aa0dcdc --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-6.c @@ -0,0 +1,19 @@ +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -mabi=64" } */ + +int x[4]; +void bar (void); + +/* Test that out-of-range stores to static objects are protected by a + cache barrier. */ + +NOMIPS16 void +foo (int n) +{ + while (n--) + { + x[4] = 1; + bar (); + } +} + +/* { dg-final { scan-assembler "\tcache\t" } } */ diff --git a/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-7.c b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-7.c new file mode 100644 index 00000000000..c98b4a8a0fe --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-7.c @@ -0,0 +1,27 @@ +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -mno-abicalls" } */ + +void bar1 (void); +void bar2 (void); +void bar3 (void); + +NOMIPS16 void +foo (int *x, int sel, int n) +{ + if (sel) + { + bar1 (); + x[0] = 1; + } + else + { + bar2 (); + x[1] = 0; + } + /* If there is one copy of this code, reached by two unconditional edges, + then it shouldn't need a third cache barrier. */ + x[2] = 2; + while (n--) + bar3 (); +} + +/* { dg-final { scan-assembler-times "\tcache\t" 2 } } */ diff --git a/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-8.c b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-8.c new file mode 100644 index 00000000000..5394ae8067e --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-8.c @@ -0,0 +1,15 @@ +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -G8" } */ + +/* Test that in-range stores to components of static objects + do not get an unnecessary cache barrier. */ + +struct { struct { char i[4]; } a; struct { char j[4]; } b; } s; + +NOMIPS16 void +foo (int sel) +{ + s.a.i[0] = 1; + s.b.j[3] = 100; +} + +/* { dg-final { scan-assembler-not "\tcache\t" } } */ diff --git a/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-9.c b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-9.c new file mode 100644 index 00000000000..cf795b6e732 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-9.c @@ -0,0 +1,19 @@ +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -G8" } */ + +/* Test that out-of-range stores to components of static objects + are protected by a cache barrier. */ + +struct { struct { char i[4]; } a; struct { char j[4]; } b; } s; + +NOMIPS16 void +foo (int sel1, int sel2, int sel3) +{ + if (sel1) + s.a.i[8] = 1; + if (sel2) + s.b.j[4] = 100; + if (sel3) + s.a.i[-1] = 0; +} + +/* { dg-final { scan-assembler-times "\tcache\t" 3 } } */ diff --git a/gcc/testsuite/gcc.target/mips/scc-2.c b/gcc/testsuite/gcc.target/mips/scc-2.c index 7964227a8d7..c6c79d8cb61 100644 --- a/gcc/testsuite/gcc.target/mips/scc-2.c +++ b/gcc/testsuite/gcc.target/mips/scc-2.c @@ -2,7 +2,7 @@ /* { dg-mips-options "-O -mgp64" } */ /* { dg-final { scan-assembler-not "and\t\|andi\t\|ext\t\|sll\t\|srl\t" } } */ -/* { dg-final { scan-assembler-times "slt\t\|sltu\t" 12 } } */ +/* { dg-final { scan-assembler-times "slt\t\|slti?u\t" 12 } } */ #define TEST(N, LHS, REL, RHS) \ diff --git a/gcc/testsuite/gcc.target/mips/scc-3.c b/gcc/testsuite/gcc.target/mips/scc-3.c index eb9d575f061..445a324bb8a 100644 --- a/gcc/testsuite/gcc.target/mips/scc-3.c +++ b/gcc/testsuite/gcc.target/mips/scc-3.c @@ -3,7 +3,7 @@ /* { dg-add-options mips16_attribute } */ /* { dg-final { scan-assembler-not "and\t\|andi\t\|ext\t\|sll\t\|srl\t" } } */ -/* { dg-final { scan-assembler-times "slt\t\|sltu\t" 8 } } */ +/* { dg-final { scan-assembler-times "slt\t\|slti?u\t" 8 } } */ #define TEST(N, LHS, REL, RHS) \ diff --git a/gcc/testsuite/gcc.target/mips/seq-1.c b/gcc/testsuite/gcc.target/mips/seq-1.c new file mode 100644 index 00000000000..ae23608ceea --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/seq-1.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-final { scan-assembler-times "\tsltu\t|\tsltiu\t" 4 } } */ + +#define TEST(N, LHS, REL, RHS) \ + NOMIPS16 int f##N (int a, int b) { return LHS REL RHS; } + +TEST (0, a, ==, 0); +TEST (1, a, ==, 600); +TEST (10, a, !=, 0); +TEST (11, a, !=, -800); diff --git a/gcc/testsuite/gcc.target/mips/truncate-2.c b/gcc/testsuite/gcc.target/mips/truncate-2.c new file mode 100644 index 00000000000..51125a48190 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/truncate-2.c @@ -0,0 +1,20 @@ +/* { dg-mips-options "-O -mgp64" } */ + +#define TEST(ID, TYPE, SHIFT) \ + int NOMIPS16 \ + f##ID (long long y) \ + { \ + return (TYPE) ((TYPE) (y >> SHIFT) + 1); \ + } + +TEST (1, int, 32) +TEST (2, short, 32) +TEST (3, char, 32) +TEST (4, int, 33) +TEST (5, short, 33) +TEST (6, char, 33) +TEST (7, int, 61) +TEST (8, short, 61) +TEST (9, char, 61) + +/* { dg-final { scan-assembler-not "\tsll\t\[^\n\]*,0" } } */ diff --git a/gcc/testsuite/gfortran.dg/implicit_derived_type_1.f90 b/gcc/testsuite/gfortran.dg/implicit_derived_type_1.f90 new file mode 100644 index 00000000000..baa36d1ba34 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/implicit_derived_type_1.f90 @@ -0,0 +1,20 @@ +! { dg-do compile } + +! PR fortran/36746 +! Check that parsing of component references for symbols with IMPLICIT +! derived-type works. + +! Reduced test from the PR. +! Contributed by Tobias Burnus <burnus@gcc.gnu.org> + +module m + type t + integer :: i + end type t +contains + subroutine s(x) + implicit type(t)(x) + dimension x(:) + print *, x(1)%i + end subroutine s +end module m diff --git a/gcc/testsuite/gfortran.dg/internal_pack_4.f90 b/gcc/testsuite/gfortran.dg/internal_pack_4.f90 index 049931a4f4f..0bcfc799a8e 100644 --- a/gcc/testsuite/gfortran.dg/internal_pack_4.f90 +++ b/gcc/testsuite/gfortran.dg/internal_pack_4.f90 @@ -26,6 +26,6 @@ USE M1 CALL S2() END -! { dg-final { scan-tree-dump-times "a != 0B \\? _gfortran_internal_pack" 1 "original" } } +! { dg-final { scan-tree-dump-times "a != 0B \\? \\\(.*\\\) _gfortran_internal_pack" 1 "original" } } ! { dg-final { scan-tree-dump-times "if \\(a != 0B &&" 1 "original" } } ! { dg-final { cleanup-tree-dump "original" } } diff --git a/gcc/testsuite/gfortran.dg/intrinsic_subroutine.f90 b/gcc/testsuite/gfortran.dg/intrinsic_subroutine.f90 new file mode 100644 index 00000000000..103ff3b7121 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/intrinsic_subroutine.f90 @@ -0,0 +1,7 @@ +! { dg-do compile } +! PR 33229 +implicit none +intrinsic cpu_time +real :: time +print *, CPU_TIME(TIME) ! { dg-error "Intrinsic subroutine" } +end diff --git a/gcc/testsuite/gfortran.dg/save_3.f90 b/gcc/testsuite/gfortran.dg/save_3.f90 new file mode 100644 index 00000000000..d2deed17e04 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/save_3.f90 @@ -0,0 +1,16 @@ +! { dg-do compile } + +! PR fortran/35837 +! We used do have a problem with resolving "save all" and nested namespaces. + +! Contributed by Tobias Burnus <burnus@gcc.gnu.org> + +module g95bug +save +integer :: i=20 +contains +pure function tell_i() result (answer) + integer :: answer + answer=i +end function tell_i +end module g95bug diff --git a/gcc/testsuite/gfortran.dg/size_kind.f90 b/gcc/testsuite/gfortran.dg/size_kind.f90 new file mode 100644 index 00000000000..5ec6f7efe14 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/size_kind.f90 @@ -0,0 +1,25 @@ +! { dg-do compile } +! +! PR fortran/36153 +! Contributed by Jonathan Hogg +! +program test_64 + implicit none + + integer, parameter :: long = selected_int_kind(18) + integer, parameter :: short = kind(0) + + integer(long), parameter :: big_sz = huge(0_short)+1000_long + integer(long), parameter :: max_32 = huge(0_short) + integer, dimension(:), allocatable :: array + + integer(long) :: i + + print *, "2**31 = ", 2_long**31 + print *, "max_32 = ", max_32 + print *, "big_sz = ", big_sz + + allocate(array(big_sz)) + print *, "sz = ", size(array) + print *, "sz = ", size(array, kind=long) +end program diff --git a/gcc/testsuite/gfortran.dg/string_compare_1.f90 b/gcc/testsuite/gfortran.dg/string_compare_1.f90 new file mode 100644 index 00000000000..30cf357174f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/string_compare_1.f90 @@ -0,0 +1,25 @@ +! { dg-do run } + +! PR fortran/37099 +! Check for correct results when comparing array-section-substrings. + +PROGRAM main + IMPLICIT NONE + + CHARACTER(*), PARAMETER :: exprs(1) = (/ 'aa' /) + + CHARACTER(*), PARAMETER :: al1 = 'a'; + CHARACTER(len=LEN (al1)) :: al2 = al1; + + LOGICAL :: tmp(1), tmp2(1) + + tmp = (exprs(1:1)(1:1) == al1) + tmp2 = (exprs(1:1)(1:1) == al2) + + PRINT '(L1)', tmp + PRINT '(L1)', tmp2 + + IF (.NOT. tmp(1) .OR. .NOT. tmp2(1)) THEN + CALL abort () + END IF +END PROGRAM main diff --git a/gcc/testsuite/gfortran.dg/string_compare_2.f90 b/gcc/testsuite/gfortran.dg/string_compare_2.f90 new file mode 100644 index 00000000000..dc68bef2ada --- /dev/null +++ b/gcc/testsuite/gfortran.dg/string_compare_2.f90 @@ -0,0 +1,37 @@ +! { dg-do run } + +! PR fortran/37099 +! Check for correct results when comparing array-section-substrings. + +! This is the original test from the PR. +! Contributed by Dominique d'Humieres <dominiq@lps.ens.fr> + +module xparams + integer,parameter :: exprbeg=100,exprend=154 + character(*),dimension(exprbeg:exprend),parameter :: & + exprs=(/'nint() ','log10() ','sqrt() ','acos() ','asin() ', & + 'atan() ','cosh() ','sinh() ','tanh() ','int() ', & + 'cos() ','sin() ','tan() ','exp() ','log() ','abs() ',& + 'delta() ','step() ','rect() ','max(,) ','min(,) ','bj0() ',& + 'bj1() ','bjn(,) ','by0() ','by1() ','byn(,) ','logb(,) ',& + 'erf() ','erfc() ','lgamma()','gamma() ','csch() ','sech() ',& + 'coth() ','lif(,,) ','gaus() ','sinc() ','atan2(,)','mod(,) ',& + 'nthrt(,)','ramp() ','fbi() ','fbiq() ','uran(,) ','aif(,,,)',& + 'sgn() ','cbrt() ','fact() ','somb() ','bk0() ','bk1() ',& + 'bkn(,) ','bbi(,,) ','bbiq(,,)'/) + logical :: tmp(55,26) + character(26) :: al = 'abcdefghijklmnopqrstuvwxyz' +end + +program pack_bug + use xparams + do i = 1, 1 + tmp(:,i) = (exprs(:)(1:1)==al(i:i)) + print '(55L1)', exprs(:)(1:1)=='a' + print '(55L1)', tmp(:,i) + + if (any ((exprs(:)(1:1)=='a') .neqv. tmp(:,i))) then + call abort () + end if + end do +end diff --git a/gcc/testsuite/gfortran.dg/string_compare_3.f90 b/gcc/testsuite/gfortran.dg/string_compare_3.f90 new file mode 100644 index 00000000000..46a11d3f55a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/string_compare_3.f90 @@ -0,0 +1,21 @@ +! { dg-do run } + +! PR fortran/37099 +! Check for correct results when comparing array-section-substrings. + +! This is the test from comment #1 of the PR. +! Contributed by Dominique d'Humieres <dominiq@lps.ens.fr> + +integer, parameter :: n = 10 +integer, parameter :: ilst(n) = (/(i,i=1,n)/) +character(*), parameter :: c0lst(n) = (/(char(96+i),i=1,n)/) +character(*), parameter :: c1lst(n) = (/(char(96+i)//'b',i=1,n)/) +logical :: tmp(n) +i = 5 +print *, ilst(:) == i +print *, c0lst(:)(1:1) == char(96+i) +tmp = c1lst(:)(1:1) == char(96+i) +print *, tmp +print *, c1lst(:)(1:1) == 'e' +if (any(tmp .neqv. (c0lst(:)(1:1) == char(96+i)))) call abort() +end diff --git a/gcc/testsuite/gfortran.dg/used_before_typed_5.f90 b/gcc/testsuite/gfortran.dg/used_before_typed_5.f90 new file mode 100644 index 00000000000..9e78e681f48 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/used_before_typed_5.f90 @@ -0,0 +1,19 @@ +! { dg-do compile } +! { dg-options "-pedantic -std=f95" } + +! Check that DIMENSION/POINTER/ALLOCATABLE/INTENT statements *do* allow +! symbols to be typed later. + +SUBROUTINE test (a) + IMPLICIT REAL (a-z) + + ! Those should *not* IMPLICIT-type the symbols: + INTENT(IN) :: a + DIMENSION :: b(:) + POINTER :: c + ALLOCATABLE :: b + + ! So this is ok: + INTEGER :: a, b, c + +END SUBROUTINE test diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index ce0649db1d8..ce06d0e583d 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -6231,7 +6231,7 @@ need_fake_edge_p (gimple t) && !(call_flags & ECF_NORETURN)) return true; - if (gimple_code (t) == ASM_EXPR + if (gimple_code (t) == GIMPLE_ASM && (gimple_asm_volatile_p (t) || gimple_asm_input_p (t))) return true; diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h index c75afb0d839..99b993dc415 100644 --- a/gcc/tree-flow.h +++ b/gcc/tree-flow.h @@ -676,7 +676,7 @@ extern struct omp_region *new_omp_region (basic_block, enum gimple_code, struct omp_region *); extern void free_omp_regions (void); void omp_expand_local (basic_block); -extern tree find_omp_clause (tree, enum tree_code); +extern tree find_omp_clause (tree, enum omp_clause_code); tree copy_var_decl (tree, tree, tree); /*--------------------------------------------------------------------------- diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index e1540f3b8f8..42a54312bdf 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -3216,7 +3216,7 @@ is_escape_site (gimple stmt) Applications (OOPSLA), pp. 1-19, 1999. */ return ESCAPE_STORED_IN_GLOBAL; } - else if (gimple_code (stmt) == RETURN_EXPR) + else if (gimple_code (stmt) == GIMPLE_RETURN) return ESCAPE_TO_RETURN; return NO_ESCAPE; diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 9fe0753b1d9..8f700c47be2 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -501,7 +501,7 @@ likely_value (gimple stmt) tree use; ssa_op_iter iter; - enum tree_code code = gimple_code (stmt); + enum gimple_code code = gimple_code (stmt); /* This function appears to be called only for assignments, calls, conditionals, and switches, due to the logic in visit_stmt. */ @@ -1308,7 +1308,7 @@ evaluate_stmt (gimple stmt) bother folding the statement. */ else if (likelyvalue == VARYING) { - enum tree_code code = gimple_code (stmt); + enum gimple_code code = gimple_code (stmt); if (code == GIMPLE_ASSIGN) { enum tree_code subcode = gimple_assign_rhs_code (stmt); diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c index 93cd643d0f2..06e004c34bb 100644 --- a/gcc/tree-vect-analyze.c +++ b/gcc/tree-vect-analyze.c @@ -427,7 +427,7 @@ vect_analyze_operations (loop_vec_info loop_vinfo) { gimple stmt = gsi_stmt (si); stmt_vec_info stmt_info = vinfo_for_stmt (stmt); - enum vect_def_type relevance = STMT_VINFO_RELEVANT (stmt_info); + enum vect_relevant relevance = STMT_VINFO_RELEVANT (stmt_info); if (vect_print_dump_info (REPORT_DETAILS)) { @@ -4081,8 +4081,10 @@ vect_mark_stmts_to_be_vectorized (loop_vec_info loop_vinfo) case vect_used_in_outer_by_reduction: case vect_used_in_outer: - gcc_assert (gimple_code (stmt) != WIDEN_SUM_EXPR - && gimple_code (stmt) != DOT_PROD_EXPR); + gcc_assert (gimple_code (stmt) != GIMPLE_ASSIGN + || (gimple_assign_rhs_code (stmt) != WIDEN_SUM_EXPR + && (gimple_assign_rhs_code (stmt) + != DOT_PROD_EXPR))); break; case vect_used_by_reduction: diff --git a/gcc/varasm.c b/gcc/varasm.c index 5aa0140e002..5728d195e09 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -4063,6 +4063,73 @@ constructor_static_from_elts_p (const_tree ctor) && !VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (ctor))); } +/* A subroutine of initializer_constant_valid_p. VALUE is either a + MINUS_EXPR or a POINTER_PLUS_EXPR, and ENDTYPE is a narrowing + conversion to something smaller than a pointer. This returns + null_pointer_node if the resulting value is an absolute constant + which can be used to initialize a static variable. Otherwise it + returns NULL. */ + +static tree +narrowing_initializer_constant_valid_p (tree value, tree endtype) +{ + tree op0, op1; + + op0 = TREE_OPERAND (value, 0); + op1 = TREE_OPERAND (value, 1); + + /* Like STRIP_NOPS except allow the operand mode to widen. This + works around a feature of fold that simplifies (int)(p1 - p2) to + ((int)p1 - (int)p2) under the theory that the narrower operation + is cheaper. */ + + while (CONVERT_EXPR_P (op0) + || TREE_CODE (op0) == NON_LVALUE_EXPR) + { + tree inner = TREE_OPERAND (op0, 0); + if (inner == error_mark_node + || ! INTEGRAL_MODE_P (TYPE_MODE (TREE_TYPE (inner))) + || (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op0))) + > GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (inner))))) + break; + op0 = inner; + } + + while (CONVERT_EXPR_P (op1) + || TREE_CODE (op1) == NON_LVALUE_EXPR) + { + tree inner = TREE_OPERAND (op1, 0); + if (inner == error_mark_node + || ! INTEGRAL_MODE_P (TYPE_MODE (TREE_TYPE (inner))) + || (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op1))) + > GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (inner))))) + break; + op1 = inner; + } + + op0 = initializer_constant_valid_p (op0, endtype); + op1 = initializer_constant_valid_p (op1, endtype); + + /* Both initializers must be known. */ + if (op0 && op1) + { + if (op0 == op1) + return null_pointer_node; + + /* Support differences between labels. */ + if (TREE_CODE (op0) == LABEL_DECL + && TREE_CODE (op1) == LABEL_DECL) + return null_pointer_node; + + if (TREE_CODE (op0) == STRING_CST + && TREE_CODE (op1) == STRING_CST + && operand_equal_p (op0, op1, 1)) + return null_pointer_node; + } + + return NULL_TREE; +} + /* Return nonzero if VALUE is a valid constant-valued expression for use in initializing a static variable; one that can be an element of a "constant" initializer. @@ -4076,6 +4143,8 @@ constructor_static_from_elts_p (const_tree ctor) tree initializer_constant_valid_p (tree value, tree endtype) { + tree ret; + switch (TREE_CODE (value)) { case CONSTRUCTOR: @@ -4216,6 +4285,14 @@ initializer_constant_valid_p (tree value, tree endtype) if (valid1 == null_pointer_node) return valid0; } + + /* Support narrowing pointer differences. */ + if (TREE_CODE (value) == POINTER_PLUS_EXPR) + { + ret = narrowing_initializer_constant_valid_p (value, endtype); + if (ret != NULL_TREE) + return ret; + } break; case MINUS_EXPR: @@ -4244,62 +4321,10 @@ initializer_constant_valid_p (tree value, tree endtype) } /* Support narrowing differences. */ - if (INTEGRAL_TYPE_P (endtype)) - { - tree op0, op1; + ret = narrowing_initializer_constant_valid_p (value, endtype); + if (ret != NULL_TREE) + return ret; - op0 = TREE_OPERAND (value, 0); - op1 = TREE_OPERAND (value, 1); - - /* Like STRIP_NOPS except allow the operand mode to widen. - This works around a feature of fold that simplifies - (int)(p1 - p2) to ((int)p1 - (int)p2) under the theory - that the narrower operation is cheaper. */ - - while (CONVERT_EXPR_P (op0) - || TREE_CODE (op0) == NON_LVALUE_EXPR) - { - tree inner = TREE_OPERAND (op0, 0); - if (inner == error_mark_node - || ! INTEGRAL_MODE_P (TYPE_MODE (TREE_TYPE (inner))) - || (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op0))) - > GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (inner))))) - break; - op0 = inner; - } - - while (CONVERT_EXPR_P (op1) - || TREE_CODE (op1) == NON_LVALUE_EXPR) - { - tree inner = TREE_OPERAND (op1, 0); - if (inner == error_mark_node - || ! INTEGRAL_MODE_P (TYPE_MODE (TREE_TYPE (inner))) - || (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op1))) - > GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (inner))))) - break; - op1 = inner; - } - - op0 = initializer_constant_valid_p (op0, endtype); - op1 = initializer_constant_valid_p (op1, endtype); - - /* Both initializers must be known. */ - if (op0 && op1) - { - if (op0 == op1) - return null_pointer_node; - - /* Support differences between labels. */ - if (TREE_CODE (op0) == LABEL_DECL - && TREE_CODE (op1) == LABEL_DECL) - return null_pointer_node; - - if (TREE_CODE (op0) == STRING_CST - && TREE_CODE (op1) == STRING_CST - && operand_equal_p (op0, op1, 1)) - return null_pointer_node; - } - } break; default: |