Commit Graph

1096 Commits

Author SHA1 Message Date
Sharad Singhai 2b4e6bf1d5 invoke.texi: Update -fopt-info documentation.
2012-11-01  Sharad Singhai  <singhai@google.com>

    * doc/invoke.texi: Update -fopt-info documentation.
    * dumpfile.c: Move dump_flags here from passes.c.
    Rename opt_info_options to optinfo_verbosity_options.
    Add optgroup_options.
    (dump_files): Add field for optinfo_flags in the static initializer.
    (dump_register): Handle additional parameter for optgroup_flags.
    (opt_info_enable_passes): Renamed opt_info_enable_all. Handle
    optgroup_flags. Fix documentation.
    (opt_info_switch_p_1): Handle optgroup options.
    (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files.
    * dumpfile.h (dump_register): Additional argument for optgroup_flags.
    All callers updated.
    (struct dump_file_info): Add field for optgroup_flags.
    Define OPTGROUP_* flags.
    * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags.
    All opt_pass static initializers updated.
    * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all'
    instead of 'optall'.
    (handle_common_deferred_options): Fix typo in error message.
    * passes.c (register_one_dump_file): Add argument for optgroup_flags.
    Turn on OPTGROUP_IPA for IPA passes.
    Move dump_flags from here to dumpfile.c.
    * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to
    dump_register.

testsuite/ChangeLog

    * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer.
    * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise.
    * testsuite/g++.dg/plugin/selfassign.c: Likewise.
    * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise.

From-SVN: r193061
2012-11-01 07:34:44 +00:00
Richard Sandiford 7ae6664baa combine.c (simplify_comparison): If BITS_BIG_ENDIAN...
gcc/
	* combine.c (simplify_comparison): If BITS_BIG_ENDIAN, always assume
	that zero_extracts of const_ints are doing word-sized extractions.

From-SVN: r193026
2012-10-31 08:01:23 +00:00
Richard Sandiford 8e2326a23b combine.c (make_extraction): Remove dead wanted_inner_mode- and pos_rtx-related code.
gcc/
	* combine.c (make_extraction): Remove dead wanted_inner_mode-
	and pos_rtx-related code.

From-SVN: r193025
2012-10-31 08:01:14 +00:00
Steven Bosscher c7fb4c7aae combine.c (record_dead_and_set_regs): Iterate over hard register set with a hard_reg_set_iterator.
* combine.c (record_dead_and_set_regs): Iterate over hard register set
	with a hard_reg_set_iterator.
	* cse.c (invalidate_for_call): Likewise.
	* gcse.c (compute_hash_table_work): Likewise.
	* loop-iv.c (simplify_using_initial_values): Likewise.
	* postreload-gcse.c (record_opr_changes): Likewise.
	* regcprop.c (copyprop_hardreg_forward_1): Likewise.
	* var-tracking.c (dataflow_set_clear_at_call): Likewise.

From-SVN: r192490
2012-10-16 07:46:11 +00:00
Jakub Jelinek a5fdcc3b9c re PR middle-end/54879 (gcc/combine.c:12018: warning: comparison always false due to limited range of data type)
PR middle-end/54879
	* combine.c (count_rtxs): Use RTX_BIN_ARITH resp. RTX_COMM_ARITH
	instead of '2' resp. 'c' for GET_RTX_CLASS comparisons.

From-SVN: r192303
2012-10-10 12:41:39 +02:00
Georg-Johann Lay 5bfed9a91f re PR middle-end/54635 (Add addr_space_t argument to TARGET_MODE_DEPENDENT_ADDRESS_P)
PR middle-end/54635
	* doc/tm.texi.in (TARGET_MODE_DEPENDENT_ADDRESS_P): Document new
	parameter addrspace.
	* doc/tm.texi: Regenerate.
	* target.def (mode_dependent_address_p): Add addr_space_t parameter.
	* targhooks.h (default_mode_dependent_address_p): Ditto.
	* targhooks.c (default_mode_dependent_address_p): Ditto.
	* expr.c (convert_move): Pass address space to mode_dependent_address_p.
	* combine.c (combine_simplify_rtx): Ditto.
	(make_extraction): Ditto.
	(simplify_shift_const_1): Ditto.
	(gen_lowpart_for_combine): Ditto.
	* lower-subreg.c (simple_move_operand): Ditto.
	* recog.c (simplify_while_replacing): Ditto.
	(offsettable_address_addr_space_p): Ditto.
	(mode_dependent_address_p): Ditto.
	* simplify-rtx.c (simplify_unary_operation_1): Ditto.
	(simplify_subreg): Ditto.
	* config/m68k/m68k.md: Ditto.
	* config/vax/vax.md: Ditto.
	* config/vax/constraints.md (Q): Ditto.
	* config/vax/predicates.md (indexed_memory_operand): Ditto.
	* config/alpha/alpha.c (alpha_mode_dependent_address_p): Add
	unused addr_space_t parameter.
	* config/avr/avr.c (avr_mode_dependent_address_p): Ditto.
	* config/h8300/h8300.c (h8300_mode_dependent_address_p): Ditto.
	* config/m32r/m32r.c (m32r_mode_dependent_address_p): Ditto.
	* config/rs6000/rs6000.c (rs6000_mode_dependent_address_p): Ditto.
	* config/rx/rx.c (rx_mode_dependent_address_p): Ditto.
	* config/sparc/sparc.c (sparc_mode_dependent_address_p): Ditto.
	* config/stormy16/stormy16.c (xstormy16_mode_dependent_address_p):
	Ditto.
	* config/vax/vax.c (vax_mode_dependent_address_p): Ditto.
	* config/xtensa/xtensa.c (xtensa_mode_dependent_address_p): Ditto.

From-SVN: r191761
2012-09-26 13:46:29 +00:00
Dehao Chen 5368224f42 Integrate lexical block into source_location.
gcc:
	2012-09-19  Dehao Chen  <dehao@google.com>

	* toplev.c (general_init): Init block_locations.
	* tree.c (tree_set_block): New.
	(tree_block): Change to use LOCATION_BLOCK.
	* tree.h (TREE_SET_BLOCK): New.
	* final.c (reemit_insn_block_notes): Change to use LOCATION_BLOCK.
	(final_start_function): Likewise.
	* input.c (expand_location_1): Likewise.
	* input.h (LOCATION_LOCUS): New.
	(LOCATION_BLOCK): New.
	(IS_UNKNOWN_LOCATION): New.
	* fold-const.c (expr_location_or): Change to use new location.
	* reorg.c (emit_delay_sequence): Likewise.
	(try_merge_delay_insns): Likewise.
	* modulo-sched.c (dump_insn_location): Likewise.
	* lto-streamer-out.c (lto_output_location_bitpack): Likewise.
	* lto-cgraph.c (output_node_opt_summary): Likewise.
	* jump.c (rtx_renumbered_equal_p): Likewise.
	* ifcvt.c (noce_try_move): Likewise.
	(noce_try_store_flag): Likewise.
	(noce_try_store_flag_constants): Likewise.
	(noce_try_addcc): Likewise.
	(noce_try_store_flag_mask): Likewise.
	(noce_try_cmove): Likewise.
	(noce_try_cmove_arith): Likewise.
	(noce_try_minmax): Likewise.
	(noce_try_abs): Likewise.
	(noce_try_sign_mask): Likewise.
	(noce_try_bitop): Likewise.
	(noce_process_if_block): Likewise.
	(cond_move_process_if_block): Likewise.
	(find_cond_trap): Likewise.
	* ipa-prop.c (ipa_set_jf_constant): Likewise.
	(ipa_write_jump_function): Likewise.
	* dwarf2out.c (add_src_coords_attributes): Likewise.
	* expr.c (expand_expr_real): Likewise.
	* tree-parloops.c (create_loop_fn): Likewise.
	* recog.c (peep2_attempt): Likewise.
	* function.c (free_after_compilation): Likewise.
	(expand_function_end): Likewise.
	(set_insn_locations): Likewise.
	(thread_prologue_and_epilogue_insns): Likewise.
	* print-rtl.c (print_rtx): Likewise.
	* profile.c (branch_prob): Likewise.
	* trans-mem.c (ipa_tm_scan_irr_block): Likewise.
	* gimplify.c (gimplify_call_expr): Likewise.
	* except.c (duplicate_eh_regions_1): Likewise.
	* emit-rtl.c (try_split): Likewise.
	(make_insn_raw): Likewise.
	(make_debug_insn_raw): Likewise.
	(make_jump_insn_raw): Likewise.
	(make_call_insn_raw): Likewise.
	(emit_pattern_after_setloc): Likewise.
	(emit_pattern_after): Likewise.
	(emit_debug_insn_after): Likewise.
	(emit_pattern_before): Likewise.
	(emit_insn_before_setloc): Likewise.
	(emit_jump_insn_before): Likewise.
	(emit_call_insn_before_setloc): Likewise.
	(emit_call_insn_before): Likeise.
	(emit_debug_insn_before_setloc): Likewise.
	(emit_copy_of_insn_after): Likewise.
	(insn_locators_alloc): Remove.
	(insn_locators_finalize): Remove.
	(insn_locators_free): Remove.
	(set_curr_insn_source_location): Remove.
	(get_curr_insn_source_location): Remove.
	(set_curr_insn_block): Remove.
	(get_curr_insn_block): Remove.
	(locator_scope): Remove.
	(insn_scope): Change to use new location.
	(locator_location): Remove.
	(insn_line): Change to use new location.
	(locator_file): Remove.
	(insn_file): Change to use new location.
	(locator_eq): Remove.
	(insn_locations_init): New.
	(insn_locations_finalize): New.
	(set_curr_insn_location): New.
	(curr_insn_location): New.
	* cfgexpand.c (gimple_assign_rhs_to_tree): Change to use new location.
	(expand_gimple_cond): Likewise.
	(expand_call_stmt): Likewise.
	(expand_gimple_stmt_1): Likewise.
	(expand_gimple_basic_block): Likewise.
	(construct_exit_block): Likewise.
	(gimple_expand_cfg): Likewise.
	* cfgcleanup.c (try_forward_edges): Likewise.
	* tree-ssa-live.c (remove_unused_scope_block_p): Likewise.
	(dump_scope_block): Likewise.
	(remove_unused_locals): Likewise.
	* rtl.c (rtx_equal_p_cb): Likewise.
	(rtx_equal_p): Likewise.
	* rtl.h (XUINT): New.
	(INSN_LOCATOR): Remove.
	(CURR_INSN_LOCATION): Remove.
	(INSN_LOCATION): New.
	(INSN_HAS_LOCATION): New.
	* tree-inline.c (remap_gimple_op_r): Change to use new location.
	(copy_tree_body_r): Likewise.
	(copy_phis_for_bb): Likewise.
	(expand_call_inline): Likewise.
	* tree-streamer-in.c (lto_input_ts_exp_tree_pointers): Likewise.
	* tree-streamer-out.c (write_ts_decl_minimal_tree_pointers): Likewise.
	* gimple-streamer-out.c (output_gimple_stmt): Likewise.
	* combine.c (try_combine): Likewise.
	* tree-outof-ssa.c (set_location_for_edge): Likewise.
	(insert_partition_copy_on_edge): Likewise.
	(insert_value_copy_on_edge): Likewise.
	(insert_rtx_to_part_on_edge): Likewise.
	(insert_part_to_rtx_on_edge): Likewise.
	* basic-block.h (edge_def): Remove field.
	* gimple.h (gimple_statement_base): Remove field.
	(gimple_bb): Change to use new location.
	(gimple_set_block): Likewise.
	(gimple_has_location): Likewise.
	* tree-cfg.c (make_cond_expr_edges): Likewise.
	(make_goto_expr_edges): Likewise.
	(gimple_can_merge_blocks_p): Likewise.
	(move_stmt_op): Likewise.
	(move_block_to_fn): Likewise.
	* config/alpha/alpha.c (alpha_output_mi_thunk_osf): Likewise.
	* config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.
	* config/i386/i386.c (x86_output_mi_thunk): Likewise.
	* config/tilegx/tilegx.c (tilegx_output_mi_thunk): Likewise.
	* config/sh/sh.c (sh_output_mi_thunk): Likewise.
	* config/ia64/ia64.c (ia64_output_mi_thunk): Likewise.
	* config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise.
	* config/score/score.c (score_output_mi_thunk): Likewise.
	* config/tilepro/tilepro.c (tilepro_asm_output_mi_thunk): Likewise.
	* config/mips/mips.c (mips_output_mi_thunk): Likewise.
	* cfgrtl.c (unique_locus_on_edge_between_p): Likewise.
	(unique_locus_on_edge_between_p): Likewise.
	(emit_nop_for_unique_locus_between): Likewise.
	(force_nonfallthru_and_redirect): Likewise.
	(fixup_reorder_chain): Likewise.
	(cfg_layout_merge_blocks): Likewise.
	* stmt.c (emit_case_nodes): Likewise.

gcc/lto:
	2012-09-19  Dehao Chen  <dehao@google.com>

	* lto/lto.c (lto_fixup_prevailing_decls): Remove tree.exp.block field.

libcpp:
	2012-09-19  Dehao Chen  <dehao@google.com>

	* include/line-map.h (MAX_SOURCE_LOCATION): New value.
	(location_adhoc_data_fini): New.
	(get_combined_adhoc_loc): New.
	(get_data_from_adhoc_loc): New.
	(get_location_from_adhoc_loc): New.
	(location_adhoc_data_map): New.
	(COMBINE_LOCATION_DATA): New.
	(IS_ADHOC_LOC): New.
	(expanded_location): New field.
	(line_maps): New field.
	* line-map.c (location_adhoc_data): New.
	(location_adhoc_data_hash): New.
	(location_adhoc_data_eq): New.
	(location_adhoc_data_update): New.
	(get_combined_adhoc_loc): New.
	(get_data_from_adhoc_loc): New.
	(get_location_from_adhoc_loc): New.
	(location_adhoc_data_init): New.
	(location_adhoc_data_fini): New.
	(linemap_init): Initialize location_adhoc_data.
	(linemap_lookup): Change to use new location.
	(linemap_ordinary_map_lookup): Likewise.
	(linemap_macro_map_lookup): Likewise.
	(linemap_macro_map_loc_to_def_point): Likewise.
	(linemap_macro_map_loc_unwind_toward_spel): Likewise.
	(linemap_get_expansion_line): Likewise.
	(linemap_get_expansion_filename): Likewise.
	(linemap_location_in_system_header_p): Likewise.
	(linemap_location_from_macro_expansion_p): Likewise.
	(linemap_macro_loc_to_spelling_point): Likewise.
	(linemap_macro_loc_to_def_point): Likewise.
	(linemap_macro_loc_to_exp_point): Likewise.
	(linemap_resolve_location): Likewise.
	(linemap_unwind_toward_expansion): Likewise.
	(linemap_unwind_to_first_non_reserved_loc): Likewise.
	(linemap_expand_location): Likewise.
	(linemap_dump_location): Likewise.
	(linemap_line_start): Likewise.

From-SVN: r191494
2012-09-19 19:56:42 +00:00
Lawrence Crowl 27bcd47cfa Modify gcc/*.[hc] double_int call sites to use the new interface.
This change entailed adding a few new methods to double_int.

The change results in a 0.163% time improvement with a 70% confidence.

Tested on x86_64.


Index: gcc/ChangeLog

2012-09-06  Lawrence Crowl  <crowl@google.com>

	* double-int.h (double_int::operator &=): New.
	(double_int::operator ^=): New.
	(double_int::operator |=): New.
	(double_int::mul_with_sign): Modify overflow parameter to bool*.
	(double_int::add_with_sign): New.
	(double_int::ule): New.
	(double_int::sle): New.
	(binary double_int::operator *): Remove parameter name.
	(binary double_int::operator +): Likewise.
	(binary double_int::operator -): Likewise.
	(binary double_int::operator &): Likewise.
	(double_int::operator |): Likewise.
	(double_int::operator ^): Likewise.
	(double_int::and_not): Likewise.
	(double_int::from_shwi): Tidy formatting.
	(double_int::from_uhwi): Likewise.
	(double_int::from_uhwi): Likewise.
	* double-int.c (double_int::mul_with_sign): Modify overflow parameter
	to bool*.
	(double_int::add_with_sign): New.
	(double_int::ule): New.
	(double_int::sle): New.
	* builtins.c: Modify to use the new double_int interface.
	* cgraph.c: Likewise.
	* combine.c: Likewise.
	* dwarf2out.c: Likewise.
	* emit-rtl.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* fixed-value.c: Likewise.
	* fold-const.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimplify-rtx.c: Likewise.
	* ipa-prop.c: Likewise.
	* loop-iv.c: Likewise.
	* optabs.c: Likewise.
	* stor-layout.c: Likewise.
	* tree-affine.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-flow-inline.h: Likewise.
	* tree-object-size.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-sccvn: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree.h: Likewise.
	* tree.c: Likewise.
	* varasm.c: Likewise.

From-SVN: r191047
2012-09-07 00:06:35 +00:00
Uros Bizjak 78e4f1ad4e target.def (legitimate_combined_insn): New target hook.
* target.def (legitimate_combined_insn): New target hook.
	* doc/tm.texi.in (TARGET_LEGITIMATE_COMBINED_INSN): New hook.
	* doc/tm.texi: Regenerated.
	* combine.c (recog_for_combine): Call targetm.legitimate_combined_insn
	to allow targets to reject combined insn.
	* hooks.h (hook_bool_rtx_true): New.
	* hooks.c (hook_bool_rtx_true): Ditto.

From-SVN: r190846
2012-09-01 16:26:28 +02:00
Kenneth Zadeck d81168901e alias.c (rtx_equal_for_memref_p): Convert constant cases.
2012-08-23  Kenneth Zadeck <zadeck@naturalbridge.com>

	* alias.c (rtx_equal_for_memref_p): Convert constant cases.
	* combine.c (find_single_use_1, mark_used_regs_combine): Convert
	to CASE_CONST_ANY.
 	* cse.c (exp_equiv_p, canon_reg, fold_rtx, cse_process_notes_1,
	count_reg_usage): Convert constant cases.
	* cselib.c (cselib_expand_value_rtx_1): Convert to
	CASE_CONST_ANY.
	(cselib_subst_to_values): Convert constant cases.
	* df-scan.c (df_uses_record): Ditto.
	* dse.c (const_or_frame_p): Convert case statements to explicit
	if-then-else using mode classes.
	* emit-rtl.c (verify_rtx_sharing, copy_insn_1): Convert constant cases.
	* explow.c (convert_memory_address_addr_space): Ditto.
	* gcse.c (want_to_gcse_p, oprs_unchanged_p, compute_transp): Ditto.
	* genattrtab.c (attr_copy_rtx, clear_struct_flag): Ditto.
	* ira.c (equiv_init_varies_p, contains_replace_regs,
	memref_referenced_p, rtx_moveable_p): Ditto.
	* jump.c (mark_jump_label_1): Remove constant cases.
	(rtx_renumbered_equal_p): Convert to CASE_CONST_UNIQUE.
	* loop-invariant.c (check_maybe_invariant, hash_invariant_expr_1,
	invariant_expr_equal_p): Convert to CASE_CONST_ANY.
	* postreload-gcse.c (oprs_unchanged_p): Convert constant cases.
	* reginfo.c (reg_scan_mark_refs): Ditto.
	* regrename.c (scan_rtx): Ditto.
	* reload1.c (eliminate_regs_1, elimination_effects,
	scan_paradoxical_subregs): Ditto.
	* reload.c (operands_match_p, subst_reg_equivs):  Ditto.
	* resource.c (mark_referenced_resources, mark_set_resources): Ditto.
	* rtlanal.c (rtx_unstable_p, rtx_varies_p, count_occurrences)
	(reg_mentioned_p, modified_between_p, modified_in_p)
	(volatile_insn_p, volatile_refs_p, side_effects_p, may_trap_p_1,
	inequality_comparisons_p, computed_jump_p_1): Ditto.
	* rtl.c (copy_rtx, rtx_equal_p_cb, rtx_equal_p): Ditto.
	* sched-deps.c (sched_analyze_2): Ditto.
	* valtrack.c (cleanup_auto_inc_dec): Ditto.
	* rtl.h: (CASE_CONST_SCALAR_INT, CASE_CONST_UNIQUE, 
	CASE_CONST_ANY): New macros.

From-SVN: r190627
2012-08-23 18:46:18 +00:00
Diego Novillo 0823efedd0 backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html...
Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion).

As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch
changes the default bootstrap process so that stage 1 always builds with a C++
compiler.

Other than the bootstrap change, the patch makes no functional changes to the
compiler.  Everything should build as it does now in trunk.  The main
changes in this patch are:

1- Configuration changes.
2- Re-write of VEC.
3- Re-write of gengtype to support C++ templates and
   user-provided marking functions.
4- New hash table class.
5- Re-write double_int.
6- Implement tree macros as inline functions so they can be
   called from gdb.

As discussed before, several of these changes do not fully change
the call sites to use the new APIs.

The bootstrap changes have already been tested on a wide range of
targets (http://gcc.gnu.org/wiki/CppBuildStatus).  Additionally,
I have tested the merged trunk on: x86_64-unknown-linux-gnu,
mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu,
i686-pc-linux-gnu, and ia64-unknown-linux-gnu.

ChangeLog
2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.

	* Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove
	POSTSTAGE1_CONFIGURE_FLAGS.
	* Makefile.in: Regenerate.
	* configure.ac (ENABLE_BUILD_WITH_CXX): Remove.  Update all users.
	Force C++ when bootstrapping.
	* configure: Regenerate.


libcpp/ChangeLog
2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Configury.

	* Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
	* configure.ac: Likewise.
	* configure: Regenerate.

2012-08-14   Lawrence Crowl  <crowl@google.com>

	Merge from cxx-conversion branch.  New C++ hash table.

	* include/symtab.h (typedef struct ht hash_table): Change the typedef
	name to cpp_hash_table.  Update all users of the typedef.

gcc/ChangeLog
2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Configury.

	* configure.ac (CXX_FOR_BUILD): Define and substitute.
	(BUILD_CXXFLAGS): Define.
	Remove all handlers of ENABLE_BUILD_WITH_CXX.
	Force all build to be with C++.
	* Makefile.in (BUILD_CXXFLAGS): Use it.
	Remove all handlers of ENABLE_BUILD_WITH_CXX.
	* configure: Regenerate.
	* config.in: Regenerate.
	* doc/install.texi: Remove documentation for --enable-build-with-cxx
	and --enable-build-poststage1-with-cxx.

2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Re-implement VEC in C++.

	* vec.c (vec_heap_free): Convert into a template function.
	(vec_gc_o_reserve_1): Make extern.
	(vec_gc_p_reserve): Remove.
	(vec_gc_p_reserve_exact): Remove.
	(vec_gc_o_reserve): Remove.
	(vec_gc_o_reserve_exact): Remove.
	(vec_heap_o_reserve_1): Make extern.
	(vec_heap_p_reserve): Remove.
	(vec_heap_p_reserve_exact): Remove.
	(vec_heap_o_reserve): Remove.
	(vec_heap_o_reserve_exact): Remove.
	(vec_stack_p_reserve): Remove.
	(vec_stack_p_reserve_exact): Remove.
	* vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS,
	VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier
	in the file.
	(VEC): Define to vec_t<T>.
	(vec_allocation_t): Define.
	(struct vec_prefix): Move earlier in the file.
	(vec_t<T>): New template.
	(DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P,
	DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O,
	DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK,
	DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'.
	(DEF_VEC_A): Provide template instantiations for
	GC/PCH markers that do not traverse the vector.
	(vec_stack_p_reserve): Remove.
	(vec_stack_p_reserve_exact): Remove.
	(vec_stack_p_reserve_exact_1): Remove.
	(vec_stack_o_reserve): Remove.
	(vec_stack_o_reserve_exact): Remove.
	(vec_stack_free): Re-write as a template function.
	(vec_reserve): New template function.
	(vec_reserve_exact): New template function.
	(vec_heap_free): New template function if GATHER_STATISTICS is
	defined.  Otherwise, macro that expands to free().
	(VEC_length_1): New template function.
	(VEC_length): Call it.
	(VEC_empty_1): New template function.
	(VEC_empty): Call it.
	(VEC_address_1): New template function.
	(VEC_address): Call it.
	(VEC_last_1): New template function.
	(VEC_last): Call it.  Change return type to T&.
	Change all users that used VEC_Os.
	(VEC_index_1): New template function.
	(VEC_index): Call it.  Return a T& instead of a T*.
	Update all callers that were using VEC_O before.
	(VEC_iterate_1): New template function.
	(VEC_iterate): Call it.
	(VEC_embedded_size_1): New template function.
	(VEC_embedded_size): Call it.
	(VEC_embedded_init_1): New template function.
	(VEC_embedded_init): Call it.
	(VEC_alloc_1): New template function.
	(VEC_alloc): Call it.  If A is 'stack', call XALLOCAVAR to
	do the allocation.
	(VEC_free_1): New template function.
	(VEC_free): Call it.
	(VEC_copy_1): New template function.
	(VEC_copy): Call it.
	(VEC_space_1): New template function
	(VEC_space): Call it.
	(VEC_reserve_1): New template function.
	(VEC_reserve): Call it.
	(VEC_reserve_exact_1): New template function.
	(VEC_reserve_exact): Call it.
	(VEC_splice_1): New template function.
	(VEC_splice): Call it.
	(VEC_safe_splice_1): New template function.
	(VEC_safe_splice): Call it.
	(VEC_quick_push_1): New template function.  Create two overloads, one
	accepting T, the other accepting T *.  Update all callers
	where T and T * are ambiguous.
	(VEC_quick_push): Call it.
	(VEC_safe_push_1): New template function. Create two overloads, one
	accepting T, the other accepting T *.  Update all callers
	where T and T * are ambiguous.
	(VEC_safe_push): Call it.
	(VEC_pop_1): New template function.
	(VEC_pop): Call it.
	(VEC_truncate_1): New template function.
	(VEC_truncate): Call it.
	(VEC_safe_grow_1): New template function.
	(VEC_safe_grow): Call it.
	(VEC_safe_grow_cleared_1): New template function.
	(VEC_safe_grow_cleared): Call it.
	(VEC_replace_1): New template function.
	(VEC_replace): Call it.  Always accept T instead of T*.
	Update all callers that used VEC_Os.
	(VEC_quick_insert_1): New template function.
	(VEC_quick_insert): Call it.
	(VEC_safe_insert_1): New template function.
	(VEC_safe_insert): Call it.
	(VEC_ordered_remove_1): New template function.
	(VEC_ordered_remove): Call it.
	(VEC_unordered_remove_1): New template function.
	(VEC_unordered_remove): Call it.
	(VEC_block_remove_1): New template function.
	(VEC_block_remove): Call it.
	(VEC_lower_bound_1): New template function.
	(VEC_lower_bound): Call it.
	(VEC_OP): Remove.
	(DEF_VEC_FUNC_P): Remove.
	(DEF_VEC_ALLOC_FUNC_P): Remove.
	(DEF_VEC_NONALLOC_FUNCS_P): Remove.
	(DEF_VEC_FUNC_O): Remove.
	(DEF_VEC_ALLOC_FUNC_O): Remove.
	(DEF_VEC_NONALLOC_FUNCS_O): Remove.
	(DEF_VEC_ALLOC_FUNC_I): Remove.
	(DEF_VEC_NONALLOC_FUNCS_I): Remove.
	(DEF_VEC_ALLOC_FUNC_P_STACK): Remove.
	(DEF_VEC_ALLOC_FUNC_O_STACK): Remove.
	(DEF_VEC_ALLOC_FUNC_I_STACK): Remove.
	(vec_reserve_exact): New template function.

	* gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove.
	* gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP].
	(typedef_name): Emit vec_t<C1> instead of VEC_C1_C2.
	(def_vec_alloc): Remove.  Update all callers.
	* gengtype.c (filter_type_name): New.
	(output_mangled_typename): Call it.
	(write_func_for_structure): Likewise.
	(write_types): Likewise.
	(write_root): Likewise.
	(write_typed_alloc_def): Likewise.
	(note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base.
	(note_def_vec_alloc): Remove.
	* gengtype.h (note_def_vec_alloc): Remove.
	(DEFVEC_ALLOC): Remove token code.

	* df-scan.c (df_bb_verify): Remove call to df_free_collection_rec
	inside the insn traversal loop.
	* gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK.
	* ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP.
	* reg-stack.c (stack): Rename to STACK_PTR.  Update all users.
	* tree-vrp.c (stack): Rename to EQUIV_STACK.  Update all users.

	* config/bfin/bfin.c (hwloop_optimize): Update some calls to
	VEC_* for vectors of non-pointers.
	* config/c6x/c6x.c (try_rename_operands): Likewise.
	(reshuffle_units): Likewise.
	* config/mips/mips.c (mips_multi_start): Likewise.
	(mips_multi_add): Likewise.
	(mips_multi_copy_insn): Likewise.
	(mips_multi_set_operand): Likewise.
	* hw-doloop.c (discover_loop): Likewise.
	(discover_loops): Likewise.
	(reorg_loops): Likewise.

2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  C++ support in gengtype.

	* coretypes.h (gt_pointer_operator): Move from ...
	* ggc.h: ... here.
	* doc/gty.texi: Document support for C++ templates and
	user-provided markers.
	* gcc/gengtype-lex.l: Update copyright year.
	Remove support for recognizing DEF_VEC_O, DEF_VEC_P and
	DEFVEC_I.
	* gengtype-parse.c: Update copyright year.
	(token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I.
	(require_template_declaration): New.
	(typedef_name): Call it.
	(type): Replace IS_UNION with KIND. Replace all users.
	(def_vec): Remove.  Update all users.
	* gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT.
	(write_state_user_struct_type): New.
	(write_state_type): Call it.
	(read_state_user_struct_type): New.
	(read_state_type): Call it.
	* gengtype.c: Update copyright year.
	(dump_pair): Move declaration to the top.
	(dump_type): Likewise.
	(dump_type_list): Likewise.
	(dbgprint_count_type_at): Handle TYPE_USER_STRUCT.
	(create_user_defined_type): New.
	(resolve_typedef): Call it.
	(new_structure): Replace argument ISUNION with KIND.
	Change users to refer to KIND directly.
	Update all callers.
	(find_structure): Likewise.
	(set_gc_used_type): Handle TYPE_USER_STRUCT.
	(create_file): Update HDR to include new copyright year.
	(struct walk_type_data): Add field IN_PTR_FIELD.
	(output_mangled_typename): Handle TYPE_USER_STRUCT.
	(walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER.
	Clear it afterwards.
	Handle TYPE_USER_STRUCT.
	(write_types_process_field): Handle TYPE_USER_STRUCT.
	(get_type_specifier): Move earlier in the file.
	(write_type_decl): New.
	(write_marker_function_name): New.
	(write_user_func_for_structure_ptr): New.
	(write_user_func_for_structure_body): New.
	(write_user_marking_functions): New.
	(write_func_for_structure): Call write_marker_function_name
	and write_type_decl.
	Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user
	function directly.
	Call write_user_marking_functions on TYPE_USER_STRUCTs.
	(write_types_local_user_process_field): New.
	(write_pch_user_walking_for_structure_body): New.
	(write_pch_user_walking_functions): New.
	(write_types_local_process_field): Handle TYPE_USER_STRUCT.
	(write_local_func_for_structure): Do not call walk_type for
	TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly.
	Call write_pch_user_walking_functions for TYPE_USER_STRUCTs.
	(write_root): Handle TYPE_USER_STRUCT.
	(vec_prefix_type): Remove.  Update all users.
	(note_def_vec): Remove.  Update all users.
	(dump_typekind): Handle TYPE_USER_STRUCT.
	(dump_type): Initialize SEEN_TYPES, if needed.
	Handle TYPE_USER_STRUCT.
	(dump_everything): Do not initialize SEEN_TYPES.
	* gengtype.h: Update copyright year.
	(enum typekind): Add TYPE_USER_STRUCT.
	(union_or_struct_p): Rename from UNION_OR_STRUCT_P.
	Convert into function.
	Add an overload taking const_type_p.
	Update all callers.
	(new_structure): Change second field to type enum typekind.
	Update all users.
	(find_structure): Likewise.
	(note_def_vec): Remove.
	(DEFVEC_OP): Remove.
	(DEFVEC_I): Remove.
	* ggc-page.c (gt_ggc_mx): Add entry points for marking
	'const char *&', 'unsigned char *&' and 'unsigned char&'.
	* ggc-zone.c (gt_ggc_mx): Add entry points for marking
	'const char *&' and 'unsigned char *&'.
	* stringpool.c (gt_pch_nx): Add entry points for marking
	'const char *&', 'unsigned char *&' and 'unsigned char&'.
	Add an entry point for the overload taking arguments 'unsigned char
	*', 'gt_pointer_operator' and 'void *'.
	* vec.h (struct vec_prefix): Remove GTY marker.
	(struct vec_t): Remove GTY((length)) attribute from field 'vec'.
	(gt_ggc_mx (vec_t<T> *)): New template function.
	(gt_pch_nx (vec_t<T> *)): New template function.
	(gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template
	function.
	(gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template
	function.

	* basic-block.h (struct edge_def): Mark GTY((user)).
	Remove all GTY markers from fields.
	(gt_ggc_mx): Declare.
	(gt_pch_nx): Declare.
	* tree-cfg.c (gt_ggc_mx): New.
	(gt_pch_nx): New.

	* gengtype-lex.l (USER_GTY): Add pattern for "user".
	* gengtype-parse.c (option): Handle USER_GTY.
	(opts_have): New.
	(type): Call it.
	If the keyword 'user' is used, do not walk the fields
	of the structure.
	* gengtype.h (USER_GTY): Add.
	* doc/gty.texi: Update.

2012-08-14   Lawrence Crowl  <crowl@google.com>

	Merge cxx-conversion branch.  Implement C++ hash table.

	* hash-table.h: New. Implementation borrowed from libiberty/hashtab.c.
	* hash-table.c: Likewise.
	* tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h.
	(static htab_t same_succ_htab): Change type to hash_table;
	move specification of helper functions from create call to declaration.
	Change users to invoke member functions.
	(same_succ_print_traverse): Make extern ssa_.... Change callers.
	Remove void* casting.
	(same_succ_hash): Likewise.
	(same_succ_equal): Likewise.
	(same_succ_delete): Likewise.
	* tree-ssa-threadupdate.c: Include hash-table.h.
	(struct local_info): Rename to ssa_local_info_t to avoid overloading
	the type name local_info with the variable name local_info.
	(static htab_t redirection_data): Change type to hash_table.
	Move specification of helper functions from create call to declaration.
	Change users to invoke member functions.
	(redirection_data_hash): Make extern ssa_.... Change callers.
	Remove void* casting.
	(redirection_data_eq): Likewise.
	(fix_duplicate_block_edges): Likewise.
	(create_duplicates): Likewise.
	(fixup_template_block): Likewise.
	(redirect_edges): Likewise.
	(lookup_redirection_data): Change types associated with the hash table
	from void* to their actual type. Remove unnecessary casts.
	* tree-ssa-ccp.c: Include hash-table.h.
	(typedef gimple_htab): New.  Uses hash_table.  Replace specific uses
	of htab_t with gimple_htab.  Change users to invoke member functions.
	Move specification of helper functions from create call to declaration.
	* tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h.
	(hash_ssa_name_by_var): Make extern. Remove void* casting.
	(eq_ssa_name_by_var): Likewise.
	(coalesce_ssa_name): Change type of local static htab_t ssa_name_hash
	to hash_table. Change users to invoke member functions.
	Move specification of helper functions from create call to declaration.
	* coverage.c: Include hash-table.h instead of hashtab.h.
	(static htab_t counts_hash): Change type to hash_table;
	move specification of helper functions from create call to declaration.
	Change users to invoke member functions.
	(htab_counts_entry_hash): Make extern. Rename with coverage_... instead
	of htab_... Remove void* casting.
	(htab_counts_entry_eq): Likewise.
	(htab_counts_entry_del): Likewise.
	* tree-ssa-pre.c: Include hash-table.h instead of hashtab.h.
	(static htab_t expression_to_id): Change type to hash_table.
	Move specification of helper functions from create call to declaration.
	Change users to invoke member functions.
	(static htab_t phi_translate_table): Likewise.
	(pre_expr_eq): Make extern ssa_.... Change callers.
	Remove void* casting.
	(pre_expr_hash): Likewise.
	(expr_pred_trans_hash): Likewise.
	(expr_pred_trans_eq): Likewise.
	(alloc_expression_id): Change types associated with the hash table
	from void* to their actual type. Remove unnecessary casts.
	(lookup_expression_id): Likewise.
	(phi_trans_lookup): Likewise.
	(phi_trans_add): Likewise.
	* stringpool.c: Rename uses of libcpp typedef hash_table to
	cpp_hash_table.
	* Makefile.in: Add hash-table.o to OBJS-libcommon-target.
	Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H).

2012-08-14   Lawrence Crowl  <crowl@google.com>

	Merge from cxx-conversion branch.  Re-write double_int in C++.

	* hash-table.h
	(typedef double_int): Change to struct (POD).
	(double_int::make): New overloads for int to double-int conversion.
	(double_int::mask): New.
	(double_int::max_value): New.
	(double_int::min_value): New.
	(double_int::operator ++): New.
	(double_int::operator --): New.
	(double_int::operator *=): New.
	(double_int::operator +=): New.
	(double_int::operator -=): New.
	(double_int::to_signed): New.
	(double_int::to_unsigned): New.
	(double_int::fits_unsigned): New.
	(double_int::fits_signed): New.
	(double_int::fits): New.
	(double_int::trailing_zeros): New.
	(double_int::popcount): New.
	(double_int::multiple_of): New.
	(double_int::set_bit): New.
	(double_int::mul_with_sign): New.
	(double_int::operator * (binary)): New.
	(double_int::operator + (binary)): New.
	(double_int::operator - (binary)): New.
	(double_int::operator - (unary)): New.
	(double_int::operator ~ (unary)): New.
	(double_int::operator & (binary)): New.
	(double_int::operator | (binary)): New.
	(double_int::operator ^ (binary)): New.
	(double_int::and_not): New.
	(double_int::lshift): New.
	(double_int::rshift): New.
	(double_int::alshift): New.
	(double_int::arshift): New.
	(double_int::llshift): New.
	(double_int::lrshift): New.
	(double_int::lrotate): New.
	(double_int::rrotate): New.
	(double_int::div): New.
	(double_int::sdiv): New.
	(double_int::udiv): New.
	(double_int::mod): New.
	(double_int::smod): New.
	(double_int::umod): New.
	(double_int::divmod): New.
	(double_int::sdivmod): New.
	(double_int::udivmod): New.
	(double_int::ext): New.
	(double_int::zext): New.
	(double_int::sext): New.
	(double_int::is_zero): New.
	(double_int::is_one): New.
	(double_int::is_minus_one): New.
	(double_int::is_negative): New.
	(double_int::cmp): New.
	(double_int::ucmp): New.
	(double_int::scmp): New.
	(double_int::ult): New.
	(double_int::ugt): New.
	(double_int::slt): New.
	(double_int::sgt): New.
	(double_int::max): New.
	(double_int::smax): New.
	(double_int::umax): New.
	(double_int::min): New.
	(double_int::smin): New.
	(double_int::umin): New.
	(double_int::operator ==): New.
	(double_int::operator !=): New.
	(shwi_to_double_int): Change implementation to use member function.
	(double_int_minus_one): Likewise.
	(double_int_zero): Likewise.
	(double_int_one): Likewise.
	(double_int_two): Likewise.
	(double_int_ten): Likewise.
	(uhwi_to_double_int): Likewise.
	(double_int_to_shwi): Likewise.
	(double_int_to_uhwi): Likewise.
	(double_int_fits_in_uhwi_p): Likewise.
	(double_int_fits_in_shwi_p): Likewise.
	(double_int_fits_in_hwi_p): Likewise.
	(double_int_mul): Likewise.
	(double_int_mul_with_sign): Likewise.
	(double_int_add): Likewise.
	(double_int_sub): Likewise.
	(double_int_neg): Likewise.
	(double_int_div): Likewise.
	(double_int_sdiv): Likewise.
	(double_int_udiv): Likewise.
	(double_int_mod): Likewise.
	(double_int_smod): Likewise.
	(double_int_umod): Likewise.
	(double_int_divmod): Likewise.
	(double_int_sdivmod): Likewise.
	(double_int_udivmod): Likewise.
	(double_int_multiple_of): Likewise.
	(double_int_setbit): Likewise.
	(double_int_ctz): Likewise.
	(double_int_not): Likewise.
	(double_int_ior): Likewise.
	(double_int_and): Likewise.
	(double_int_and_not): Likewise.
	(double_int_xor): Likewise.
	(double_int_lshift): Likewise.
	(double_int_rshift): Likewise.
	(double_int_lrotate): Likewise.
	(double_int_rrotate): Likewise.
	(double_int_cmp): Likewise.
	(double_int_scmp): Likewise.
	(double_int_ucmp): Likewise.
	(double_int_max): Likewise.
	(double_int_smax): Likewise.
	(double_int_umax): Likewise.
	(double_int_min): Likewise.
	(double_int_smin): Likewise.
	(double_int_umin): Likewise.
	(double_int_ext): Likewise.
	(double_int_sext): Likewise.
	(double_int_zext): Likewise.
	(double_int_mask): Likewise.
	(double_int_max_value): Likewise.
	(double_int_min_value): Likewise.
	(double_int_zero_p): Likewise.
	(double_int_one_p): Likewise.
	(double_int_minus_one_p): Likewise.
	(double_int_equal_p): Likewise.
	(double_int_popcount): Likewise.
	* hash-table.c
	(double_int_mask): Reuse implementation for double_int::mask.
	(double_int_max_value): Likewise.
	(double_int_min_value): Likewise.
	(double_int_ext): Likewise.
	(double_int_zext): Likewise.
	(double_int_sext): Likewise.
	(double_int_mul_with_sign): Likewise.
	(double_int_divmod): Likewise.
	(double_int_sdivmod): Likewise.
	(double_int_udivmod): Likewise.
	(double_int_div): Likewise.
	(double_int_sdiv): Likewise.
	(double_int_udiv): Likewise.
	(double_int_mod): Likewise.
	(double_int_smod): Likewise.
	(double_int_umod): Likewise.
	(double_int_multiple_of): Likewise.
	(double_int_lshift): Likewise.
	(double_int_rshift): Likewise.
	(double_int_lrotate): Likewise.
	(double_int_rrotate): Likewise.
	(double_int_cmp): Likewise.
	(double_int_ucmp): Likewise.
	(double_int_scmp): Likewise.
	(double_int_max): Likewise.
	(double_int_smax): Likewise.
	(double_int_umax): Likewise.
	(double_int_min): Likewise.
	(double_int_smin): Likewise.
	(double_int_umin): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int::alshift): New.
	(double_int::arshift): New.
	(double_int::llshift): New.
	(double_int::lrshift): New.
	(double_int::ult): New.
	(double_int::ugt): New.
	(double_int::slt): New.
	(double_int::sgt): New.
	(double_int_setbit): Reuse implementation for double_int::set_bit,
	which avoids a name conflict with a macro.
	(double_int_double_int_ctz): Reuse implementation for
	double_int::trailing_zeros.
	(double_int_fits_in_shwi_p): Reuse implementation for
	double_int::fits_signed.
	(double_int_fits_in_hwi_p): Reuse implementation for double_int::fits.
	(double_int_mul): Reuse implementation for binary
	double_int::operator *.
	(double_int_add): Likewise.
	(double_int_sub): Likewise.
	(double_int_neg): Reuse implementation for unary
	double_int::operator -.
	(double_int_max_value): Likewise.
	* fixed-value.c: Change to use member functions introduced above.

2012-08-14   Lawrence Crowl  <crowl@google.com>

	Merge cxx-conversion branch.  Support tree macro calling
	from gdb.

	* tree.h (tree_check): New.
	(TREE_CHECK): Use inline function above instead of __extension__.
	(tree_not_check): New.
	(TREE_NOT_CHECK): Use inline function above instead of __extension__.
	(tree_check2): New.
	(TREE_CHECK2): Use inline function above instead of __extension__.
	(tree_not_check2): New.
	(TREE_NOT_CHECK2): Use inline function above instead of __extension__.
	(tree_check3): New.
	(TREE_CHECK3): Use inline function above instead of __extension__.
	(tree_not_check3): New.
	(TREE_NOT_CHECK3): Use inline function above instead of __extension__.
	(tree_check4): New.
	(TREE_CHECK4): Use inline function above instead of __extension__.
	(tree_not_check4): New.
	(TREE_NOT_CHECK4): Use inline function above instead of __extension__.
	(tree_check5): New.
	(TREE_CHECK5): Use inline function above instead of __extension__.
	(tree_not_check5): New.
	(TREE_NOT_CHECK5): Use inline function above instead of __extension__.
	(contains_struct_check): New.
	(CONTAINS_STRUCT_CHECK): Use inline function above instead of
	__extension__.
	(tree_class_check): New.
	(TREE_CLASS_CHECK): Use inline function above instead of __extension__.
	(tree_range_check): New.
	(TREE_RANGE_CHECK): Use inline function above instead of __extension__.
	(omp_clause_subcode_check): New.
	(OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of
	__extension__.
	(omp_clause_range_check): New.
	(OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of
	__extension__.
	(expr_check): New.
	(EXPR_CHECK): Use inline function above instead of __extension__.
	(non_type_check): New.
	(NON_TYPE_CHECK): Use inline function above instead of __extension__.
	(tree_vec_elt_check): New.
	(TREE_VEC_ELT_CHECK): Use inline function above instead of
	__extension__.
	(omp_clause_elt_check): New.
	(OMP_CLAUSE_ELT_CHECK): Use inline function above instead of
	__extension__.
	(tree_operand_check): New.
	(TREE_OPERAND_CHECK): Use inline function above instead of
	__extension__.
	(tree_operand_check_code): New.
	(TREE_OPERAND_CHECK_CODE): Use inline function above instead of
	__extension__.
	(TREE_CHAIN): Simplify implementation.
	(TREE_TYPE): Simplify implementation.
	(tree_operand_length): Move for compilation dependences.
	* gdbinit.in: (macro define __FILE__): New.
	(macro define __LINE__): New.
	(skip "tree.h"): New.

gcc/cp/ChangeLog
2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Re-write VEC in C++.

	* call.c (add_function_candidate): Remove const qualifier
	from call to VEC_index.

2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Configury.

	* go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX.
	* go-gcc.cc: Likewise.
	* go-system.h: Likewise.

From-SVN: r190402
2012-08-14 21:56:07 -04:00
H.J. Lu 3b1e1a029a Don't return identity for CONST or symbolic reference
gcc/

	PR rtl-optimization/54157
	* combine.c (gen_lowpart_for_combine): Don't return identity
	for CONST or symbolic reference.

gcc/testsuite/

	PR rtl-optimization/54157
	* gcc.target/i386/pr54157.c: New file.

From-SVN: r190228
2012-08-08 06:39:33 -07:00
Kenneth Zadeck 481755378d cfgexpand.c (expand_debug_locations): Encapsulate test for CONST_DOUBLE in macro.
2012-08-02  Kenneth Zadeck <zadeck@naturalbridge.com>

	* cfgexpand.c (expand_debug_locations):  Encapsulate test for
	CONST_DOUBLE in macro.
	* combine.c (try_combine, gen_lowpart_for_combine): Ditto.
	* cprop.c (implicit_set_cond_p): Ditto.
	* cselib.c (rtx_equal_for_cselib_1): Ditto.
	* expmed.c (expand_mult): Ditto.
	* expr.c (convert_modes): Ditto.
	* ira-costs.c (record_reg_classes): Ditto.
	* ira-lives.c (single_reg_class): Ditto.
	* optabs.c (expand_copysign_absneg, expand_copysign): Ditto.
	* print-rtl.c (print_rtx): Ditto.
	* recog.c (simplify_while_replacing, const_double_operand)
	(asm_operand_ok, constrain_operands): Ditto.
	* reg-stack.c (subst_stack_regs_pat): Ditto.
	* reload.c (find_reloads, find_equiv_reg): Ditto.
	* rtlanal.c (replace_rtx): Remove test.
	* rtlanal.c (constant_pool_constant_p, split_double): Encapsulate test for
	CONST_DOUBLE in macro.
	* simplify-rtx.c (mode_signbit_p, avoid_constant_pool_reference)
	(simplify_unary_operation_1, simplify_const_unary_operation)
	(simplify_binary_operation_1, simplify_const_binary_operation)
	(simplify_relational_operation_1)
	(simplify_const_relational_operations)
	(implify_subreg): Ditto.
	* varasm.c (output_constant_pool_2): Ditto.
	* rtl.h (CONST_DOUBLE_AS_INT_P, CONST_DOUBLE_AS_FLOAT_P): New
	macros.
	* rtl.def (CONST_DOUBLE):  Updated comments.

From-SVN: r190105
2012-08-02 22:39:57 +00:00
Alexandre Oliva 08df6c0db1 re PR debug/52983 (internal compiler error: in df_uses_record, at df-scan.c:3243)
PR debug/52983
* valtrack.h, valtrack.c: New.
* Makefile.in (VALTRACK_H): New.
(OBJS): Add valtrack.o.
(valtrack.o): New.
(cselib.o, dce.o, df-problems.o, combine.o): Add VALTRACK_H.
* combine.c: Include valtrack.h.
(make_compound_operation): Publish.
(cleanup_auto_inc_dec): Move to valtrack.c.
(struct rtx_subst_pair, propagate_for_debug_subst): Likewise.
(propagate_for_debug): Likewise.  Add this_basic_block parameter.
Adjust all callers.
* cselib.c: Include valtrack.h.
* dce.c: Likewise.
* df-problems.c: Likewise.
(dead_debug_init, dead_debug_reset_uses): Move to valtrack.c.
(dead_debug_finish, dead_debug_add): Likewise.
(dead_debug_insert_temp): Likewise.
* df.h (struct dead_debug_use): Move to valtrack.h.
(struct dead_debug, enum debug_temp_where): Likewise.
(dead_debug_init, dead_debug_reset_uses): Move to valtrack.h.
(dead_debug_finish, dead_debug_add): Likewise.
(dead_debug_insert_temp): Likewise.
* rtl.h (make_compound_operation): Declare.

From-SVN: r190061
2012-08-02 00:34:11 +00:00
Steven Bosscher 7ee2468b92 system.h (dump_file): Do not define.
gcc/
	* system.h (dump_file): Do not define.
	* tree-pass.h: Include dumpfile.h, which is a new file containing...
	(enum tree_dump_index, TDF_*, get_dump_file_name, dump_enabled_p,
	dump_initialized_p, dump_begin, dump_end, dump_node, dump_switch_p,
	dump_flag_name, dump_file, dump_flags, dump_file_name,
	get_dump_file_info, struct dump_file_info): all of this, moved to...
	* dumpfile.h: Here, new file.
	* tree-dump.h: Include dumpfile.h, but not tree-pass.h.
	(dump_stmt): Remove prototype for C++ specific function.
	(dump_enumerated_decls): Move prototype from here...
	* tree-flow.h (dump_enumerated_decls): ... to here.
	(get_ref_base_and_extent) Move prototype from here ...
	* tree.h (get_ref_base_and_extent) ... to here.
	* tree-ssa-live.c: Do not inclde tree-pretty-print.h, because
	gimple-pretty-print.h is enough.  Do not include tree-dump.h,
	include timevar.h and dumpfile.h instead.
	(struct numbered_tree_d, compare_decls_by_uid,
	dump_enumerated_decls_push, dump_enumerated_decls): Move from here ...
	* tree-dfa.c:(struct numbered_tree_d, compare_decls_by_uid,
	dump_enumerated_decls_push, dump_enumerated_decls):... to here.
	Do not include timevar.h.
	* tree.c: Do not include timevar.h.
	* tree-cfg.c: Do not include langhooks.h, tree-pretty-print.h, and
	timevar.h.
	(dump_cfg_stats): Use current_function_name.
	(gimple_cfg2vcg): Likewise.
	(dump_function_to_file): Likewise.
	* df-scan.c: Do not include tree-pass.h and timevar.h.
	Include dumpfile.h.
	(df_entry_block_bitmap_verify, df_exit_block_bitmap_verify): Do not
	use print_current_pass.
	* df-problems.c: Include dumpfile.h.
	Always define REG_DEAD_DEBUGGING, avoid #ifdef code, because it
	leads to errors in the code not selected.
	(df_note_compute): Do not print_rtl_with_bb here.  Fix compilation
	bug if REG_DEAD_DEBUGGING is not 0, get_insns is not available here.
	* lcm.c: Include dumpfile.h.
	Remove obsolete include of insn-attr.h.
	* dojump.c (do_compare_rtx_and_jump): Remove failure printing for
	missing probability notes.
	* stmt.c: Include dumpfile.h.
	(emit_case_decision_tree): Re-enable printing expand details only
	if TDF_DETAILS.
	* alias.c, auto-inc-dec.c, bb-reorder.c, caller-save.c, cfg.c, 
	cfgcleanup.c, cfgexpand.c, cfgloop.c, cfgloopmanip.c, cgraph.c, 
	cgraphclones.c, cgraphunit.c, combine.c, combine-stack-adj.c, 
	coverage.c, cprop.c, cse.c, cselib.c, dbgcnt.c, dce.c, df-core.c, 
	dse.c, dwarf2out.c, emit-rtl.c, except.c, expr.c, final.c, 
	function.c, fwprop.c, gcse.c, gimple-fold.c, 
	gimple-pretty-print.c, gimple-ssa-strength-reduction.c, 
	gimplify.c, graphite-blocking.c, graphite-clast-to-gimple.c, 
	graphite-dependences.c, graphite-interchange.c, 
	graphite-optimize-isl.c, graphite-poly.c, 
	graphite-sese-to-poly.c, haifa-sched.c, hw-doloop.c, ifcvt.c, 
	ipa.c, ipa-cp.c, ipa-inline-analysis.c, ipa-inline.c, 
	ipa-inline-transform.c, ipa-prop.c, ipa-pure-const.c, 
	ipa-reference.c, ipa-split.c, ipa-utils.c, ira.c, ira-emit.c, 
	jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, 
	loop-unroll.c, loop-unswitch.c, lower-subreg.c, 
	lto-section-out.c, lto-streamer-in.c, matrix-reorg.c, mcf.c, 
	mode-switching.c, modulo-sched.c, omega.c, omp-low.c, passes.c, 
	plugin.c, postreload.c, postreload-gcse.c, predict.c, print-rtl.c, 
	print-tree.c, profile.c, recog.c, ree.c, regcprop.c, reginfo.c, 
	regmove.c, regrename.c, reg-stack.c, reload1.c, reorg.c, 
	sched-rgn.c, sched-vis.c, sel-sched.c, sel-sched-ir.c, 
	store-motion.c, tracer.c, trans-mem.c, tree-affine.c, 
	tree-call-cdce.c, tree-cfgcleanup.c, tree-chrec.c, 
	tree-data-ref.c, tree-diagnostic.c, tree-dump.c,
	tree-eh.c, tree-flow-inline.h, tree-if-conv.c, tree-into-ssa.c, 
	tree-mudflap.c, tree-nrv.c, tree-object-size.c, 
	tree-optimize.c, tree-outof-ssa.c, tree-predcom.c, 
	tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, 
	tree-sra.c, tree-ssa-address.c, tree-ssa-alias.c, tree-ssa.c, 
	tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, 
	tree-ssa-copyrename.c,, tree-ssa-dce.c, tree-ssa-dom.c, 
	tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, 
	tree-ssa-loop.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, 
	tree-ssa-loop-ivcanon.c, tree-ssa-loop-ivopts.c, 
	tree-ssa-loop-manip.c, tree-ssa-loop-niter.c, 
	tree-ssa-loop-prefetch.c, tree-ssa-loop-unswitch.c, 
	tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, 
	tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-propagate.c, 
	tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-sink.c, 
	tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-ter.c, 
	tree-ssa-threadedge.c, tree-ssa-threadupdate.c, 
	tree-ssa-uncprop.c, tree-ssa-uninit.c, 
	tree-switch-conversion.c, tree-tailcall.c, 
	tree-vect-data-refs.c, tree-vect-loop.c, 
	tree-vect-loop-manip.c, tree-vectorizer.c, 
	tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, 
	tree-vrp.c, value-prof.c, var-tracking.c, web.c: Include tree-pass.h
	only if needed.  If tree-pass.h is included, do not include timevar.h
	and dumpfile.h.  If tree-pass.h is not included but dump_file, or
	dump_flags, or the TDF_* flags are used, include dumpfile.h.
	If gimple-pretty-print.h is included, don't include tree-pretty-print.h.
	Remove assorted unnecessary includes.

	* config/mn10300/mn10300.c, config/c6x/c6x.c, config/ia64/ia64.c,
	config/arm/arm.c, config/bfin/bfin.c, config/frv/frv.c,
	config/spu/spu.c, config/mep/mep.c, config/i386/i386.c:
	Include dumpfile.h.
	* config/rl78/rl78.c: Include dumpfile.h instead of tree-pass.h.
	* arm/t-arm, avr/t-avr, i386/t-i386, ia64/t-ia64, mep/t-mep,
	spu/t-spu-elf: Fix dependencies.

c-family/
	* c-gimplify.c: Include dumpfile.h instead of tree-dump.h.
	* c-ada-spec.c: Likewise.
	* c-dump.c (dump_stmt): Move to cp/dump.c, the only user.

c/
	* c-decl.c: Include dumpfile.h instead of tree-dump.h.
	* Make-lang.in: Fix dependencies.

cp/
	* dump.c (dump_stmt): Moved here from c-dump.c.
	* optimize.c: Include dumpfile.h instead of tree-dump.h.
	* class.c: Likewise.
	* decl2.c: Likewise.
	* Make-lang.in: Fix dependencies.

fortran/
	* f95-lang.c: Include dumpfile.h instead of tree-dump.h.
	* Make-lang.in: Fix dependencies.

java/
	* java-gimplify.c Include dumpfile.h instead of tree-dump.h
	* Make-lang.in: Fix dependencies.

lto/
	* lto.c: Do not include timevar.h.
	* Make-lang.in: Fix dependencies.

ada/
	* gcc-interface/utils.c: Include timevar.h.
	* Make-lang.in: Fix dependencies.

From-SVN: r189519
2012-07-16 11:32:42 +00:00
Ulrich Weigand f99391fe45 combine.c (force_to_mode): Avoid undefined behaviour due to negative shift amount.
* combine.c (force_to_mode) [LSHIFTRT]: Avoid undefined behaviour
	due to negative shift amount.

From-SVN: r189347
2012-07-07 12:19:50 +00:00
Steven Bosscher be7a421eef output.h (__gcc_host_wide_int__): Move to hwint.h.
* output.h (__gcc_host_wide_int__): Move to hwint.h.
	(decl_default_tls_model): Move to tree.h
	(dump_file): Move to system.h.
	(default_stabs_asm_out_destructor, default_stabs_asm_out_constructor,
	dbxout_int, dbxout_stabd, dbxout_begin_stabn, dbxout_begin_stabn_sline,
	dbxout_begin_empty_stabs, dbxout_begin_simple_stabs,
	dbxout_begin_simple_stabs_desc, dbxout_stab_value_zero,
	dbxout_stab_value_zero, dbxout_stab_value_label_diff,
	dbxout_stab_value_internal_label,
	dbxout_stab_value_internal_label_diff): Move from here ...
	* dbxout.h: ... to here.
	* system.h (dump_file): Moved here from output.h.
	* hwint.h (__gcc_host_wide_int__): Moved here from output.h.
	* tree.h (decl_default_tls_model): Moved here from output.h.
	* varasm.c (default_stabs_asm_out_destructor,
	default_stabs_asm_out_constructor): Move from here ...
	* dbxout.c: ... to here.

	* gcov-dump.c (dump_file): Rename to dump_gcov_file.  Update callers.

	* collect2.h (dump_file): Rename to dump_ld_file.
	* collect2.c: Likewise.
	* tlink.c: Likewise.

	* alias.c: Do not include output.h.
	* auto-inc-dec.c: Likewise.
	* bt-load.c: Likewise.
	* caller-save.c: Likewise.
	* cfg.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfglayout.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgloopanal.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.c: Likewise.
	* cgraphclones.c: Likewise.
	* combine-stack-adj.c: Likewise.
	* combine.c: Likewise.
	* cprop.c: Likewise.
	* cse.c: Likewise.
	* cselib.c: Likewise.
	* dbgcnt.c: Likewise.
	* df-problems.c: Likewise.
	* df-scan.c: Likewise.
	* dojump.c: Likewise.
	* fwprop.c: Likewise.
	* gcse.c: Likewise.
	* graph.c: Likewise.
	* haifa-sched.c: Likewise.
	* hw-doloop.c: Likewise.
	* ipa-inline-transform.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-utils.c: Likewise.
	* ira-build.c: Likewise.
	* ira-emit.c: Likewise.
	* lcm.c: Likewise.
	* loop-doloop.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-iv.c: Likewise.
	* loop-unroll.c: Likewise.
	* loop-unswitch.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-section-in.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* mcf.c: Likewise.
	* mode-switching.c: Likewise.
	* postreload-gcse.c: Likewise.
	* postreload.c: Likewise.
	* predict.c: Likewise.
	* profile.c: Likewise.
	* ree.c: Likewise.
	* reg-stack.c: Likewise.
	* regcprop.c: Likewise.
	* regmove.c: Likewise.
	* regstat.c: Likewise.
	* reload1.c: Likewise.
	* sched-ebb.c: Likewise.
	* sel-sched-dump.c: Likewise.
	* simplify-rtx.c: Likewise.
	* stor-layout.c: Likewise.
	* store-motion.c: Likewise.
	* tracer.c: Likewise.
	* tree-affine.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-nomudflap.c: Likewise.
	* tree-optimize.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-loop-ch.c: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-ssa-loop-unswitch.c: Likewise.
	* tree-ssa-loop.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-tail-merge.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-ssa.c: Likewise.
	* value-prof.c: Likewise.
	* var-tracking.c: Likewise.
	* web.c: Likewise.

	* config/m32r/m32r.c: Include dbxout.h.
	* config/pa/pa.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.

	* Makefile.in: Fix dependencies.
	* config/rs6000/t-rs5000: Likewise.

c-family/
	* c-ada-spec.c: Do not include output.h.
	* c-semantics.c: Likewise.

cp/
	* call.c: Do not include output.h.
	* class.c: Likewise.
	* except.c: Likewise.
	* friend.c: Likewise.
	* init.c: Likewise.
	* lex.c: Likewise.
	* method.c: Likewise.
	* parser.c: Likewise.
	* pt.c: Likewise.
	* rtti.c: Likewise.
	* search.c: Likewise.

objc/
	* objc-act.c: Do not include output.h.

fortran/
	* trans-common.c: Do not include output.h.
	* trans-decl.c: Likewise.

java/
	* resource.c: Do not include output.h.

From-SVN: r188082
2012-05-31 20:19:00 +00:00
Jakub Jelinek 667c517b37 re PR rtl-optimization/53519 (ice in do_SUBST, at combine.c:707)
PR rtl-optimization/53519
	* combine.c (simplify_shift_const_1) <case NOT>: Use constm1_rtx
	instead of GEN_INT (GET_MODE_MASK (mode)) as second operand of XOR.

	* gcc.c-torture/compile/pr53519.c: New test.

From-SVN: r188001
2012-05-30 08:53:46 +02:00
Richard Sandiford 372d639526 re PR bootstrap/53249 (Bootstrap failure)
gcc/
	PR middle-end/53249
	* dwarf2out.h (get_address_mode): Move declaration to...
	* rtl.h: ...here.
	* dwarf2out.c (get_address_mode): Move definition to...
	* rtlanal.c: ...here.
	* var-tracking.c (get_address_mode): Delete.
	* combine.c (find_split_point): Use get_address_mode instead of
	targetm.addr_space.address_mode.
	* cselib.c (cselib_record_sets): Likewise.
	* dse.c (canon_address, record_store): Likewise.
	* emit-rtl.c (adjust_address_1, offset_address): Likewise.
	* expr.c (move_by_pieces, emit_block_move_via_loop, store_by_pieces)
	(store_by_pieces_1, expand_assignment, store_expr, store_constructor)
	(expand_expr_real_1): Likewise.
	* ifcvt.c (noce_try_cmove_arith): Likewise.
	* optabs.c (maybe_legitimize_operand_same_code): Likewise.
	* reload.c (find_reloads): Likewise.
	* sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise.
	* sel-sched-dump.c (debug_mem_addr_value): Likewise.

From-SVN: r187320
2012-05-09 09:22:57 +00:00
Michael Matz bcc708fcdc basic-block.h (struct rtl_bb_info): Remove visited member and move head_ member to ...
* basic-block.h (struct rtl_bb_info): Remove visited member and
	move head_ member to ...
	(struct basic_block_def.basic_block_il_dependent): ... the new
	member x, replacing but containing old member rtl.
	(enum bb_flags): New BB_VISITED flag.
	(BB_HEADER, BB_FOOTER): New macros.

	* jump.c (mark_all_labels): Adjust.
	* cfgcleanup.c (try_optimize_cfg): Adjust.
	* cfglayout.c (record_effective_endpoints): Adjust.
	(relink_block_chain): Ditto (and don't fiddle with visited).
	(fixup_reorder_chain): Adjust.
	(fixup_fallthru_exit_predecessor): Ditto.
	(cfg_layout_duplicate_bb): Ditto.
	* combine.c (update_cfg_for_uncondjump): Adjust.
	* bb-reorder.c (struct bbro_basic_block_data_def): Add visited
	member.
	(bb_visited_trace): New accessor.
	(mark_bb_visited): Move in front.
	(rotate_loop): Use bb_visited_trace.
	(find_traces_1_round): Ditto.
	(emit_barrier_after): Ditto.
	(copy_bb): Ditto, and initialize visited on resize.
	(reorder_basic_blocks): Initize visited member.
	(duplicate_computed_gotos): Clear bb flags at start, use
	BB_VISITED flags.

	* cfgrtl.c (try_redirect_by_replacing_jump): Adjust.
	(rtl_verify_flow_info_1): Ditto.
	(cfg_layout_split_block): Ditto.
	(cfg_layout_delete_block): Ditto.
	(cfg_layout_merge_blocks): Ditto.
	(init_rtl_bb_info): Adjust and initialize il.x.head_ member.

From-SVN: r187288
2012-05-08 15:54:13 +00:00
Richard Sandiford 0a81f074cf rtl.h (plus_constant, [...]): Merge into a single plus_constant function.
gcc/
	* rtl.h (plus_constant, plus_constant_mode): Merge into a single
	plus_constant function.
	* explow.c (plus_constant, plus_constant_mode): Likewise.  Assert
	that the mode is sensible.
	(use_anchored_address, round_push, allocate_dynamic_stack_space)
	(probe_stack_range, anti_adjust_stack_and_probe): Update calls to
	plus_constant.

	* alias.c (canon_rtx): Likewise.
	(init_alias_analysis): Likewise.
	* builtins.c (expand_builtin_return_addr)
	(expand_builtin_setjmp_setup, expand_builtin_longjmp)
	(expand_builtin_nonlocal_goto, expand_builtin_update_setjmp_buf)
	(expand_builtin_apply_args_1, expand_builtin_apply, expand_movstr)
	(expand_builtin_stpcpy): Likewise.
	* calls.c (save_fixed_argument_area, restore_fixed_argument_area)
	(compute_argument_addresses, internal_arg_pointer_based_exp)
	(expand_call, emit_library_call_value_1): Likewise.
	* cfgexpand.c (expand_one_stack_var_at, expand_debug_expr): Likewise.
	* combine-stack-adj.c (try_apply_stack_adjustment): Likewise.
	* combine.c (combine_simplify_rtx, force_to_mode): Likewise.
	* cse.c (insert_const_anchor, find_reg_offset_for_const)
	(use_related_value, fold_rtx): Likewise.
	* cselib.c (cselib_subst_to_values): Likewise.
	* dse.c (record_store, check_mem_read_rtx): Likewise.
	* dwarf2out.c (rtl_for_decl_location, gen_variable_die): Likewise.
	* emit-rtl.c (adjust_address_1): Likewise.
	* except.c (sjlj_emit_function_enter)
	(expand_builtin_extract_return_addr)
	(expand_builtin_frob_return_addr): Likewise.
	* expmed.c (expand_divmod): Likewise.
	* expr.c (move_by_pieces, store_by_pieces, store_by_pieces_1)
	(emit_move_resolve_push, push_block, emit_push_insn, store_expr)
	(expand_expr_addr_expr_1, expand_expr_real_1): Likewise.
	* function.c (assign_stack_local_1)
	(instantiate_virtual_regs_in_rtx): Likewise.
	* optabs.c (prepare_cmp_insn): Likewise.
	* recog.c (offsettable_address_addr_space_p): Likewise.
	* reload.c (find_reloads_address, form_sum)
	(find_reloads_subreg_address): Likewise.
	* reload1.c (init_reload, eliminate_regs_1)
	(eliminate_regs_in_insn): Likewise.
	* simplify-rtx.c (simplify_unary_operation_1)
	(simplify_binary_operation_1, simplify_plus_minus): Likewise.
	* var-tracking.c (compute_cfa_pointer, prepare_call_arguments)
	(vt_add_function_parameter): Likewise.

	* config/alpha/alpha.h (EH_RETURN_HANDLER_RTX): Likewise.
	* config/alpha/vms.h (EH_RETURN_HANDLER_RTX): Likewise.
	* config/alpha/alpha.c (alpha_legitimize_address_1)
	(get_unaligned_address, alpha_expand_unaligned_load)
	(alpha_expand_unaligned_store, alpha_expand_unaligned_load_words)
	(alpha_expand_unaligned_store_words, alpha_expand_block_clear)
	(alpha_expand_builtin_establish_vms_condition_handler)
	(alpha_setup_incoming_varargs, emit_frame_store_1)
	(alpha_expand_prologue, alpha_expand_epilogue)
	(alpha_use_linkage): Likewise.
	* config/alpha/alpha.md: Likewise.

	* config/arm/arm.c (arm_trampoline_init, legitimize_pic_address)
	(arm_load_pic_register, arm_pic_static_addr, arm_legitimize_address)
	(thumb_legitimize_address, arm_gen_load_multiple_1)
	(arm_gen_store_multiple_1, arm_gen_multiple_op, gen_ldm_seq)
	(gen_stm_seq, gen_const_stm_seq, arm_block_move_unaligned_straight)
	(arm_block_move_unaligned_loop, arm_gen_movmemqi, arm_reload_in_hi)
	(arm_reload_out_hi, arm_reorg, vfp_emit_fstmd, emit_multi_reg_push)
	(emit_sfm, thumb_set_frame_pointer, arm_expand_prologue)
	(thumb1_emit_multi_reg_push, thumb1_expand_prologue)
	(thumb_expand_movmemqi, arm_set_return_address)
	(thumb_set_return_address): Likewise.
	* config/arm/arm.md: Likewise.

	* config/avr/avr.c (avr_incoming_return_addr_rtx)
	(avr_prologue_setup_frame, expand_epilogue)
	(avr_const_address_lo16): Likewise.

	* config/bfin/bfin.h (EH_RETURN_HANDLER_RTX): Likewise.
	* config/bfin/bfin.c (setup_incoming_varargs, bfin_load_pic_reg)
	(bfin_expand_prologue, bfin_trampoline_init, bfin_expand_call)
	(bfin_output_mi_thunk): Likewise.

	* config/c6x/c6x.c (c6x_initialize_trampoline)
	(c6x_output_mi_thunk): Likewise.

	* config/cr16/cr16.h (EH_RETURN_HANDLER_RTX): Likewise.
	* config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise.

	* config/cris/cris.c (cris_return_addr_rtx, cris_split_movdx)
	(cris_expand_prologue, cris_expand_epilogue, cris_gen_movem_load)
	(cris_emit_movem_store, cris_trampoline_init): Likewise.
	* config/cris/cris.md: Likewise.

	* config/darwin.c (machopic_indirect_data_reference)
	(machopic_legitimize_pic_address): Likewise.

	* config/epiphany/epiphany.c (epiphany_emit_save_restore)
	(epiphany_expand_prologue, epiphany_expand_epilogue)
	(epiphany_trampoline_init): Likewise.
	* config/epiphany/epiphany.md: Likewise.

	* config/fr30/fr30.c (fr30_move_double): Likewise.

	* config/frv/frv.c (frv_dwarf_store, frv_expand_prologue)
	(frv_expand_block_move, frv_expand_block_clear, frv_return_addr_rtx)
	(frv_index_memory, unspec_got_name, frv_find_base_term)
	(frv_output_dwarf_dtprel): Likewise.

	* config/h8300/h8300.c (h8300_push_pop, h8300_return_addr_rtx)
	(h8300_swap_into_er6, h8300_swap_out_of_er6): Likewise.

	* config/i386/i386.h (RETURN_ADDR_RTX): Likewise.
	* config/i386/i386.c (setup_incoming_varargs_64)
	(setup_incoming_varargs_ms_64, choose_baseaddr)
	(ix86_emit_save_reg_using_mov, ix86_adjust_stack_and_probe)
	(ix86_emit_probe_stack_range, ix86_expand_prologue)
	(ix86_emit_restore_reg_using_pop, ix86_emit_leave)
	(ix86_expand_epilogue, legitimize_pic_address, ix86_legitimize_address)
	(ix86_split_long_move, ix86_expand_movmem, ix86_expand_setmem)
	(ix86_static_chain, ix86_trampoline_init, x86_this_parameter)
	(x86_output_mi_thunk): Likewise.
	* config/i386/i386.md: Likewise.

	* config/ia64/ia64.c (ia64_expand_load_address)
	(ia64_expand_tls_address, ia64_expand_move, ia64_split_tmode)
	(do_spill, ia64_trampoline_init): Likewise.

	* config/iq2000/iq2000.c (iq2000_va_start)
	(iq2000_emit_frame_related_store, iq2000_expand_prologue)
	(iq2000_expand_eh_return, iq2000_setup_incoming_varargs)
	(iq2000_print_operand, iq2000_legitimize_address): Likewise.

	* config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise.

	* config/m32c/m32c.c (m32c_return_addr_rtx)
	(m32c_expand_insv): Likewise.

	* config/m32r/m32r.c (m32r_setup_incoming_varargs)
	(m32r_legitimize_pic_address, m32r_print_operand)
	(m32r_print_operand_address): Likewise.

	* config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise.
	* config/m68k/m68k.h (RETURN_ADDR_RTX): Likewise.
	(EH_RETURN_HANDLER_RTX): Likewise.
	* config/m68k/m68k.c (m68k_emit_movem, m68k_expand_prologue)
	(m68k_expand_epilogue, legitimize_pic_address)
	(m68k_output_mi_thunk): Likewise.
	* config/m68k/m68k.md: Likewise.

	* config/mcore/mcore.c (mcore_expand_prolog): Likewise.
	(mcore_expand_epilog): Likewise.
	* config/mcore/mcore.md: Likewise.

	* config/mep/mep.c (mep_allocate_initial_value)
	(mep_expand_prologue, mep_expand_epilogue): Likewise.

	* config/microblaze/microblaze.c (double_memory_operand)
	(microblaze_block_move_loop): Likewise.

	* config/mips/mips.c (mips_strip_unspec_address, mips_add_offset)
	(mips_setup_incoming_varargs, mips_va_start, mips_block_move_loop)
	(mips_print_operand, mips16e_save_restore_reg, mips_save_restore_reg)
	(mips_expand_prologue, mips_epilogue_set_cfa)
	(mips_expand_epilogue): Likewise.
	* config/mips/mips.md: Likewise.

	* config/mmix/mmix.c (mmix_dynamic_chain_address, mmix_return_addr_rtx)
	(mmix_expand_prologue, mmix_expand_epilogue): Likewise.

	* config/mn10300/mn10300.c (mn10300_gen_multiple_store)
	(mn10300_builtin_saveregs, mn10300_trampoline_init): Likewise.

	* config/moxie/moxie.h (INCOMING_RETURN_ADDR_RTX): Likewise.
	(EH_RETURN_HANDLER_RTX): Likewise.
	* config/moxie/moxie.c (moxie_static_chain): Likewise.

	* config/pa/pa.c (legitimize_pic_address, hppa_legitimize_address)
	(store_reg, set_reg_plus_d, pa_expand_prologue, load_reg)
	(pa_return_addr_rtx, hppa_builtin_saveregs)
	(pa_trampoline_init): Likewise.
	* config/pa/pa.md: Likewise.

	* config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise.

	* config/picochip/picochip.c (picochip_static_chain): Likewise.

	* config/rs6000/rs6000.h (RS6000_SAVE_TOC): Likewise.
	* config/rs6000/rs6000.c (rs6000_legitimize_address)
	(setup_incoming_varargs, print_operand, rs6000_return_addr)
	(rs6000_emit_eh_reg_restore, rs6000_emit_probe_stack_range)
	(rs6000_emit_epilogue)
	(rs6000_machopic_legitimize_pic_address): Likewise.

	* config/rx/rx.c (gen_rx_rtsd_vector, gen_rx_popm_vector): Likewise.

	* config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Likewise.
	(DYNAMIC_CHAIN_ADDRESS): Likewise.
	* config/s390/s390.c (s390_decompose_address, legitimize_pic_address)
	(s390_delegitimize_address, print_operand, annotate_constant_pool_refs)
	(replace_constant_pool_ref, s390_return_addr_rtx, s390_back_chain_rtx)
	(save_fpr, restore_fpr, save_gprs, restore_gprs, s390_emit_prologue)
	(s390_emit_epilogue, s390_function_profiler): Likewise.
	* config/s390/s390.md: Likewise.

	* config/score/score.c (score_add_offset, score_prologue): Likewise.

	* config/sh/sh.c (expand_block_move, push_regs, sh_builtin_saveregs)
	(sh_output_mi_thunk): Likewise.
	* config/sh/sh.md: Likewise.

	* config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS, FRAME_ADDR_RTX)
	(RETURN_ADDR_RTX, INCOMING_RETURN_ADDR_RTX): Likewise.
	* config/sparc/sparc.c (sparc_legitimize_pic_address)
	(sparc_emit_probe_stack_range, emit_save_or_restore_regs)
	(emit_window_save, sparc_flat_expand_prologue, sparc_struct_value_rtx)
	(emit_and_preserve): Likewise.
	* config/sparc/sparc.md: Likewise.

	* config/spu/spu.h (DYNAMIC_CHAIN_ADDRESS): Likewise.
	* config/spu/spu.c (spu_expand_insv, spu_machine_dependent_reorg)
	(spu_setup_incoming_varargs, ea_load_store_inline)
	(spu_expand_load): Likewise.

	* config/stormy16/stormy16.c (xstormy16_expand_prologue)
	(combine_bnp): Likewise.

	* config/tilegx/tilegx.h (DYNAMIC_CHAIN_ADDRESS): Likewise.
	* config/tilegx/tilegx.c (tilegx_setup_incoming_varargs)
	(tilegx_expand_unaligned_load, tilegx_trampoline_init): Likewise.

	* config/tilepro/tilepro.h (DYNAMIC_CHAIN_ADDRESS): Likewise.
	* config/tilepro/tilepro.c (tilepro_setup_incoming_varargs)
	(tilepro_expand_unaligned_load, tilepro_trampoline_init): Likewise.

	* config/v850/v850.c (expand_prologue, expand_epilogue): Likewise.
	* config/v850/v850.md: Likewise.

	* config/vax/elf.h (EH_RETURN_STACKADJ_RTX): Likewise.
	(EH_RETURN_HANDLER_RTX): Likewise.
	* config/vax/vax.h (DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX): Likewise.
	* config/vax/vax.c (vax_add_reg_cfa_offset, vax_expand_prologue)
	(print_operand_address, vax_trampoline_init): Likewise.

	* config/xtensa/xtensa.c (xtensa_expand_prologue, xtensa_return_addr)
	(xtensa_function_value_regno_p): Likewise.

From-SVN: r187199
2012-05-05 17:41:49 +00:00
Uros Bizjak 5bd5034e24 Partially revert:
2012-03-29  Richard Guenther  <rguenther@suse.de>

	* rtl.h (extended_count): Remove.
	* combine.c (extended_count): Remove.

From-SVN: r186077
2012-04-02 12:04:10 +02:00
Richard Guenther 711417cd3b cgraph.h (cgraph_materialize_all_clones): Remove.
2012-03-29  Richard Guenther  <rguenther@suse.de>

	* cgraph.h (cgraph_materialize_all_clones): Remove.
	(reset_inline_failed): Likewise.
	* cgraphunit.c (cgraph_materialize_all_clones): Make static.
	* cgraphbuild.c (reset_inline_failed): Remove.
	* rtl.h (cse_main): Remove.
	(extended_count): Likewise.
	* cse.c (dump_class): Mark as DEBUG_FUNCTION.
	(cse_main): Make static.
	* combine.c (extended_count): Remove.
	(dump_combine_stats): Mark as DEBUG_FUNCTION.
	* basic-block.h (reorder_basic_blocks): Remove.
	* bb-reorder.c (reorder_basic_blocks): Make static.
	* Makefile.in (dse.o): Remove dse.h dependency.
	* dse.h: Remove.
	* dse.c (gate_dse): Remove.
	(clear_alias_mode_eq): Likewise.
	(clear_alias_mode_hash): Likewise.
	(dse_record_singleton_alias_set): Likewise.
	(dse_invalidate_singleton_alias_set): Likewise.

From-SVN: r185962
2012-03-29 13:54:16 +00:00
Ulrich Weigand df7965e414 * combine.c (apply_distributive_law): Do not distribute SUBREG.
From-SVN: r185438
2012-03-15 16:43:08 +00:00
Chung-Lin Tang 30823ba60c re PR rtl-optimization/52528 (combine bug (powerpc testcase))
2012-03-10  Chung-Lin Tang  <cltang@codesourcery.com>

	PR rtl-optimization/52528
	* combine.c (can_combine_p): Add setting of subst_low_luid
	before call to expand_field_assignment().

From-SVN: r185175
2012-03-10 14:57:30 +00:00
Jakub Jelinek 13a72c0ba3 re PR rtl-optimization/52060 (Invalid constant simplification in combine with parallel result)
PR rtl-optimization/52060
	* combine.c (try_combine): Add i0src_copy and i0src_copy2 variables,
	copy i1src to i1src_copy whenever added_sets_2 && i1_feeds_i2_n already
	before i1dest -> i1src substitution in newpat, copy i0src to i0src_copy
	and/or i0src_copy2 when needed.

	* gcc.dg/torture/pr52060.c: New test.

From-SVN: r183972
2012-02-07 16:48:52 +01:00
Georg-Johann Lay 07ad5438a1 re PR rtl-optimization/51374 ([avr] insn combine reorders volatile memory accesses)
gcc/
	PR rtl-optimization/51374
	* combine.c (can_combine_p): Don't allow volatile_refs_p insns
	to cross other volatile_refs_p insns.

gcc/testsuite/
	PR rtl-optimization/51374
	* testsuite/gcc.target/avr/torture/pr51374-1.c: New.

From-SVN: r183796
2012-02-01 11:35:34 +00:00
Jakub Jelinek 8bb1a172e7 re PR bootstrap/52058 (bootstrap fails on HAVE_cc0: combine.c: 'do_SUBST_LINK' defined but not used)
PR bootstrap/52058
	* combine.c (do_SUBST_LINK, SUBST_LINK): Guard with #ifndef HAVE_cc0.

From-SVN: r183763
2012-01-31 17:08:47 +01:00
Ramana Radhakrishnan 2630025d14 re PR target/48308 (crosscompiling to arm fails with assembler: can't resolve '.LC4' {.rodata.str1.1 section} - '.LPIC4' {*UND* section})
2012-01-25  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>

	PR rtl-optimization/48308
	* combine.c (enum undo_kind): Add UNDO_LINKS.
	(struct undo): Add member l to other_contents and where.
	(do_SUBST_LINK): New.
	(SUBST_LINK): New.
	(try_combine): Handle LOG_LINKS for the dummy i1 case.
	(undo_all): Handle UNDO_LINKS.

From-SVN: r183512
2012-01-25 08:52:39 +00:00
Jakub Jelinek 319638ed5c re PR bootstrap/51796 (internal compiler error: in distribute_notes, at combine.c:13285 for libgomp/alloc.c on m68k-linux)
PR bootstrap/51796
	* combine.c (distribute_notes): If i3 is a noreturn call,
	allow old_size to be equal to args_size and make sure the
	noreturn call gets REG_ARGS_SIZE note.
	* expr.c (fixup_args_size_notes): Put REG_ARGS_SIZE notes
	on noreturn calls even when the delta is 0.

	* gcc.dg/pr51796.c: New test.

From-SVN: r183111
2012-01-11 23:59:12 +01:00
Joern Rennecke 6d26322f97 dse.c (get_stored_val, [...]): Use gen_int_mode.
* dse.c (get_stored_val, get_call_args): Use gen_int_mode.
        * expmed.c (expand_divmod): Likewise.
        * combine.c (simplify_if_then_else): Likewise.

From-SVN: r182164
2011-12-09 14:10:02 +00:00
Jakub Jelinek 03989f5595 re PR rtl-optimization/51023 (likely integer wrong code bug)
PR rtl-optimization/51023
	* combine.c (simplify_comparison) <case SIGN_EXTEND>: Don't use
	val_signbit_known_clear_p for signed comparison narrowing
	optimization.  Don't check for non-VOIDmode, use
	HWI_COMPUTABLE_MODE_P macro.
	<case ZERO_EXTEND>: Don't check for non-VOIDmode.
	Optimize even when const_op is equal to GET_MODE_MASK (mode),
	don't optimize if const_op is negative.

	* gcc.c-torture/execute/pr51023.c: New test.

From-SVN: r181257
2011-11-10 16:36:48 +01:00
Aldy Hernandez 0a35513e4e Merge from transactional-memory branch.
From-SVN: r181154
2011-11-08 11:13:41 +00:00
Eric Botcazou bd8c998f35 re PR rtl-optimization/50615 (ICE: in distribute_notes, at combine.c:13282 with -O --param max-cse-insns=1)
PR rtl-optimization/50615
	* combine.c (distribute_notes) <REG_ARGS_SIZE>: Skip if I3 is a no-op.

From-SVN: r180058
2011-10-16 13:14:34 +00:00
Bernd Schmidt 268987713c rtl.texi (simple_return): Document.
* doc/rtl.texi (simple_return): Document.
	(parallel, PATTERN): Here too.
	* doc/md.texi (return): Mention it's allowed to expand to simple_return
	in some cases.
	(simple_return): Document standard pattern.
	* gengenrtl.c (special_rtx): SIMPLE_RETURN is special.
	* final.c (final_scan_insn): Use ANY_RETURN_P on body.
	* reorg.c (function_return_label, function_simple_return_label):
	New static variables, replacing...
	(end_of_function_label): ... this.
	(simplejump_or_return_p): New static function.
	(optimize_skip, steal_delay_list_from_fallthrough,
	fill_slots_from_thread): Use it.
	(relax_delay_slots): Likewise.  Use ANY_RETURN_P on body.
	(rare_destination, follow_jumps): Use ANY_RETURN_P on body.
	(find_end_label): Take a new arg which is one of the two return
	rtxs.  Depending on which, set either function_return_label or
	function_simple_return_label.  All callers changed.
	(make_return_insns): Make both kinds.
	(dbr_schedule): Adjust for two kinds of end labels.
	* function.c (emit_return_into_block): Set JUMP_LABEL properly.
	* genemit.c (gen_exp): Handle SIMPLE_RETURN.
	(gen_expand, gen_split): Use ANY_RETURN_P.
	* df-scan.c (df_uses_record): Handle SIMPLE_RETURN.
	* rtl.def (SIMPLE_RETURN): New code.
	* ifcvt.c (find_if_case_1): Be more careful about
	redirecting jumps to the EXIT_BLOCK.
	* jump.c (condjump_p, condjump_in_parallel_p, any_condjump_p,
	returnjump_p_1): Handle SIMPLE_RETURNs.
	* print-rtl.c (print_rtx): Likewise.
	* rtl.c (copy_rtx): Likewise.
	* bt-load.c (compute_defs_uses_and_gen): Use ANY_RETURN_P.
	* combine.c (simplify_set): Likewise.
	* resource.c (find_dead_or_set_registers, mark_set_resources):
	Likewise.
	* emit-rtl.c (verify_rtx_sharing, classify_insn, copy_insn_1,
	copy_rtx_if_shared_1, mark_used_flags): Handle SIMPLE_RETURNs.
	(init_emit_regs): Initialize simple_return_rtx.
	* cfglayout.c (fixup_reorder_chain): Pass a JUMP_LABEL to
	force_nonfallthru_and_redirect.
	* rtl.h (ANY_RETURN_P): Allow SIMPLE_RETURN.
	(GR_SIMPLE_RETURN): New enum value.
	(simple_return_rtx): New macro.
	* basic-block.h (force_nonfallthru_and_redirect): Adjust
	declaration.
	* cfgrtl.c (force_nonfallthru_and_redirect): Take a new jump_label
	argument.  All callers changed.  Be careful about what kinds of
	returnjumps to generate.
	* config/i386/3i86.c (ix86_pad_returns, ix86_count_insn_bb,
	ix86_pad_short_function): Likewise.
	* config/arm/arm.c (arm_final_prescan_insn): Handle both kinds
	of return.
	* config/mips/mips.md (any_return): New code_iterator.
	(optab): Add cases for return and simple_return.
	(return): Expand to a simple_return.
	(simple_return): New pattern.
	(*<optab>, *<optab>_internal for any_return): New patterns.
	(return_internal): Remove.
	* config/mips/mips.c (mips_expand_epilogue): Make the last insn
	a simple_return_internal.

From-SVN: r178135
2011-08-27 17:38:58 +00:00
Richard Sandiford 5e8f01f434 rtl.h (set_src_cost, [...]): New functions.
gcc/
	* rtl.h (set_src_cost, get_full_set_src_cost): New functions.
	* auto-inc-dec.c (attempt_change): Use set_src_cost instead of
	rtx_cost.
	* calls.c (precompute_register_parameters): Likewise.
	* combine.c (expand_compound_operation, make_extraction): Likewise.
	(force_to_mode, distribute_and_simplify_rtx): Likewise.
	* dse.c (find_shift_sequence): Likewise.
	* expmed.c (init_expmed, expand_mult, expand_smod_pow2): Likewise.
	* expr.c (compress_float_constant): Likewise.
	* fwprop.c (should_replace_address, try_fwprop_subst): Likewise.
	* gcse.c (want_to_gcse_p): Likewise.
	* ifcvt.c (noce_try_sign_mask): Likewise.
	* loop-doloop.c (doloop_optimize): Likewise.
	* loop-invariant.c (create_new_invariant): Likewise.
	* optabs.c (avoid_expensive_constant): Likewise.
	* postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands)
	(try_replace_in_use, reload_cse_move2add): Likewise.
	* reload1.c (calculate_elim_costs_all_insns): Likewise.
	(note_reg_elim_costly): Likewise.
	* rtlanal.c (insn_rtx_cost): Likewise.
	* simplify-rtx.c (simplify_binary_operation_1): Likewise.
	* stmt.c (lshift_cheap_p): Likewise.
	* tree-ssa-loop-ivopts.c (seq_cost, computation_cost): Likewise.
	* config/avr/avr.c (final_prescan_insn): Likewise.
	* config/bfin/bfin.c (bfin_rtx_costs): Likewise.
	* config/mips/mips.c (mips_binary_cost, mips_rtx_costs): Likewise.

From-SVN: r177851
2011-08-18 12:37:27 +00:00
Richard Henderson 9a08d23082 re PR debug/49864 (ICE: in maybe_record_trace_start, at dwarf2cfi.c:2439)
PR target/49864
	* reg-notes.def (REG_ARGS_SIZE): New.
	* calls.c (emit_call_1): Emit REG_ARGS_SIZE for call_pop.
	(expand_call): Add REG_ARGS_SIZE to emit_stack_restore.
	* cfgcleanup.c (old_insns_match_p): Don't allow cross-jumping to
	different stack levels.
	* combine-stack-adj.c (adjust_frame_related_expr): Remove.
	(maybe_move_args_size_note): New.
	(combine_stack_adjustments_for_block): Use it.
	* combine.c (distribute_notes): Place REG_ARGS_SIZE.
	* dwarf2cfi.c (dw_cfi_row_struct): Remove args_size member.
	(dw_trace_info): Add beg_true_args_size, end_true_args_size,
	beg_delay_args_size, end_delay_args_size, eh_head, args_size_undefined.
	(cur_cfa): New.
	(queued_args_size): Remove.
	(add_cfi_args_size): Assert size is non-negative.
	(stack_adjust_offset, dwarf2out_args_size): Remove.
	(dwarf2out_stack_adjust, dwarf2out_notice_stack_adjust): Remove.
	(notice_args_size, notice_eh_throw): New.
	(dwarf2out_frame_debug_def_cfa): Use cur_cfa.
	(dwarf2out_frame_debug_adjust_cfa): Likewise.
	(dwarf2out_frame_debug_cfa_offset): Likewise.
	(dwarf2out_frame_debug_expr): Likewise.  Don't stack_adjust_offset.
	(dwarf2out_frame_debug): Don't handle non-frame-related-p insns.
	(change_cfi_row): Don't emit args_size.
	(maybe_record_trace_start_abnormal): Split out from ...
	(maybe_record_trace_start): Here.  Set args_size_undefined.
	(create_trace_edges): Update to match.
	(scan_trace): Handle REG_ARGS_SIZE.
	(connect_traces): Connect args_size between EH insns.
	* emit-rtl.c (try_split): Handle REG_ARGS_SIZE.
	* explow.c (suppress_reg_args_size): New.
	(adjust_stack_1): Split out from ...
	(adjust_stack): ... here.
	(anti_adjust_stack): Use it.
	(allocate_dynamic_stack_space): Suppress REG_ARGS_SIZE.
	* expr.c (mem_autoinc_base): New.
	(fixup_args_size_notes): New.
	(emit_single_push_insn_1): Rename from emit_single_push_insn.
	(emit_single_push_insn): New.  Generate REG_ARGS_SIZE.
	* recog.c (peep2_attempt): Handle REG_ARGS_SIZE.
	* reload1.c (reload_as_needed): Likewise.
	* rtl.h (fixup_args_size_notes): Declare.

From-SVN: r177218
2011-08-02 15:18:35 -07:00
Wei Guozhi 154516d9d2 re PR rtl-optimization/49799 (gcc arm generates illegal sbfx instruction)
PR rtl-optimization/49799

	* combine.c (make_compound_operation): Check if the bit field is valid
	before change it to bit field extraction.

	* gcc.dg/pr49799.c: New test case.

From-SVN: r176911
2011-07-29 01:27:29 +00:00
Bernd Schmidt d58c1a38e5 revert: simplify-rtx.c (simplify_const_binary_operation): Use the shift_truncation_mask hook instead of performing modulo by width.
Revert:
	* simplify-rtx.c (simplify_const_binary_operation): Use the
	shift_truncation_mask hook instead of performing modulo by
	width.  Compare against mode precision, not bitsize.
	* combine.c (combine_simplify_rtx, simplify_shift_const_1):
	Use shift_truncation_mask instead of constructing the value
	manually.

From-SVN: r175949
2011-07-06 23:56:28 +00:00
Bernd Schmidt 5511bc5ada explow.c (trunc_int_for_mode): Use GET_MODE_PRECISION instead of GET_MODE_BITSIZE where appropriate.
* explow.c (trunc_int_for_mode): Use GET_MODE_PRECISION
	instead of GET_MODE_BITSIZE where appropriate.
	* rtlanal.c (subreg_lsb_1, subreg_get_info, nonzero_bits1,
	num_sign_bit_copies1, canonicalize_condition, low_bitmask_len,
	init_num_sign_bit_copies_in_rep): Likewise.
	* cse.c (fold_rtx, cse_insn): Likewise.
	* loop-doloop.c (doloop_modify, doloop_optimize): Likewise.
	* simplify-rtx.c (simplify_unary_operation_1,
	simplify_const_unary_operation, simplify_binary_operation_1,
	simplify_const_binary_operation, simplify_ternary_operation,
	simplify_const_relational_operation, simplify_subreg): Likewise.
	* combine.c (try_combine, find_split_point, combine_simplify_rtx,
	simplify_if_then_else, simplify_set, expand_compound_operation,
	expand_field_assignment, make_extraction, if_then_else_cond,
	make_compound_operation, force_to_mode, make_field_assignment,
	reg_nonzero_bits_for_combine, reg_num_sign_bit_copies_for_combine,
	extended_count, try_widen_shift_mode, simplify_shift_const_1,
	simplify_comparison, record_promoted_value, simplify_compare_const,
	record_dead_and_set_regs_1): Likewise.

From-SVN: r175946
2011-07-06 23:16:39 +00:00
Bernd Schmidt 46c9550f31 machmode.h (HWI_COMPUTABLE_MODE_P): New macro.
* machmode.h (HWI_COMPUTABLE_MODE_P): New macro.
	* combine.c (set_nonzero_bits_and_sign_copies): Use it.
	(find_split-point, combine_simplify_rtx, simplify_if_then_else,
	simplify_set, simplify_logical, expand_compound_operation,
	make_extraction, force_to_mode, if_then_else_cond, extended_count,
	try_widen_shift_mode, simplify_shift_const_1, simplify_comparison,
	record_value_for_reg): Likewise.
	* expmed.c (expand_widening_mult, expand_mult_highpart): Likewise.
	* simplify-rtx. c (simplify_unary_operation_1,
	simplify_binary_operation_1, simplify_const_relational_operation):
	Likewise.

From-SVN: r175945
2011-07-06 23:12:45 +00:00
Bernd Schmidt 6a4bdc7976 emit-rtl.c (paradoxical_subreg_p): New function.
* emit-rtl.c (paradoxical_subreg_p): New function.
	* rtl.h (paradoxical_subreg_p): Declare.
	* combine.c (set_nonzero_bits_and_sign_copies, get_last_value,
	apply_distributive_law, simplify_comparison, simplify_set): Use it.
	* cse.c (record_jump_cond, cse_insn): Likewise.
	* expr.c (force_operand): Likewise.
	* rtlanal.c (num_sign_bit_copies1): Likewise.
	* reload1.c (eliminate_regs_1, strip_paradoxical_subreg): Likewise.
	* reload.c (push_secondary_reload, find_reloads_toplev): Likewise.
	(push_reload): Use precision to check for paradoxical subregs.
	* expmed.c (extract_bit_field_1): Likewise.

From-SVN: r175944
2011-07-06 23:11:51 +00:00
Bernd Schmidt d0edd768de machmode.h (TRULY_NOOP_TRUNCATION_MODES_P): New macro.
* machmode.h (TRULY_NOOP_TRUNCATION_MODES_P): New macro.
	* combine.c (make_extraction, gen_lowpart_or_truncate,
	apply_distributive_law, simplify_comparison,
	reg_truncated_to_mode, record_truncated_value): Use it.
	* cse.c (notreg_cost): Likewise.
	* expmed.c (store_bit_field_1, extract_bit_field_1): Likewise.
	* expr.c (convert_move, convert_modes): Likewise.
	* optabs.c (expand_binop, expand_unop): Likewise.
	* postreload.c (move2add_last_label): Likewise.
	* regmove.c (optimize_reg_copy_3): Likewise.
	* rtlhooks.c (gen_lowpart_general): Likewise.
	* simplify-rtx.c (simplify_unary_operation_1): Likewise.

From-SVN: r175921
2011-07-06 14:44:30 +00:00
Bernd Schmidt 2d0c270fd2 cse.c (find_comparison_args): Use val_mode_signbit_set_p.
* cse.c (find_comparison_args): Use val_mode_signbit_set_p.
	* simplify-rtx.c (mode_signbit_p): Use GET_MODE_PRECISION.
	(val_mode_signbit_p, val_mode_signbit_set_p): New functions.
	(simplify_const_unary_operation, simplify_binary_operation_1,
	simplify_const_binary_operation,
	simplify_const_relational_operation): Use them.  Use
	GET_MODE_MASK for masking and sign-extensions.
	* combine.c (set_nonzero_bits_and_sign_copies, simplify_set,
	combine_simplify_rtx, force_to_mode, reg_nonzero_bits_for_combine,
	simplify_shift_const_1, simplify_comparison): Likewise.
	* expr.c (convert_modes): Likewise.
	* rtlanal.c (nonzero_bits1, canonicalize_condition): Likewise.
	* expmed.c (emit_cstore, emit_store_flag_1, emit_store_flag):
	Likewise.
	* rtl.h (val_mode_signbit_p, val_mode_signbit_set_p): Declare.

From-SVN: r175917
2011-07-06 14:21:03 +00:00
Bernd Schmidt ff3e08afdd simplify-rtx.c (simplify_const_binary_operation): Use the shift_truncation_mask hook instead of performing modulo by width.
* simplify-rtx.c (simplify_const_binary_operation): Use the
	shift_truncation_mask hook instead of performing modulo by
	width.  Compare against mode precision, not bitsize.
	* combine.c (combine_simplify_rtx, simplify_shift_const_1):
	Use shift_truncation_mask instead of constructing the value
	manually.

From-SVN: r175913
2011-07-06 13:36:16 +00:00
Jakub Jelinek af421d9cf0 re PR rtl-optimization/49619 (ICE in simplify_subreg, at simplify-rtx.c:5362)
PR rtl-optimization/49619
	* combine.c (combine_simplify_rtx): In PLUS -> IOR simplification
	pass VOIDmode as op0_mode to recursive call, and return temp even
	when different from tor, just if it is not IOR of the original
	PLUS arguments.

	* gcc.dg/pr49619.c: New test.

From-SVN: r175825
2011-07-04 23:04:54 +02:00
H.J. Lu 83a8cbdab0 Don't check zero/sign extended hard registers.
2011-06-20  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/47725
	* combine.c (cant_combine_insn_p): Don't check zero/sign
	extended hard registers.

From-SVN: r175222
2011-06-20 10:03:16 -07:00
H.J. Lu d1e32c4a41 Check zero/sign extended hard registers.
2011-06-20  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/47725
	* combine.c (cant_combine_insn_p): Check zero/sign extended
	hard registers.

From-SVN: r175218
2011-06-20 07:53:48 -07:00
David Li 22c5fa5fbf dumping cleanup phase 1 -- Removing TODO_dump_func
From-SVN: r175051
2011-06-14 19:39:36 +00:00
Richard Sandiford 4de4b0f267 re PR rtl-optimization/49145 (ICE in simplify_const_unary_operation, at simplify-rtx.c:1322)
gcc/
	PR rtl-optimization/49145
	* combine.c (make_compound_operation): Handle ZERO_EXTEND specially.

gcc/testsuite/
	PR rtl-optimization/49145
	From Ryan Mansfield
	* gcc.c-torture/compile/pr49145.c: New test.

From-SVN: r174718
2011-06-06 18:16:18 +00:00
Chung-Lin Tang 4f82319dc9 combine.c (simplify_comparison): Abstract out parts into...
2011-05-08  Chung-Lin Tang  <cltang@codesourcery.com>

	* combine.c (simplify_comparison): Abstract out parts into...
	(simplify_compare_const): ... new function.
	(try_combine): Generalize parallel arithmetic/compare combining
	to call simplify_compare_const() and CANONICALIZE_COMPARE().

From-SVN: r173552
2011-05-08 19:30:36 +00:00
Alexandre Oliva 01a5c0abdf re PR debug/47994 (-fcompare-debug failure with -O2 -fpeel-loops -fno-rerun-cse-after-loop -fno-tree-loop-optimize -fno-web)
PR debug/47994
PR debug/47919
* combine.c (try_combine): Skip debug insns at m_split tests.

From-SVN: r173351
2011-05-04 03:37:40 +00:00
Maxim Kuvyrkov 5157a881bb combine.c (combine_simplify_rtx): Avoid mis-simplifying conditionals for STORE_FLAG_VALUE==-1 case.
* combine.c (combine_simplify_rtx): Avoid mis-simplifying conditionals
	for STORE_FLAG_VALUE==-1 case.

Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com>

From-SVN: r172930
2011-04-25 12:06:27 +00:00
Maxim Kuvyrkov bce204e591 combine.c (subst, [...]): Add new argument, use it to track processing of conditionals.
* combine.c (subst, combine_simlify_rtx): Add new argument, use it
	to track processing of conditionals.  Update all callers.
	(try_combine, simplify_if_then_else): Update.

From-SVN: r172486
2011-04-15 11:13:07 +00:00
Jakub Jelinek b4ccfed9a0 combine.c (update_cfg_for_uncondjump): Instead of testing at_end assert it is always true.
* combine.c (update_cfg_for_uncondjump): Instead of testing at_end
	assert it is always true.
	(try_combine): Don't call update_cfg_for_uncondjump for noop non-jump
	moves.

From-SVN: r172329
2011-04-12 19:49:11 +02:00
Jakub Jelinek 74f091d686 re PR rtl-optimization/48549 (Combiner ICE with -g)
PR rtl-optimization/48549
	* combine.c (propagate_for_debug): Also stop after BB_END of
	this_basic_block.  Process LAST and just stop processing after it.
	(combine_instructions): If last_combined_insn has been deleted,
	set last_combined_insn to its PREV_INSN.

	* g++.dg/opt/pr48549.C: New test.

From-SVN: r172311
2011-04-12 12:53:47 +02:00
Eric Botcazou 68bc509a5c combine.c (combine_validate_cost): Adjust comments.
* combine.c (combine_validate_cost): Adjust comments.  Set registered
	cost of I0 to zero at the end, if any.

From-SVN: r172216
2011-04-08 22:31:22 +00:00
Jakub Jelinek 4e626909c7 re PR debug/48343 (ICE compiling i586 linux-2.6.38/drivers/staging/wlan-ng/p80211wep.c: in form_sum, at reload.c:5338)
PR debug/48343
	* combine.c (combine_instructions): Add last_combined_insn,
	update it if insn is after it, pass it to all try_combine
	calls.
	(try_combine): Add last_combined_insn parameter, pass it instead of
	i3 to propagate_for_debug.

	* gcc.dg/torture/pr48343.c: New test.

From-SVN: r172108
2011-04-07 19:57:26 +02:00
Nathan Froyd e532f586e2 re PR bootstrap/48469 (bootstrap failure)
PR bootstrap/48469
	* combine.c (combine_instructions): #ifdef AUTO_INC_DEC links
	declaration.

From-SVN: r171998
2011-04-05 19:33:49 +00:00
Nathan Froyd 3fb7c0552c fix compilation on AUTO_INC_DEC targets
fix compilation on AUTO_INC_DEC targets
	* combine.c (combine_instructions) [AUTO_INC_DEC]: Declare links
	as an rtx.
	(try_combine) [AUTO_INC_DEC]: Declare a local link rtx.

From-SVN: r171995
2011-04-05 18:36:15 +00:00
Nathan Froyd b405b27425 combine.c: Include obstack.h.
* combine.c: Include obstack.h.
	(struct insn_link): Define.
	(uid_log_links): Adjust type.
	(FOR_EACH_LOG_LINK): New macro.
	(insn_link_obstack): Declare.
	(alloc_insn_link): Define.
	(create_log_links): Call it.  Use FOR_EACH_LOG_LINK and adjust
	type of link variables.
	(find_single_use, insn_a_feeds_b, combine_instructions): Likewise.
	(try_combine, record_promoted_values, distribute_notes): Likewise.
	(distribute_links): Likewise.  Tweak prototype.
	(clear_log_links): Delete.
	(adjust_for_new_dest): Call alloc_insn_link.
	* Makefile.in (combine.o): Depend on $(OBSTACK_H).

From-SVN: r171993
2011-04-05 17:24:06 +00:00
Eric Botcazou da29e0700f * combine.c (try_combine): Remove useless local variable.
From-SVN: r171901
2011-04-03 09:19:26 +00:00
Eric Botcazou e8b97ccd59 combine.c (simplify_set): Try harder to find the best CC mode when simplifying a nested COMPARE on the RHS.
* combine.c (simplify_set): Try harder to find the best CC mode when
	simplifying a nested COMPARE on the RHS.

From-SVN: r171304
2011-03-22 20:04:58 +00:00
Chung-Lin Tang 2abbb0fe9e combine.c (try_combine): Do simplification only call of subst() on i2 even when i1 is present.
2011-03-18  Chung-Lin Tang  <cltang@codesourcery.com>

	* combine.c (try_combine): Do simplification only call of
	subst() on i2 even when i1 is present. Update comments.

	testsuite/
	* gcc.target/arm/unsigned-extend-1.c: New.

From-SVN: r171138
2011-03-18 13:22:42 +00:00
H.J. Lu 378758560b Revert the last change on cant_combine_insn_p.
2011-03-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/47725
	* combine.c (cant_combine_insn_p): Don't check zero/sign
	extended hard registers.

From-SVN: r171125
2011-03-17 21:02:25 -07:00
H.J. Lu 7606976434 Check zero/sign extended hard registers.
gcc/

2011-03-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/47725
	* combine.c (cant_combine_insn_p): Check zero/sign extended
	hard registers.

gcc/testsuite/

2011-03-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/47725
	* gcc.dg/torture/pr47725.c: New.

From-SVN: r171124
2011-03-17 17:29:15 -07:00
H.J. Lu 4e380b8e00 Revert cant_combine_insn_p change.
gcc/

2011-02-15  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/47725
	* combine.c (cant_combine_insn_p): Revert the last change.

gcc/testsuite/

2011-02-15  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/47725
	* gcc.dg/torture/pr47725.c: Removed.

From-SVN: r170197
2011-02-15 11:46:26 -08:00
H.J. Lu 8a73faf108 Check zero/sign extended hard registers.
gcc/

2011-02-15  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/47725
	* combine.c (cant_combine_insn_p): Check zero/sign extended
	hard registers.

gcc/testsuite/

2011-02-15  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/47725
	* gcc.dg/torture/pr47725.c: New.

From-SVN: r170179
2011-02-15 08:50:43 -08:00
Jakub Jelinek 525a2d06d3 re PR target/47665 (ICE in trunc_int_for_mode)
PR target/47665
	* combine.c (make_compound_operation): Only change shifts into
	multiplication for SCALAR_INT_MODE_P.

	* gcc.target/i386/pr47665.c: New test.

From-SVN: r170000
2011-02-10 12:15:23 +01:00
Steven Bosscher d5d3781a0d invoke.texi: Remove reference to compiler internals from user documentation.
* doc/invoke.texi: Remove reference to compiler internals from
	user documentation.

	* reg-notes.def: Remove REG_VALUE_PROFILE.
	* combine.c (distribute_notes): Do not handle REG_VALUE_PROFILE.

From-SVN: r169861
2011-02-06 12:35:10 +00:00
DJ Delorie 5c2917ec9d re PR rtl-optimization/46878 (V850 ICE in in maybe_add_or_update_dep_1, at sched-deps.c:854)
PR rtl-optimization/46878
* combine.c (insn_a_feeds_b): Check for the implicit cc0
setter/user dependency as well.

* gcc.dg/pr46878-1.c: New test.

From-SVN: r169307
2011-01-26 17:03:47 -05:00
Jakub Jelinek 9766135bb1 re PR rtl-optimization/47157 (ICE: in calc_dfs_tree, at dominance.c:395 with -O)
PR rtl-optimization/47157
	* combine.c (try_combine): If undobuf.other_insn becomes
	(set (pc) (pc)) jump, call update_cfg_for_uncondjump on it
	and set *new_direct_jump_p too.

	* gcc.c-torture/compile/pr47157.c: New test.

From-SVN: r168439
2011-01-03 21:59:20 +01:00
Joseph Myers c59ffc4195 hwint.c: New.
* hwint.c:  New.  Extracted from toplev.c.
	* hwint.h (clz_hwi, ctz_hwi, ffs_hwi, exact_log2, floor_log2):
	Move from toplev.h.
	* toplev.c (clz_hwi, ctz_hwi, ffs_hwi, exact_log2, floor_log2):
	Move to hwint.c.
	* toplev.h (clz_hwi, ctz_hwi, ffs_hwi, exact_log2, floor_log2):
	Move to hwint.h.
	* builtins.c, combine.c, config/i386/winnt.c, double-int.c,
	explow.c, expmed.c, fold-const.c, ggc-page.c, ggc-zone.c, ifcvt.c,
	ipa-struct-reorg.c, ira-color.c, matrix-reorg.c, omp-low.c,
	real.c, recog.c, reload.c, rtlanal.c, simplify-rtx.c,
	stor-layout.c, tree-dfa.c, tree-ssa-alias.c,
	tree-ssa-loop-niter.c, tree-vect-data-refs.c,
	tree-vect-loop-manip.c, tree-vect-loop.c, tree-vect-stmts.c,
	tree-vrp.c: Don't include toplev.h.
	* genattrtab.c, genconditions.c, genemit.c, genextract.c,
	genoutput.c, genpeep.c, genpreds.c, genrecog.c: Don't include
	toplev.h in generated output.
	* Makefile.in (OBJS-common): Add hwint.o.
	Dependencies for above files changed to remove toplev.h.
	(hwint.o): New.
	(insn-attrtab.o, insn-emit.o, insn-extract.o, insn-output.o,
	insn-peep.o, insn-preds.o, insn-recog.o): Don't depend on
	toplev.h.
	* config/i386/t-cygming (winnt.o): Don't depend on toplev.h.
	* config/i386/t-interix (winnt.o): Don't depend on toplev.h.

fortran:
	* trans-common.c: Don't include toplev.h.

java:
	* boehm.c: Don't include toplev.h.
	* Make-lang.in (java/boehm.o): Don't depend on toplev.h.

lto:
	* lto-object.c: Don't include toplev.h.
	* Make-lang.in (lto/lto-object.o): Don't depend on toplev.h.

From-SVN: r167301
2010-11-30 16:36:19 +00:00
Jakub Jelinek 01e512e27c re PR middle-end/46637 (SIGSEGV in if_then_else_cond - too deep recursion)
PR middle-end/46637
	* combine.c (try_combine): When substing i2dest for i2src, pass
	1 as last argument even if
	i0_feeds_i1_n && i1_feeds_i2_n && i0dest_in_i0src.

	* gcc.c-torture/compile/pr46637.c: New test.

From-SVN: r167148
2010-11-25 19:00:47 +01:00
Jakub Jelinek 073d7052e5 re PR rtl-optimization/46440 (ICE: in rtl_verify_flow_info, at cfgrtl.c:2165 with -fstack-protector-all -fno-tree-dominator-opts -fno-tree-fre)
PR rtl-optimization/46440
	* combine.c (update_cfg_for_uncondjump): When changing
	an indirect jump into unconditional jump, remove BARRIERs
	from bb's footer.

	* gcc.dg/pr46440.c: New test.

From-SVN: r166867
2010-11-17 14:02:31 +01:00
Eric Botcazou a05c8f2351 re PR rtl-optimization/46490 (ACATS c460007 fails at -O2 or above)
PR rtl-optimization/46490
	* combine.c (expand_compound_operation): Fix thinko.

From-SVN: r166830
2010-11-16 22:30:19 +00:00
Eric Botcazou f891030a48 combine.c (try_combine): Fix formatting issues, improve comments and fix a pasto.
* combine.c (try_combine): Fix formatting issues, improve comments and
	fix a pasto.

From-SVN: r166263
2010-11-03 17:53:51 +00:00
Jakub Jelinek 80ab32d69e re PR rtl-optimization/46034 (internal compiler error: segmentation fault)
PR rtl-optimization/46034
	PR rtl-optimization/46212
	PR rtl-optimization/46248
	* combine.c (try_combine): If added_sets_2 where i0dest_in_i0src
	and i0 feeds i1 and i1 feeds i2 or i0 feeds i2, make a copy of i1src
	before i0dest -> i0src substitution and pass 1 instead of 0 as last
	argument to subst on i2pat.

	* gcc.c-torture/compile/pr46034.c: New test.
	* gcc.c-torture/compile/pr46248.c: New test.
	* gcc.dg/pr46212.c: New test.

From-SVN: r166231
2010-11-03 09:30:21 +01:00
Eric Botcazou c575a65f66 combine.c (set_nonzero_bits_and_sign_copies): Use unsigned arithmetics in masking operations.
* combine.c (set_nonzero_bits_and_sign_copies): Use unsigned
	arithmetics in masking operations.
	(contains_muldiv): Likewise.
	(try_combine): Likewise.
	(find_split_point): Likewise.
	(combine_simplify_rtx): Likewise.
	(simplify_if_then_else): Likewise.
	(simplify_set): Likewise.
	(expand_compound_operation): Likewise.
	(expand_field_assignment): Likewise.
	(make_extraction): Likewise.
	(extract_left_shift): Likewise.
	(make_compound_operation): Likewise.
	(force_to_mode): Likewise.
	(make_field_assignment): Likewise.
	(reg_nonzero_bits_for_combine): Likewise.
	(simplify_shift_const_1): Likewise.
	(simplify_comparison): Likewise.

From-SVN: r166027
2010-10-28 10:32:03 +00:00
Jie Zhang 8150f05c20 combine.c (try_combine): If insns need to be kept around...
* combine.c (try_combine): If insns need to be kept around,
	check that they can be copied in the merged instruction.

	testsuite/
	g++.dg/opt/combine.c: New test.

From-SVN: r165911
2010-10-25 09:37:19 +00:00
Bernd Schmidt 21016e43e2 re PR rtl-optimization/45966 (Incorrect combiner transformation.)
PR rtl-optimization/45966
	* combine.c (try_combine): If added_sets_2, deal with the case
	where i0 feeds i1 and i1 feeds i2.

From-SVN: r165674
2010-10-19 00:24:36 +00:00
Eric Botcazou 9c506f103c re PR rtl-optimization/45394 (gnat fails to build on s390, trunk 20100918)
PR rtl-optimization/45394
	* combine.c (cleanup_auto_inc_dec): Remove AFTER parameter and adjust.
	(struct rtx_subst_pair): Remove AFTER field.
	(propagate_for_debug_subst): Adjust call to cleanup_auto_inc_dec.
	(propagate_for_debug): Remove MOVE parameter and adjust.
	(try_combine): In the special case where I2 is a PARALLEL, combine only
	destinations of SETs and set I2SRC to the I2 source.
	Adjust calls to propagate_for_debug throughout.
	* reload1.c (eliminate_regs_1) <ASM_OPERANDS>: Do not abort for debug
	insns.

From-SVN: r165030
2010-10-06 14:25:04 +00:00
Joseph Myers e3339d0f33 optc-gen.awk: Generate global_options initializer instead of individual variables.
gcc:
	* optc-gen.awk: Generate global_options initializer instead of
	individual variables.  Add x_ prefix to names of structure
	members.
	* opth-gen.awk: Generate gcc_options structure.  Add x_ prefix to
	names of structure members.
	* doc/tm.texi.in (HARD_FRAME_POINTER_IS_FRAME_POINTER,
	HARD_FRAME_POINTER_IS_ARG_POINTER): Document.
	* doc/tm.texi: Regenerate.
	* alias.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
	* builtins.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER.
	* c-parser.c (disable_extension_diagnostics,
	restore_extension_diagnostics): Update names of cpp_options
	members.
	* combine.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
	* common.opt (fcompare-debug-second): Don't use Var.
	* config/alpha/alpha.h (target_flags): Remove.
	* config/arm/arm.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
	HARD_FRAME_POINTER_IS_ARG_POINTER): Define.
	* config/bfin/bfin.h (target_flags): Remove.
	* config/cris/cris.h (target_flags): Remove.
	* config/i386/i386-c.c (ix86_pragma_target_parse): Update names of
	cl_target_option members.
	* config/i386/i386.c (ix86_force_align_arg_pointer): Remove.
	(ix86_function_specific_print, ix86_valid_target_attribute_tree,
	ix86_can_inline_p): Update names of cl_target_option members.
	* config/i386/i386.h (ix86_isa_flags): Remove.
	* config/lm32/lm32.h (target_flags): Remove.
	* config/mcore/mcore.h (mcore_stack_increment): Remove.
	* config/mcore/mcore.md (addsi3): Remove extern declaration of
	flag_omit_frame_pointer.
	* config/mep/mep.h (target_flags): Remove.
	* config/mips/mips.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
	HARD_FRAME_POINTER_IS_ARG_POINTER): Define.
	* config/mmix/mmix.h (target_flags): Remove.
	* config/rs6000/rs6000.h (rs6000_xilinx_fpu, flag_pic,
	flag_expensive_optimizations): Remove.
	* config/s390/s390.h (flag_pic): Remove.
	* config/score/score-conv.h (target_flags): Remove.
	* config/sh/sh.h (sh_fixed_range_str): Remove.
	* config/spu/spu.h (target_flags, spu_fixed_range_string): Remove.
	* dbxout.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER
	* df-scan.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* diagnostic.c (diagnostic_initialize): Update names of
	diagnostic_context members.
	* diagnostic.h (diagnostic_context): Rename inhibit_warnings and
	warn_system_headers.
	(diagnostic_report_warnings_p): Update for new names.
	* dwarf2out.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER
	* emit-rtl.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER and
	HARD_FRAME_POINTER_IS_ARG_POINTER.
	* flags.h (flag_compare_debug): Declare.
	* ira.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
	* opts.c (flag_compare_debug): Define.
	(common_handle_option): Update names of diagnostic_context
	members.  Handle -fcompare-debug-second.
	(fast_math_flags_struct_set_p): Update names of cl_optimization
	members.
	* reginfo.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* regrename.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* reload.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* reload1.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* resource.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* rtl.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
	HARD_FRAME_POINTER_IS_ARG_POINTER): Define and use.
	* sel-sched.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
	* stmt.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER.

gcc/c-family:
	* c-common.c (c_cpp_error): Update names of diagnostic_context
	members.
	* c-cppbuiltin.c (c_cpp_builtins_optimize_pragma): Update names of
	cl_optimization members.
	* c-opts.c (warning_as_error_callback, c_common_handle_option,
	sanitize_cpp_opts, finish_options): Update names of cpp_options
	members.

gcc/fortran:
	* cpp.c (cpp_define_builtins): Update names of gfc_option_t
	members.
	(gfc_cpp_post_options): Update names of cpp_options members.
	(cb_cpp_error): Update names of diagnostic_context members.
	* f95-lang.c (gfc_init_builtin_functions): Update names of
	gfc_option_t members.
	* gfortran.h (gfc_option_t): Rename warn_conversion and
	flag_openmp.
	* intrinsic.c (gfc_convert_type_warn): Update names of
	gfc_option_t members.
	* options.c (gfc_init_options, gfc_post_options, set_Wall,
	gfc_handle_option): Update names of gfc_option_t members.
	* parse.c (next_free, next_fixed): Update names of gfc_option_t
	members.
	* scanner.c (pedantic): Remove extern declaration.
	(skip_free_comments, skip_fixed_comments, include_line): Update
	names of gfc_option_t members.
	* trans-decl.c (gfc_generate_function_code): Update names of
	gfc_option_t members.

gcc/java:
	* java-tree.h (flag_filelist_file, flag_assert, flag_jni,
	flag_force_classes_archive_check, flag_redundant, flag_newer,
	flag_use_divide_subroutine, flag_use_atomic_builtins,
	flag_use_boehm_gc, flag_hash_synchronization,
	flag_check_references, flag_optimize_sci, flag_indirect_classes,
	flag_indirect_dispatch, flag_store_check,
	flag_reduced_reflection): Remove.
	* jcf-dump.c (flag_newer): Remove.
	* jcf.h (quiet_flag): Remove.
	* parse.h (quiet_flag): Remove.

libcpp:
	* include/cpplib.h (cpp_options): Rename warn_deprecated,
	warn_traditional, warn_long_long and pedantic.
	* directives.c (directive_diagnostics, _cpp_handle_directive):
	Update names of cpp_options members.
	* expr.c (cpp_classify_number, eval_token): Update names of
	cpp_options members.
	* init.c (cpp_create_reader, post_options): Update names of
	cpp_options members.
	* internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
	cpp_options members.
	* macro.c (parse_params): Update names of cpp_options members.

From-SVN: r164723
2010-09-29 15:49:14 +01:00
Jakub Jelinek 2960be837a re PR rtl-optimization/45695 (-O1 wrong-code by cmove)
PR rtl-optimization/45695
	* combine.c (try_combine): When splitting a two set pattern,
	make sure the pattern which will be put into i2 doesn't use REGs
	or MEMs set by insns in between i2 and i3.

	* gcc.c-torture/execute/pr45695.c: New test.

From-SVN: r164431
2010-09-20 15:24:23 +02:00
Jakub Jelinek ef3be7da31 re PR rtl-optimization/45617 (optimize bit shift+compare at RTL level)
PR rtl-optimization/45617
	* combine.c (simplify_comparison): Optimize (X >> N) {>,>=,<,<=} C
	even if low N bits of X aren't known to be zero.

	* gcc.target/i386/pr45617.c: New test.

From-SVN: r164257
2010-09-13 23:00:03 +02:00
Andreas Krebbel c18605ccec combine.c (try_combine): Set subst_low_luid to i0.
2010-09-06  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* combine.c (try_combine): Set subst_low_luid to i0.

2010-09-06  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* gcc.dg/20100906-1.c: New testcase.

From-SVN: r163917
2010-09-06 14:20:31 +00:00
Anatoly Sokolov 07b8f0a812 target.def (class_likely_spilled_p): New hook.
* target.def (class_likely_spilled_p): New hook.
	* doc/tm.texi.in (TARGET_CLASS_LIKELY_SPILLED_P): Document.
	* doc/tm.texi: Regenerate.
	* targhooks.c (default_class_likely_spilled_p): New function.
	* targhooks.h (default_class_likely_spilled_p): Declare.
	* regs.h (CLASS_LIKELY_SPILLED_P): Remove.
	* combine.c: (cant_combine_insn_p, likely_spilled_retval_p): Use
	TARGET_CLASS_LIKELY_SPILLED_P target hook. Use HARD_REGISTER_P macro.
	Use fixed_reg_set instead of fixed_regs.
	* cse.c (hash_rtx_cb): Use TARGET_CLASS_LIKELY_SPILLED_P target hook.
	* calls.c (avoid_likely_spilled_reg): Ditto.
	* ira-conflicts.c: (ira_build_conflicts): Ditto.
	* ira.c (update_equiv_regs): Ditto.
	* mode-switching.c (create_pre_exit): Ditto.
	* regmove.c (find_matches): Ditto.
	(regclass_compatible_p): Use TARGET_CLASS_LIKELY_SPILLED_P target
	hook.
	* reload.c (SMALL_REGISTER_CLASS_P): Remove macro.
	(small_register_class_p): New inline function.
	(push_secondary_reload, find_reusable_reload, find_reloads): Use
	small_register_class_p instead of SMALL_REGISTER_CLASS_P.

	* config/i386/i386.h (CLASS_LIKELY_SPILLED_P): Remove.
	* config/i386/i386.c (ix86_class_likely_spilled_p): New.
	(TARGET_CLASS_LIKELY_SPILLED_P): Define.

From-SVN: r163779
2010-09-02 18:29:37 +04:00
Jakub Jelinek ea9f1d6fe5 re PR rtl-optimization/44858 (likely integer wrong code bug)
PR rtl-optimization/44858
	* combine.c (try_combine): If recog_for_combine added CLOBBERs to
	newi2pat, make sure they don't affect newpat.

	* gcc.c-torture/execute/pr44858.c: New test.

From-SVN: r163552
2010-08-25 19:50:59 +02:00
Jakub Jelinek 932c9bffa0 re PR rtl-optimization/45400 (XBMC AudioEngine Compilation C++ Internal Compiler Error /w Optimization)
PR rtl-optimization/45400
	* combine.c (simplify_shift_const_1) <case SUBREG>: Only use
	SUBREG_REG if both modes are of MODE_INT class.

	* g++.dg/other/i386-8.C: New test.

From-SVN: r163551
2010-08-25 19:49:26 +02:00
Bernd Schmidt 0cdf7b49f1 combine.c (find_split_point): Undo canonicalization of multiply-add to (minus x (mult)) when...
* combine.c (find_split_point): Undo canonicalization of multiply-add
	to (minus x (mult)) when it seems likely that this will increase the
	chances of a split.

	* gcc.target/i386/combine-mul.c: New test.

From-SVN: r163547
2010-08-25 14:14:59 +00:00
Bernd Schmidt 4942fc569c re PR middle-end/45355 (FAIL: gcc.c-torture/compile/pr43164.c)
PR middle-end/45355
	* combine.c (try_combine): Use reg_overlap_mentioned_p rather than
	dead_or_set_p when computing i0_feeds_i2_n.

From-SVN: r163546
2010-08-25 14:08:23 +00:00
Nathan Froyd ac47786e99 vec.h (FOR_EACH_VEC_ELT): Define.
gcc/
	* vec.h (FOR_EACH_VEC_ELT): Define.
	* c-decl.c: Use it.
	* cfgloop.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cgraph.c: Likewise.
	* cgraphunit.c: Likewise.
	* combine.c: Likewise.
	* config/bfin/bfin.c: Likewise.
	* config/mips/mips.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* dbxout.c: Likewise.
	* df-scan.c: Likewise.
	* dominance.c: Likewise.
	* dse.c: Likewise.
	* dwarf2out.c: Likewise.
	* except.c: Likewise.
	* expr.c: Likewise.
	* function.c: Likewise.
	* gcse.c: Likewise.
	* genattr.c: Likewise.
	* ggc-common.c: Likewise.
	* gimplify.c: Likewise.
	* graphite-blocking.c: Likewise.
	* graphite-clast-to-gimple.c: Likewise.
	* graphite-dependences.c: Likewise.
	* graphite-interchange.c: Likewise.
	* graphite-poly.c: Likewise.
	* graphite-scop-detection.c: Likewise.
	* graphite-sese-to-poly.c: Likewise.
	* graphite.c: Likewise.
	* haifa-sched.c: Likewise.
	* ifcvt.c: Likewise.
	* implicit-zee.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-struct-reorg.c: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-emit.c: Likewise.
	* lambda-code.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-opts.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* lto-symtab.c: Likewise.
	* matrix-reorg.c: Likewise.
	* opts.c: Likewise.
	* predict.c: Likewise.
	* print-tree.c: Likewise.
	* sdbout.c: Likewise.
	* sel-sched-dump.c: Likewise.
	* sel-sched-ir.c: Likewise.
	* sel-sched.c: Likewise.
	* sese.c: Likewise.
	* stor-layout.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-chrec.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-loop-linear.c: Likewise.
	* tree-mudflap.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-vect-slp.c: Likewise.
	* tree-vect-stmts.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.
	* value-prof.c: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.
	* vmsdbgout.c: Likewise.

gcc/ada/
	* gcc-interface/decl.c: Use FOR_EACH_VEC_ELT.
	* gcc-interface/trans.c: Likewise.
	* gcc-interface/utils.c: Likewise.

gcc/c-family/
	* c-common.c: Use FOR_EACH_VEC_ELT.
	* c-gimplify.c: Likewise.
	* c-pragma.c: Likewise.

gcc/cp/
	* call.c: Use FOR_EACH_VEC_ELT.
	* class.c: Likewise.
	* decl.c: Likewise.
	* decl2.c: Likewise.
	* error.c: Likewise.
	* except.c: Likewise.
	* mangle.c: Likewise.
	* method.c: Likewise.
	* name-lookup.c: Likewise.
	* parser.c: Likewise.
	* pt.c: Likewise.
	* repo.c: Likewise.
	* semantics.c: Likewise.
	* typeck2.c: Likewise.

gcc/fortran/
	* trans-openmp.c: Use FOR_EACH_VEC_ELT.

gcc/java/
	* class.c: Use FOR_EACH_VEC_ELT.
	* expr.c: Likewise.
	* jcf-parse.c: Likewise.
	* resource.c: Likewise.

gcc/lto/
	* lto.c: Use FOR_EACH_VEC_ELT.

From-SVN: r163401
2010-08-20 12:48:59 +00:00
Bernd Schmidt b98425dacb re PR bootstrap/45350 (Failed to bootstrap on Linux/ia64)
PR bootstrap/45350
	* combine.c (try_combine): Initialize i1_is_used and i2_is_used.  Fix
	a comment.

From-SVN: r163389
2010-08-19 23:34:07 +00:00
Bernd Schmidt 0524d2d662 re PR tree-optimization/42172 (inefficient bit fields assignments)
PR target/42172
	* combine.c (combine_validate_cost): New arg I0.  All callers changed.
	Take its cost into account if nonnull.
	(insn_a_feeds_b): New static function.
	(combine_instructions): Look for four-insn combinations.
	(can_combine_p): New args PRED2, SUCC2.  All callers changed.  Take
	them into account when computing all_adjacent and looking for other
	uses.
	(combinable_i3pat): New args I0DEST, I0_NOT_IN_SRC.  All callers
	changed.  Treat them like I1DEST and I1_NOT_IN_SRC.
	(try_combine): New arg I0.  Handle four-insn combinations.
	(distribute_notes): New arg ELIM_I0.  All callers changed.  Treat it
	like ELIM_I1.

From-SVN: r163383
2010-08-19 17:31:57 +00:00
Bernd Schmidt 5466d63d2d re PR middle-end/45182 (Failed to build SPEC CPU 2000/2006)
PR middle-end/45182
	* combine.c (make_compound_operation): Don't try to convert
	shifts into multiplications for modes that aren't SCALAR_INT_MODE_P.

	PR middle-end/45182
	* gcc.c-torture/compile/pr45182.c: New test.

From-SVN: r163057
2010-08-10 12:48:16 +00:00
Richard Henderson bd95721f86 Replace exact_log2(x & -x) in favor of more direct computation.
* toplev.h (ctz_hwi, clz_hwi, ffs_hwi): New.
	(floor_log2): Use clz_hwi.
	(exact_log2): Use ctz_hwi.
	* toplev.c (ctz_hwi, clz_hwi, ffs_hwi): New.
	* builtins.c (fold_builtin_bitop): Use them.
	* simplify-rtx.c (simplify_const_unary_operation): Likewise.
	* combine.c (get_pos_from_mask): Use ctz_hwi.
	* double-int.c (double_int_ctz): Likewise.
	* explow.c (force_reg): Likewise.
	* tree.h (SET_DECL_OFFSET_ALIGN): Use ffs_hwi.

From-SVN: r162920
2010-08-05 12:41:31 -07:00
Bernd Schmidt 29b40d79bb simplify-rtx.c (simplify_binary_operation_1): Try to simplify away NEG as operand of a MULT by merging it with the other operand.
* simplify-rtx.c (simplify_binary_operation_1): Try to simplify away
	NEG as operand of a MULT by merging it with the other operand.
	* combine.c (make_compound_operation): Use trunc_int_for_mode when
	generating a MULT with constant.  Canonicalize PLUS and MINUS involving
	MULT.
	* config/arm/constraints.md (M): Examine only 32 bits of a
	HOST_WIDE_INT.
	* config/arm/predicates.md (power_of_two_operand): Likewise.

From-SVN: r162849
2010-08-03 23:48:52 +00:00
Jakub Jelinek f0fc0803ea re PR debug/45055 (another -fcompare-debug failure with uninitialised read in walk_gimple_stmt)
PR debug/45055
	PR rtl-optimization/45137
	* rtl.h (prev_nonnote_nondebug_insn, next_nonnote_nondebug_insn): New
	prototypes.
	* emit-rtl.c (prev_nonnote_nondebug_insn, next_nonnote_nondebug_insn):
	New functions.
	* combine.c (next_nonnote_nondebug_insn): Removed.
	* ifcvt.c (noce_process_if_block): Use prev_nonnote_nondebug_insn.
	* haifa-sched.c (queue_to_ready): Use next_nonnote_nondebug_insn.
	* sched-deps.c (sched_analyze_insn): Likewise.
	(fixup_sched_groups, deps_start_bb): Use prev_nonnote_nondebug_insn.
	* rtlanal.c (canonicalize_condition): Likewise.
	* postreload.c (reload_combine_recognize_pattern): Likewise.
	(reload_cse_move2add): Use next_nonnote_nondebug_insn.

	* gcc.dg/pr45055.c: New test.

From-SVN: r162714
2010-07-30 16:36:56 +02:00
Richard Guenther 950f7f4526 double-int.h (double_int_and_not): New function.
2010-07-28  Richard Guenther  <rguenther@suse.de>

	* double-int.h (double_int_and_not): New function.
	* combine.c (try_combine): Use it.
	* tree-vrp.c (simplify_bit_ops_using_ranges): Likewise.

From-SVN: r162681
2010-07-29 13:45:47 +00:00
Bernd Schmidt 418e920fc6 rtl.def (DEBUG_INSN, [...]): Swap operands 4 and 5.
* rtl.def (DEBUG_INSN, INSN, JUMP_INSN, CALL_INSN, NOTE): Swap operands
	4 and 5.
	* rtl.h (PATTERN, INSN_LOCATOR, NOTE_DATA, NOTE_DELETED_LABEL_NAME,
	NOTE_BLOCK, NOTE_EH_HANDLER, NOTE_BASIC_BLOCK, NOTE_VAR_LOCATION,
	NOTE_KIND, LABEL_NUSES, LABEL_REFS): Adjust accordingly.
	* gengtype.c (adjust_field_rtx_def): Swap operands 4 and 5 of
	CODE_LABELs and NOTEs.
	* caller-save.c (init_caller_save): Fix up gen_rtx_INSN call.
	* combine.c (try_combine): Likewise.
	* ira.c (setup_prohibited_mode_move_regs): Likewise.
	* print-rtl.c (print_rtx): Start REG_NOTES on a new line.

From-SVN: r162602
2010-07-27 21:52:39 +00:00