Commit Graph

25 Commits

Author SHA1 Message Date
Bill Schmidt 2910586822 gimple-ssa-strength-reduction.c (find_phi_def): Don't record a phi def as possibly hiding a basis for a CAND_ADD whose operands...
2013-05-07  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gimple-ssa-strength-reduction.c (find_phi_def): Don't record a
	phi def as possibly hiding a basis for a CAND_ADD whose operands
	have been commuted in the analysis.
	(alloc_cand_and_find_basis): Add parms to call to find_phi_def.

From-SVN: r198678
2013-05-07 12:39:32 +00:00
William Schmidt 2870852531 gimple-ssa-strength-reduction.c (slsr_process_phi): Re-enable.
gcc:

2013-05-06  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gimple-ssa-strength-reduction.c (slsr_process_phi): Re-enable.
	(find_candidates_in_block): Re-enable slsr_process_phi.
	(create_phi_basis): Fix double counting of candidate adjustment.

gcc/testsuite:

2013-05-06  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.dg/tree-ssa/slsr-32.c: Re-enable.
	* gcc.dg/tree-ssa/slsr-33.c: Likewise.
	* gcc.dg/tree-ssa/slsr-34.c: Likewise.
	* gcc.dg/tree-ssa/slsr-35.c: Likewise.
	* gcc.dg/tree-ssa/slsr-36.c: Likewise.
	* gcc.dg/tree-ssa/slsr-37.c: Likewise.
	* gcc.dg/tree-ssa/slsr-38.c: Likewise.

From-SVN: r198627
2013-05-06 13:31:39 +00:00
Bill Schmidt 2cefad900d gimple-ssa-strength-reduction.c (slsr_process_phi): Disable.
gcc:

2013-05-03  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gimple-ssa-strength-reduction.c (slsr_process_phi): Disable.
	(find_candidates_in_block): Disable slsr_process_phi.

gcc/testsuite:

2013-05-03  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.dg/tree-ssa/slsr-32.c: Skip test for now.
	* gcc.dg/tree-ssa/slsr-33.c: Likewise.
	* gcc.dg/tree-ssa/slsr-34.c: Likewise.
	* gcc.dg/tree-ssa/slsr-35.c: Likewise.
	* gcc.dg/tree-ssa/slsr-36.c: Likewise.
	* gcc.dg/tree-ssa/slsr-37.c: Likewise.
	* gcc.dg/tree-ssa/slsr-38.c: Likewise.

From-SVN: r198592
2013-05-04 04:57:32 +00:00
Bill Schmidt 9b92d12b10 gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI.
gcc:

2013-05-03  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI.
	(slsr_cand_d): Redefine def_phi.
	(stride_status, phi_adjust_status, count_phis_status): New enums.
	(find_phi_def): New.
	(find_basis_for_base_expr): New.
	(find_basis_for_candidate): Handle hidden bases.
	(alloc_cand_and_find_basis): Handle phi candidates.
	(slsr_process_phi): New.
	(create_mul_ssa_cand): Exclude phi base candidates; use integer_onep.
	(create_mul_imm_cand): Likewise.
	(create_add_ssa_cand): Exclude phi base candidates.
	(create_add_imm_cand): Likewise.
	(slsr_process_cast): Likewise.
	(slsr_process_copy): Likewise.
	(find_candidates_in_block): Handle phi candidates.
	(dump_candidate): Likewise.
	(unconditional_cands): Delete.
	(unconditional_cands_with_known_stride_p): Delete.
	(phi_dependent_cand_p): New.
	(cand_increment): Handle phi-dependent candidates.
	(replace_dependent): Delete.
	(replace_mult_candidate): New.
	(replace_unconditional_candidate): New.
	(incr_vec_index): Move to avoid forward reference.
	(create_add_on_incoming_edge): New.
	(create_phi_basis): New.
	(replace_dependents): Delete.
	(replace_conditional_candidate): New.
	(phi_add_costs): New.
	(replace_uncond_cands_and_profitable_phis): New.
	(record_increment): Handle phi adjustments.
	(record_phi_increments): New.
	(record_increments): Handle phi adjustments.
	(phi_incr_cost): New.
	(lowest_cost_path): Handle phis.
	(total_savings): Likewise.
	(analyze_increments): Likewise.
	(ncd_with_phi): New.
	(ncd_of_cand_and_phis): New.
	(nearest_common_dominator_for_cands): Handle phi increments.
	(all_phi_incrs_profitable): New.
	(replace_profitable_candidates): Handle phi-dependent candidates.
	(analyze_candidates_and_replace): Likewise.

gcc/testsuite:

2013-05-03  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.dg/tree-ssa/slsr-32.c: New.
	* gcc.dg/tree-ssa/slsr-33.c: New.
	* gcc.dg/tree-ssa/slsr-34.c: New.
	* gcc.dg/tree-ssa/slsr-35.c: New.
	* gcc.dg/tree-ssa/slsr-36.c: New.
	* gcc.dg/tree-ssa/slsr-37.c: New.
	* gcc.dg/tree-ssa/slsr-38.c: New.

From-SVN: r198586
2013-05-03 18:56:39 +00:00
Lawrence Crowl 4a8fb1a1de This patch is the main part of a consolodation of the hash_table patches to the...
This patch is the main part of a consolodation of the hash_table
patches to the cxx-conversion branch for files not under gcc/config.

Update various hash tables from htab_t to hash_table.
Modify types and calls to match.

* tree-parloops.c'reduction
* tree-parloops.c'name_to_copy

Fold reduction_info_hash and reduction_info_eq into new struct
reduction_hasher.  Fold name_to_copy_elt_eq and name_to_copy_elt_hash
into new struct name_to_copy_hasher.

* trans-mem.c'tm_log

Fold tm_log_hash, tm_log_eq, tm_log_free into new struct log_entry_hasher.

* trans-mem.c'tm_memopt_value_numbers

Fold tm_memop_hash, tm_memop_eq into new struct tm_memop_hasher.

* tree-ssa-strlen.c'decl_to_stridxlist_htab

Fold decl_to_stridxlist_hash into new struct stridxlist_hasher.

* tree-ssa-loop-ivopts.c'ivopts_data::inv_expr_tab

Fold htab_inv_expr_hash and htab_inv_expr_eq into new struct
iv_inv_expr_hasher.

* tree-ssa-uncprop.c'equiv

Equiv renamed to val_ssa_equiv because of name ambiguity with local variables.

Fold equiv_hash, equiv_eq and equiv_free into new struct val_ssa_equiv_hasher.

Renamed variables equiv_hash_elt to an_equiv_elt because of name ambiguity
with struct type.  Changed equiv_hash_elt_p to an_equiv_elt_p to match.

* tree-ssa-phiopt.c'seen_ssa_names

Fold name_to_bb_hash and name_to_bb_eq into new struct ssa_names_hasher.

* tree-ssa-structalias.c'pointer_equiv_class_table
* tree-ssa-structalias.c'location_equiv_class_table

Fold equiv_class_label_hash and equiv_class_label_eq into new
struct equiv_class_hasher.

* tree-ssa-structalias.c'shared_bitmap_table

Fold shared_bitmap_hash and shared_bitmap_eq into new struct
shared_bitmap_hasher.

* tree-ssa-live.c'var_map_base_init::tree_to_index

New struct tree_int_map_hasher.

* tree-sra.c'candidates

Fold uid_decl_map_hash and uid_decl_map_eq into new struct
uid_decl_hasher.  This change moves the definitions from tree-ssa.c
into tree-sra.c and removes the declarations from tree-flow.h

tree-browser.c

Remove stale declaration of removed TB_parent_eq.
Fix template parameter for base class to match value_type.

gimple.h

Use gimplify_hasher::hash rather than gimple_tree_hash in the
  assertion check.
Change return values to match return type. (I.e. no conversions.)

* graphite-clast-to-gimple.c'ivs_params::newivs_index
* graphite-clast-to-gimple.c'ivs_params::params_index
* graphite-clast-to-gimple.c'print_generated_program::params_index
* graphite-clast-to-gimple.c'gloog::newivs_index
* graphite-clast-to-gimple.c'gloog::params_index
* graphite.c graphite_transform_loops::bb_pbb_mapping
* sese.c copy_bb_and_scalar_dependences::rename_map

Move hash table declarations to a new graphite-htab.h, because they
are used in few places.

Remove unused:

htab_t scop::original_pddrs
SCOP_ORIGINAL_PDDRS

Remove unused:

insert_loop_close_phis
insert_guard_phis
debug_ivtype_map
ivtype_map_elt_info
new_ivtype_map_elt

* gimplify.c'gimplify_ctx::temp_htab

Move struct gimple_temp_hash_elt and struct gimplify_ctx to a new
gimplify-ctx.h, because they are used few places.

* cselib.c'cselib_hash_table
* gcse.c'pre_ldst_table
* gimple-ssa-strength-reduction.c'base_cand_map
* haifa-sched.c'delay_htab
* haifa-sched.c'delay_htab_i2
* ira-color.c'allocno_hard_regs_htab
* ira-costs.c'cost_classes_htab
* loop-invariant.c'merge_identical_invariants::eq
* loop-iv.c'bivs
* loop-unroll.c'opt_info::insns_to_split
* loop-unroll.c'opt_info::insns_with_var_to_expand
* passes.c'name_to_pass_map
* plugin.c'event_tab
* postreload-gcse.c'expr_table
* store-motion.c'store_motion_mems_table
* tree-cfg.c'discriminator_per_locus
* tree-scalar-evolution.c'resolve_mixers::cache
* tree-ssa-dom.c'avail_exprs

Remove unused:
dse.c bitmap clear_alias_sets
dse.c bitmap disqualified_clear_alias_sets
dse.c alloc_pool clear_alias_mode_pool
dse.c dse_step2_spill
dse.c dse_step5_spill
graphds.h htab_t graph::indices

* attribs.c'scoped_attributes::attribute_hash
* bitmap.c'bitmap_desc_hash
* dwarf2cfi.c'trace_index
* dwarf2out.c'break_out_includes::cu_hash_table
* dwarf2out.c'copy_decls_for_unworthy_types::decl_table
* dwarf2out.c'optimize_external_refs::map
* dwarf2out.c'output_comp_unit::extern_map
* dwarf2out.c'output_comdat_type_unit::extern_map
* dwarf2out.c'output_macinfo::macinfo_htab
* dwarf2out.c'optimize_location_lists::htab
* dwarf2out.c'dwarf2out_finish::comdat_type_table
* except.c'ehspec_hash_type
* except.c'assign_filter_values::ttypes
* except.c'assign_filter_values::ehspec
* except.c'sjlj_assign_call_site_values::ar_hash
* except.c'convert_to_eh_region_ranges::ar_hash
* trans-mem.c'tm_new_mem_hash
* tree-browser.c'TB_up_ht
* tree-eh.c'finally_tree

Move the declaration of hash_table <alloc_pool_hasher> alloc_pool_hash
in alloc-pool.c to after the method definitions for its parameter
class.

* ggc-common.c'loc_hash
* ggc-common.c'ptr_hash

Add a new hash_table method elements_with_deleted to meet the needs of
gcc-common.c.

Correct many methods with parameter types compare_type to the correct
value_type.  (Correct code was unlikely to notice the change, but
incorrect code will.)

* tree-complex.c'complex_variable_components
* tree-parloops.c'eliminate_local_variables_stmt::decl_address
* tree-parloops.c'separate_decls_in_region::decl_copies

Move hash table declarations to a new tree-hasher.h, to resolve
compilation dependences and because they are used in few places.

* lto-streamer.h'output_block::string_hash_table
* lto-streamer-in.c'file_name_hash_table
* lto-streamer.c'tree_htab

The struct string_slot moves from data-streamer.h to lto-streamer.h to
resolve compilation dependences.

Tested on x86_64.


Index: gcc/ChangeLog

2013-04-25  Lawrence Crowl  <crowl@google.com>

	* Makefile.in: Update as needed below.

	* alloc-pool.c (static hash_table <alloc_pool_hasher> alloc_pool_hash):
	Move declaration to after the type's method definitons.

	* attribs.c (htab_t scoped_attributes::attribute_hash):
	Change type to hash_table.  Update dependent calls and types.

	* bitmap.c (htab_t bitmap_desc_hash):
	Change type to hash_table.  Update dependent calls and types.

	* cselib.c (htab_t cselib_hash_table):
	Change type to hash_table.  Update dependent calls and types.

	* data-streamer.h (struct string_slot): Move to lto-streamer.h.
	(hash_string_slot_node): Move implementation into lto-streamer.h
	struct string_slot_hasher.
	(eq_string_slot_node): Likewise.

	* data-streamer-out.c: Update output_block::string_hash_table
	dependent calls and types.

	* dwarf2cfi.c (htab_t trace_index):
	Change type to hash_table.  Update dependent calls and types.

	* dwarf2out.c (htab_t break_out_includes::cu_hash_table):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t copy_decls_for_unworthy_types::decl_table): Likewise.
	(htab_t optimize_external_refs::map): Likewise.
	(htab_t output_comp_unit::extern_map): Likewise.
	(htab_t output_comdat_type_unit::extern_map): Likewise.
	(htab_t output_macinfo::macinfo_htab): Likewise.
	(htab_t optimize_location_lists::htab): Likewise.
	(htab_t dwarf2out_finish::comdat_type_table): Likewise.

	* except.c (htab_t ehspec_hash_type):
	Change type to hash_table.  Update dependent calls and types.
	(assign_filter_values::ttypes): Likewise.
	(assign_filter_values::ehspec): Likewise.
	(sjlj_assign_call_site_values::ar_hash): Likewise.
	(convert_to_eh_region_ranges::ar_hash): Likewise.

	* gcse.c (htab_t pre_ldst_table):
	Change type to hash_table.  Update dependent calls and types.

	* ggc-common.c (htab_t saving_htab):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t loc_hash): Likewise.
	(htab_t ptr_hash): Likewise.
	(call_count): Rename ggc_call_count.
	(call_alloc): Rename ggc_call_alloc.
	(loc_descriptor): Rename make_loc_descriptor.
	(add_statistics): Rename ggc_add_statistics.

	* ggc-common.c (saving_htab):
	Change type to hash_table.  Update dependent calls and types.

	* gimple.h (struct gimplify_ctx): Move to gimplify-ctx.h.
	(push_gimplify_context): Likewise.
	(pop_gimplify_context): Likewise.
	(struct gimple_temp_hash_elt): Added.
	(struct gimplify_hasher): Likewise.
	(struct gimplify_ctx.temp_htab):
	Change type to hash_table.  Update dependent calls and types.

	* gimple-fold.c: Include gimplify-ctx.h.

	* gimple-ssa-strength-reduction.c (htab_t base_cand_map):
	Change type to hash_table.  Update dependent calls and types.
	(base_cand_dump_callback): Rename to ssa_base_cand_dump_callback to
	avoid potential global name collision.

	* gimplify.c: Include gimplify-ctx.h.
	(struct gimple_temp_hash_elt): Move to gimplify-ctx.h.
	(htab_t gimplify_ctx::temp_htab):
	Update dependent calls and types for new type hash_table.
	(gimple_tree_hash): Move into gimplify_hasher in gimplify-ctx.h.
	(gimple_tree_eq): Move into gimplify_hasher in gimplify-ctx.h.

	* gimplify-ctx.h: New.
	(struct gimple_temp_hash_elt): Move from gimplify.c.
	(class gimplify_hasher): New.
	(struct gimplify_ctx): Move from gimple.h.
	(htab_t gimplify_ctx::temp_htab):
	Change type to hash_table.  Update dependent calls and types.

	* graphite-clast-to-gimple.c: Include graphite-htab.h.
	(htab_t ivs_params::newivs_index):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t ivs_params::params_index): Likewise.
	(htab_t print_generated_program::params_index): Likewise.
	(htab_t gloog::newivs_index): Likewise.
	(htab_t gloog::params_index): Likewise.

	* graphite.c: Include graphite-htab.h.
	4htab_t graphite_transform_loops::bb_pbb_mapping):
	Change type to hash_table.  Update dependent calls and types.

	* graphite-clast-to-gimple.h: (extern gloog) Move to graphite-htab.h.
	(bb_pbb_map_hash): Fold into bb_pbb_htab_type in graphite-htab.h.
	(eq_bb_pbb_map): Fold into bb_pbb_htab_type in graphite-htab.h.

	* graphite-dependences.c: Include graphite-htab.h.
	(loop_is_parallel_p): Change hash table type of parameter.

	* graphite-htab.h: New.
	(typedef hash_table <bb_pbb_hasher> bb_pbb_htab_type): New.
	(extern find_pbb_via_hash): Move from graphite-poly.h.
	(extern loop_is_parallel_p): Move from graphite-poly.h.
	(extern get_loop_body_pbbs): Move from graphite-poly.h.

	* graphite-poly.h (extern find_pbb_via_hash): Move to graphite-htab.h.
	(extern loop_is_parallel_p): Move to graphite-htab.h.
	(extern get_loop_body_pbbs): Move to graphite-htab.h.

	* haifa-sched.c (htab_t delay_htab):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t delay_htab_i2): Likewise.

	* ira-color.c (htab_t allocno_hard_regs_htab):
	Change type to hash_table.  Update dependent calls and types.

	* ira-costs.c (htab_t cost_classes_htab):
	Change type to hash_table.  Update dependent calls and types.

	* loop-invariant.c (htab_t merge_identical_invariants::eq):
	Change type to hash_table.  Update dependent calls and types.

	* loop-iv.c (htab_t bivs):
	Change type to hash_table.  Update dependent calls and types.

	* loop-unroll.c (htab_t opt_info::insns_to_split):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t opt_info::insns_with_var_to_expand): Likewise.

	* lto-streamer.h (struct string_slot): Move from data-streamer.h
	(struct string_slot_hasher): New.
	(htab_t output_block::string_hash_table):
	Change type to hash_table.  Update dependent calls and types.

	* lto-streamer-in.c (freeing_string_slot_hasher): New.
	(htab_t file_name_hash_table):
	Change type to hash_table.  Update dependent calls and types.

	* lto-streamer-out.c: Update output_block::string_hash_table dependent
	calls and types.

	* lto-streamer.c (htab_t tree_htab):
	Change type to hash_table.  Update dependent calls and types.

	* omp-low.c: Include gimplify-ctx.h.

	* passes.c (htab_t name_to_pass_map):
	Change type to hash_table.  Update dependent calls and types.
	(pass_traverse): Rename to passes_pass_traverse.

	* plugin.c (htab_t event_tab):
	Change type to hash_table.  Update dependent calls and types.

	* postreload-gcse.c (htab_t expr_table):
	Change type to hash_table.  Update dependent calls and types.
	(dump_hash_table_entry): Rename dump_expr_hash_table_entry.

	* sese.c (debug_rename_map_1): Make extern.
	(htab_t copy_bb_and_scalar_dependences::rename_map):
	Change type to hash_table.  Update dependent calls and types.

	* sese.h (extern debug_rename_map): Move to .c file.

	* store-motion.c (htab_t store_motion_mems_table):
	Change type to hash_table.  Update dependent calls and types.

	* trans-mem.c (htab_t tm_new_mem_hash):
	Change type to hash_table.  Update dependent calls and types.

	* tree-browser.c (htab_t TB_up_ht):
	Change type to hash_table.  Update dependent calls and types.

	* tree-cfg.c (htab_t discriminator_per_locus):
	Change type to hash_table.  Update dependent calls and types.

	* tree-complex.c: Include tree-hasher.h
	(htab_t complex_variable_components):
	Change type to hash_table.  Update dependent calls and types.

	* tree-eh.c (htab_t finally_tree):
	Change type to hash_table.  Update dependent calls and types.

	* tree-flow.h (extern int_tree_map_hash): Moved into tree-hasher
	struct int_tree_hasher.
	(extern int_tree_map_eq): Likewise.
	(uid_decl_map_hash): Removed.
	(extern decl_tree_map_eq): Likewise.

	* tree-hasher.h: New.
	(struct int_tree_hasher): New.
	(typedef int_tree_htab_type): New.

	* tree-inline.c: Include gimplify-ctx.h.

	* tree-mudflap.c: Include gimplify-ctx.h.

	* tree-parloops.c: Include tree-hasher.h.
	(htab_t eliminate_local_variables_stmt::decl_address):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t separate_decls_in_region::decl_copies): Likewise.

	* tree-scalar-evolution.c (htab_t resolve_mixers::cache):
	Change type to hash_table.  Update dependent calls and types.

	* tree-sra.c (candidates):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa.c (int_tree_map_eq): Moved into struct int_tree_hasher
	in tree-flow.h.
	(int_tree_map_hash): Likewise.

	* tree-ssa-dom.c (htab_t avail_exprs):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-live.c (var_map_base_init::tree_to_index):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-loop-ivopts.c (struct ivopts_data.inv_expr_tab):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-phiopt.c (seen_ssa_names):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-strlen.c (decl_to_stridxlist_htab):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-uncprop.c (equiv):
	Change type to hash_table.  Update dependent calls and types.

From-SVN: r198329
2013-04-26 00:28:35 +00:00
Jakub Jelinek 7b8265ba38 re PR tree-optimization/56962 (SLSR caused miscompilation of fftw)
PR tree-optimization/56962
	* gimple-ssa-strength-reduction.c (record_increment): Only set
	initializer if gimple_assign_rhs_code is {,POINTER_}PLUS_EXPR and
	either rhs1 or rhs2 is equal to c->base_expr.

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

From-SVN: r197978
2013-04-15 16:56:36 +02:00
Richard Sandiford d1e082c2c2 Update copyright years in gcc/
From-SVN: r195098
2013-01-10 20:38:27 +00:00
Aldy Hernandez 7139194bf9 re PR tree-optimization/55350 (verify_gimple failed with invalid (pointer) operands to plus/minus)
PR tree-optimization/55350
	* gimple-ssa-strength-reduction.c (replace_dependent): Handle
	POINTER_{PLUS,MINUS}_EXPR correctly.

From-SVN: r193672
2012-11-20 18:28:09 +00:00
Diego Novillo 9771b26396 This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'.
This patch rewrites the old VEC macro-based interface into a new one
based on the template class 'vec'.  The user-visible changes are
described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec.

I have tested the patch pretty extensively:

- Regular bootstraps on x86_64, ppc, ia64, sparc and hppa.
- Bootstraps with --enable-checking=release
- Bootstraps with --enable-checking=gc,gcac
- Basic builds on all targets (using contrib/config-list.mk).

We no longer access the vectors via VEC_* macros.  The pattern is
"VEC_operation (T, A, V, args)" becomes "V.operation (args)".

The only thing I could not do is create proper ctors and dtors for the
vec class.  Since these vectors are stored in unions, we
have to keep them as PODs (C++03 does not allow non-PODs in unions).

This means that creation and destruction must be explicit.  There is a
new method vec<type, allocation, layout>::create() and another vec<type,
allocation, layout>::destroy() to allocate the internal vector.

For vectors that must be pointers, there is a family of free functions
that implement the operations that need to tolerate NULL vectors.
These functions all start with the prefix 'vec_safe_'.  See the wiki
page for details.

The gengtype change removes the special handling for VEC() that used
to exist in gengtype. Additionally, it allows gengtype to recognize
templates of more than one argument and introduces the concept of an
undefined type (useful for template arguments that may or may not be
types).

When a TYPE_UNDEFINED is reached, gengtype will ignore it if it
happens inside a type marked with GTY((user)).  Otherwise, it will
emit an error.

Finally, gengtype rejects root types marked GTY((user)) that are not
first class pointers.

2012-11-16  Diego Novillo  <dnovillo@google.com>

	VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)

	* vec.c (register_overhead): Convert it into
	member function of vec_prefix.
	(release_overhead): Likewise.
	(calculate_allocation): Likewise.
	(vec_heap_free): Remove.
	(vec_gc_o_reserve_1): Remove.
	(vec_heap_o_reserve_1): Remove.
	(vec_stack_o_reserve_1): Remove.
	(vec_stack_o_reserve_exact): Remove.
	(register_stack_vec): New.
	(stack_vec_register_index): New.
	(unregister_stack_vec): New.
	(vec_assert_fail): Remove.
	* vec.h: Conditionally include ggc.h.  Document conditional
	hackery.
	Update top-level documentation.
	(ALONE_VEC_CHECK_INFO): Remove.
	(VEC_CHECK_INFO): Remove.
	(ALONE_VEC_CHECK_DECL): Remove.
	(VEC_CHECK_DECL): Remove.
	(ALONE_VEC_CHECK_PASS): Remove.
	(VEC_CHECK_PASS): Remove.
	(VEC_ASSERT): Remove.
	(vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and
	va_stack.
	Mark fields alloc_ and num_ as protected.
	(struct vec_t): Remove.  Remove all function members.
	(struct vl_embed): Declare.
	(struct vl_ptr): Declare.
	(free): Remove.
	(reserve_exact): Remove.
	(reserve): Remove.
	(safe_splice): Remove.
	(safe_push): Remove.
	(safe_grow): Remove.
	(safe_grow_cleared): Remove.
	(safe_insert): Remove.
	(DEF_VEC_I): Remove.
	(DEF_VEC_ALLOC_I): Remove.
	(DEF_VEC_P): Remove.
	(DEF_VEC_ALLOC_P): Remove.
	(DEF_VEC_O): Remove.
	(DEF_VEC_ALLOC_O): Remove.
	(DEF_VEC_ALLOC_P_STACK): Remove.
	(DEF_VEC_ALLOC_O_STACK): Remove.
	(DEF_VEC_ALLOC_I_STACK): Remove.
	(DEF_VEC_A): Remove.
	(DEF_VEC_ALLOC_A): Remove.
	(vec_stack_p_reserve_exact_1): Remove.
	(vec_stack_o_reserve): Remove.
	(vec_stack_o_reserve_exact): Remove.
	(VEC_length): Remove.
	(VEC_empty): Remove.
	(VEC_address): Remove.
	(vec_address): Remove.
	(VEC_last): Remove.
	(VEC_index): Remove.
	(VEC_iterate): Remove.
	(VEC_embedded_size): Remove.
	(VEC_embedded_init): Remove.
	(VEC_free): Remove.
	(VEC_copy): Remove.
	(VEC_space): Remove.
	(VEC_reserve): Remove.
	(VEC_reserve_exact): Remove.
	(VEC_splice): Remove.
	(VEC_safe_splice): Remove.
	(VEC_quick_push): Remove.
	(VEC_safe_push): Remove.
	(VEC_pop): Remove.
	(VEC_truncate): Remove.
	(VEC_safe_grow): Remove.
	(VEC_replace): Remove.
	(VEC_quick_insert): Remove.
	(VEC_safe_insert): Remove.
	(VEC_ordered_remove): Remove.
	(VEC_unordered_remove): Remove.
	(VEC_block_remove): Remove.
	(VEC_lower_bound): Remove.
	(VEC_alloc): Remove.
	(VEC_qsort): Remove.

	(va_heap): Declare.
	(va_heap::default_layout): New typedef to vl_ptr.
	(va_heap::reserve): New.
	(va_heap::release): New.
	(va_gc): Declare.
	(va_gc::default_layout): New typedef to vl_embed.
	(va_gc::reserve): New.
	(va_gc::release): New.
	(va_gc_atomic): Declare.  Inherit from va_gc.
	(va_stack): Declare.
	(va_stack::default_layout): New typedef to vl_ptr.
	(va_stack::alloc): New.
	(va_stack::reserve): New.
	(va_stack::release): New.
	(register_stack_vec): Declare.
	(stack_vec_register_index): Declare.
	(unregister_stack_vec): Declare.

	(vec<T, A = va_heap, L = typename A::default_layout>): Declare
	empty vec template.
	(vec<T, A, vl_embed>): Partial specialization for embedded
	layout.
	(vec<T, A, vl_embed>::allocated): New.
	(vec<T, A, vl_embed>::length): New.
	(vec<T, A, vl_embed>::is_empty): New.
	(vec<T, A, vl_embed>::address): New.
	(vec<T, A, vl_embed>::operator[]): New.
	(vec<T, A, vl_embed>::last New.
	(vec<T, A, vl_embed>::space): New.
	(vec<T, A, vl_embed>::iterate): New.
	(vec<T, A, vl_embed>::iterate): New.
	(vec<T, A, vl_embed>::copy): New.
	(vec<T, A, vl_embed>::splice): New.
	(vec<T, A, vl_embed>::quick_push New.
	(vec<T, A, vl_embed>::pop New.
	(vec<T, A, vl_embed>::truncate): New.
	(vec<T, A, vl_embed>::quick_insert): New.
	(vec<T, A, vl_embed>::ordered_remove): New.
	(vec<T, A, vl_embed>::unordered_remove): New.
	(vec<T, A, vl_embed>::block_remove): New.
	(vec<T, A, vl_embed>::qsort): New.
	(vec<T, A, vl_embed>::lower_bound): New.
	(vec<T, A, vl_embed>::embedded_size): New.
	(vec<T, A, vl_embed>::embedded_init): New.
	(vec<T, A, vl_embed>::quick_grow): New.
	(vec<T, A, vl_embed>::quick_grow_cleared): New.
	(vec_safe_space): New.
	(vec_safe_length): New.
	(vec_safe_address): New.
	(vec_safe_is_empty): New.
	(vec_safe_reserve): New.
	(vec_safe_reserve_exact): New.
	(vec_alloc): New.
	(vec_free): New.
	(vec_safe_grow): New.
	(vec_safe_grow_cleared): New.
	(vec_safe_iterate): New.
	(vec_safe_push): New.
	(vec_safe_insert): New.
	(vec_safe_truncate): New.
	(vec_safe_copy): New.
	(vec_safe_splice): New.

	(vec<T, A, vl_ptr>): New partial specialization for the space
	efficient layout.
	(vec<T, A, vl_ptr>::exists): New.
	(vec<T, A, vl_ptr>::is_empty): New.
	(vec<T, A, vl_ptr>::length): New.
	(vec<T, A, vl_ptr>::address): New.
	(vec<T, A, vl_ptr>::operator[]): New.
	(vec<T, A, vl_ptr>::operator!=): New.
	(vec<T, A, vl_ptr>::operator==): New.
	(vec<T, A, vl_ptr>::last): New.
	(vec<T, A, vl_ptr>::space): New.
	(vec<T, A, vl_ptr>::iterate): New.
	(vec<T, A, vl_ptr>::copy): New.
	(vec<T, A, vl_ptr>::reserve): New.
	(vec<T, A, vl_ptr>::reserve_exact): New.
	(vec<T, A, vl_ptr>::splice): New.
	(vec<T, A, vl_ptr>::safe_splice): New.
	(vec<T, A, vl_ptr>::quick_push): New.
	(vec<T, A, vl_ptr>::safe_push): New.
	(vec<T, A, vl_ptr>::pop): New.
	(vec<T, A, vl_ptr>::truncate): New.
	(vec<T, A, vl_ptr>::safe_grow): New.
	(vec<T, A, vl_ptr>::safe_grow_cleared): New.
	(vec<T, A, vl_ptr>::quick_grow): New.
	(vec<T, A, vl_ptr>::quick_grow_cleared): New.
	(vec<T, A, vl_ptr>::quick_insert): New.
	(vec<T, A, vl_ptr>::safe_insert): New.
	(vec<T, A, vl_ptr>::ordered_remove): New.
	(vec<T, A, vl_ptr>::unordered_remove): New.
	(vec<T, A, vl_ptr>::block_remove): New.
	(vec<T, A, vl_ptr>::qsort): New.
	(vec<T, A, vl_ptr>::lower_bound): New.
	(vec_stack_alloc): Define.
	(FOR_EACH_VEC_SAFE_ELT): Define.
	* vecir.h: Remove.  Update all users.
	* vecprim.h: Remove.  Update all users.
	Move uchar to coretypes.h.

	* Makefile.in (VEC_H): Add $(GGC_H).
	Remove vecir.h and vecprim.h dependencies everywhere.

2012-11-16  Diego Novillo  <dnovillo@google.com>

	* gengtype-lex.l (VEC): Remove.
	Add characters in the set [\!\>\.-].
	* gengtype-parse.c (token_names): Remove "VEC".
	(require_template_declaration): Remove handling of VEC_TOKEN.
	(type): Likewise.
	Call create_user_defined_type when parsing GTY((user)).
	* gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED.
	(write_state_undefined_type): New.
	(write_state_type): Call write_state_undefined_type for
	TYPE_UNDEFINED.
	(read_state_type): Call read_state_undefined_type for
	TYPE_UNDEFINED.
	* gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED.
	(create_user_defined_type): Make extern.
	(type_for_name): Factor out of resolve_typedef.
	(create_undefined_type): New
	(resolve_typedef): Call it when we cannot find a previous
	typedef and the type is not a template.
	(find_structure): Accept TYPE_UNDEFINED.
	(set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES,
	default to false.
	Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or
	ALLOWED_UNDEFINED_TYPES is set.
	Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT.
	(filter_type_name): Accept templates with more than one
	argument.
	(output_mangled_typename): Handle TYPE_UNDEFINED
	(walk_type): Likewise.
	(write_types_process_field): Likewise.
	(write_func_for_structure): If CHAIN_NEXT is set, ORIG_S
	should not be a user-defined type.
	(write_types_local_user_process_field): Handle TYPE_ARRAY,
	TYPE_NONE and TYPE_UNDEFINED.
	(write_types_local_process_field): Likewise.
	(contains_scalar_p): Return 0 for TYPE_USER_STRUCT.
	(write_root): Reject user-defined types that are not pointers.
	Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT
	and TYPE_PARAM_STRUCT.
	(output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and
	TYPE_ARRAY.
	(dump_typekind): Handle TYPE_UNDEFINED.
	* gengtype.h (enum typekind): Add TYPE_UNDEFINED.
	(create_user_defined_type): Declare.
	(enum gty_token): Remove VEC_TOKEN.

2012-11-16  Diego Novillo  <dnovillo@google.com>

	Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)

	* coretypes.h (uchar): Define.
	* alias.c: Use new vec API in vec.h.
	* asan.c: Likewise.
	* attribs.c: Likewise.
	* basic-block.h: Likewise.
	* bb-reorder.c: Likewise.
	* builtins.c: Likewise.
	* calls.c: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfgexpand.c: Likewise.
	* cfghooks.c: Likewise.
	* cfghooks.h: Likewise.
	* cfgloop.c: Likewise.
	* cfgloop.h: Likewise.
	* cfgloopanal.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.c: Likewise.
	* cgraph.h: Likewise.
	* cgraphclones.c: Likewise.
	* cgraphunit.c: Likewise.
	* combine.c: Likewise.
	* compare-elim.c: Likewise.
	* coverage.c: Likewise.
	* cprop.c: Likewise.
	* data-streamer.h: Likewise.
	* dbxout.c: Likewise.
	* dce.c: Likewise.
	* df-core.c: Likewise.
	* df-problems.c: Likewise.
	* df-scan.c: Likewise.
	* dominance.c: Likewise.
	* domwalk.c: Likewise.
	* domwalk.h: Likewise.
	* dse.c: Likewise.
	* dwarf2cfi.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarf2out.h: Likewise.
	* emit-rtl.c: Likewise.
	* except.c: Likewise.
	* except.h: Likewise.
	* expr.c: Likewise.
	* expr.h: Likewise.
	* final.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* function.h: Likewise.
	* fwprop.c: Likewise.
	* gcc.c: Likewise.
	* gcse.c: Likewise.
	* genattr.c: Likewise.
	* genattrtab.c: Likewise.
	* genautomata.c: Likewise.
	* genextract.c: Likewise.
	* genopinit.c: Likewise
	* ggc-common.c: Likewise.
	* ggc.h: Likewise.
	* gimple-low.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimple-streamer-in.c: Likewise.
	* gimple.c: Likewise.
	* gimple.h: Likewise.
	* gimplify.c: Likewise.
	* graph.c: Likewise.
	* graphds.c: Likewise.
	* graphds.h: Likewise.
	* graphite-blocking.c: Likewise.
	* graphite-clast-to-gimple.c: Likewise.
	* graphite-dependences.c: Likewise.
	* graphite-interchange.c: Likewise.
	* graphite-optimize-isl.c: Likewise.
	* graphite-poly.c: Likewise.
	* graphite-poly.h: Likewise.
	* graphite-scop-detection.c: Likewise.
	* graphite-scop-detection.h: Likewise.
	* graphite-sese-to-poly.c: Likewise.
	* graphite.c: Likewise.
	* godump.c: Likewise.
	* haifa-sched.c: Likewise.
	* hw-doloop.c: Likewise.
	* hw-doloop.h: Likewise.
	* ifcvt.c: Likewise.
	* insn-addr.h: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* ipa-inline-transform.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-inline.h: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-prop.h: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-ref-inline.h: Likewise.
	* ipa-ref.c: Likewise.
	* ipa-ref.h: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa-utils.h: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-emit.c: Likewise.
	* ira-int.h: Likewise.
	* ira.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lra-lives.c: Likewise.
	* lra.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-section-out.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.h: Likewise.
	* lto-symtab.c: Likewise.
	* mcf.c: Likewise.
	* modulo-sched.c: Likewise.
	* omp-low.c: Likewise.
	* opts-common.c: Likewise.
	* opts-global.c: Likewise.
	* opts.c: Likewise.
	* opts.h: Likewise.
	* passes.c: Likewise.
	* predict.c: Likewise.
	* print-tree.c: Likewise.
	* profile.c: Likewise.
	* profile.h: Likewise.
	* read-rtl.c: Likewise.
	* ree.c: Likewise.
	* reg-stack.c: Likewise.
	* regrename.c: Likewise.
	* regrename.h: Likewise.
	* reload.c: Likewise.
	* reload.h: Likewise.
	* reload1.c: Likewise.
	* rtl.h: Likewise.
	* sched-deps.c: Likewise.
	* sched-int.h: Likewise.
	* sdbout.c: Likewise.
	* sel-sched-dump.c: Likewise.
	* sel-sched-ir.c: Likewise.
	* sel-sched-ir.h: Likewise.
	* sel-sched.c: Likewise.
	* sese.c: Likewise.
	* sese.h: Likewise.
	* statistics.h: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* store-motion.c: Likewise.
	* tlink.c: Likewise.
	* toplev.c: Likewise.
	* trans-mem.c: Likewise.
	* tree-browser.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-chrec.c: Likewise.
	* tree-chrec.h: Likewise.
	* tree-complex.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-data-ref.h: Likewise.
	* tree-dfa.c: Likewise.
	* tree-diagnostic.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-flow.h: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-inline.h: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-iterator.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-mudflap.c: Likewise.
	* tree-optimize.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-live.h: 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-math-opts.c: Likewise.
	* tree-ssa-operands.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-sccvn.h: Likewise.
	* tree-ssa-strlen.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.
	* tree-ssanames.c: Likewise.
	* tree-stdarg.c: Likewise.
	* tree-streamer-in.c: Likewise.
	* tree-streamer-out.c: Likewise.
	* tree-streamer.c: Likewise.
	* tree-streamer.h: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-generic.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-vectorizer.c: Likewise.
	* tree-vectorizer.h: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.
	* tree.h: Likewise.
	* value-prof.c: Likewise.
	* value-prof.h: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.
	* varpool.c: Likewise.
	* vmsdbgout.c: Likewise.
	* config/bfin/bfin.c: Likewise.
	* config/c6x/c6x.c: Likewise.
	* config/darwin.c: Likewise.
	* config/i386/i386.c: Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/mep/mep.c: Likewise.
	* config/mips/mips.c: Likewise.
	* config/pa/pa.c: Likewise.
	* config/rs6000/rs6000-c.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/rx/rx.c: Likewise.
	* config/spu/spu-c.c: Likewise.
	* config/vms/vms.c: Likewise.
	* config/vxworks.c: Likewise.
	* config/epiphany/resolve-sw-modes.c: Likewise.

From-SVN: r193595
2012-11-17 21:54:30 -05:00
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
Bill Schmidt 69e1a1a34f re PR tree-optimization/55008 (Internal compiler error : verify_ssa failed)
gcc:

2012-10-22  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/55008
	* gimple-ssa-strength-reduction.c (find_basis_for_candidate): Don't
	allow a candidate to be a basis for itself under another interpretation.

gcc/testsuite:

2012-10-22  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/55008
	* gcc.dg/tree-ssa/pr55008.c: New test.

From-SVN: r192696
2012-10-22 22:09:22 +00:00
Bill Schmidt 502514254f re PR tree-optimization/54674 (ICE in build2_stat, at tree.c:3835)
2012-09-26  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/54674
	* gimple-ssa-strength-reduction.c (analyze_increments): Don't
	introduce a multiplication with a pointer operand.

From-SVN: r191765
2012-09-26 16:49:32 +00:00
Bill Schmidt ccdbfe9398 re PR middle-end/55492 (__atomic_load doesn't match ACQUIRE memory model)
2012-09-11  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/55492
	* doc/invoke.texi (max-slsr-cand-scan): New description.
	* gimple-ssa-strength-reduction.c (find_basis_for_candidate): Limit
	the time spent searching for a basis.
	* params.def (PARAM_MAX_SLSR_CANDIDATE_SCAN): New param.

From-SVN: r191178
2012-09-11 12:23:25 +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
Bill Schmidt 6b5eea611c re PR tree-optimization/54245 (incorrect optimisation)
gcc:

2012-08-15  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/54245
	* gimple-ssa-strength-reduction.c (legal_cast_p_1): New function.
	(legal_cast_p): Split out logic to legal_cast_p_1.
	(analyze_increments): Avoid introducing multiplies in smaller types.


gcc/testsuite:

2012-08-15  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/54245
	* gcc.dg/tree-ssa/pr54245.c: New test.

From-SVN: r190412
2012-08-15 13:27:29 +00:00
Bill Schmidt 99cababb4b re PR middle-end/54211 (ICE: verify_gimple failed building freetype with -Os)
gcc:

2012-08-10  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR middle-end/54211
	* gimple-ssa-strength-reduction.c (analyze_candidates_and_replace):
	Use cand_type to determine whether pointer arithmetic will be generated.

gcc/testsuite:

2012-08-10  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR middle-end/54211
	* gcc.dg/tree-ssa/pr54211.c: New test.

From-SVN: r190294
2012-08-10 12:16:04 +00:00
Bill Schmidt 88ca9ea18f gimple-ssa-strength-reduction.c (struct incr_info_d): New struct.
gcc:

2012-08-07  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gimple-ssa-strength-reduction.c (struct incr_info_d): New struct.
	(incr_vec): New static var.
	(incr_vec_len): Likewise.
	(address_arithmetic_p): Likewise.
	(stmt_cost): Remove dead assignment.
	(dump_incr_vec): New function.
	(cand_abs_increment): Likewise.
	(lazy_create_slsr_reg): Likewise.
	(incr_vec_index): Likewise.
	(count_candidates): Likewise.
	(record_increment): Likewise.
	(record_increments): Likewise.
	(unreplaced_cand_in_tree): Likewise.
	(optimize_cands_for_speed_p): Likewise.
	(lowest_cost_path): Likewise.
	(total_savings): Likewise.
	(analyze_increments): Likewise.
	(ncd_for_two_cands): Likewise.
	(nearest_common_dominator_for_cands): Likewise.
	(profitable_increment_p): Likewise.
	(insert_initializers): Likewise.
	(introduce_cast_before_cand): Likewise.
	(replace_rhs_if_not_dup): Likewise.
	(replace_one_candidate): Likewise.
	(replace_profitable_candidates): Likewise.
	(analyze_candidates_and_replace): Handle candidates with SSA-name
	strides.

gcc/testsuite:

2012-08-07  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.dg/tree-ssa/slsr-5.c: New.
	* gcc.dg/tree-ssa/slsr-6.c: New.
	* gcc.dg/tree-ssa/slsr-7.c: New.
	* gcc.dg/tree-ssa/slsr-8.c: New.
	* gcc.dg/tree-ssa/slsr-9.c: New.
	* gcc.dg/tree-ssa/slsr-10.c: New.
	* gcc.dg/tree-ssa/slsr-11.c: New.
	* gcc.dg/tree-ssa/slsr-12.c: New.
	* gcc.dg/tree-ssa/slsr-13.c: New.
	* gcc.dg/tree-ssa/slsr-14.c: New.
	* gcc.dg/tree-ssa/slsr-15.c: New.
	* gcc.dg/tree-ssa/slsr-16.c: New.
	* gcc.dg/tree-ssa/slsr-17.c: New.
	* gcc.dg/tree-ssa/slsr-18.c: New.
	* gcc.dg/tree-ssa/slsr-19.c: New.
	* gcc.dg/tree-ssa/slsr-20.c: New.
	* gcc.dg/tree-ssa/slsr-21.c: New.
	* gcc.dg/tree-ssa/slsr-22.c: New.
	* gcc.dg/tree-ssa/slsr-23.c: New.
	* gcc.dg/tree-ssa/slsr-24.c: New.
	* gcc.dg/tree-ssa/slsr-25.c: New.
	* gcc.dg/tree-ssa/slsr-26.c: New.
	* gcc.dg/tree-ssa/slsr-30.c: New.
	* gcc.dg/tree-ssa/slsr-31.c: New.

From-SVN: r190220
2012-08-08 01:35:22 +00:00
Richard Guenther b2ec94d440 tree-vect-loop-manip.c (vect_can_advance_ivs_p): Query is_gimple_reg on the SSA name, not its variable.
2012-08-03  Richard Guenther  <rguenther@suse.de>

	* tree-vect-loop-manip.c (vect_can_advance_ivs_p): Query
	is_gimple_reg on the SSA name, not its variable.
	(vect_update_ivs_after_vectorizer): Likewise.
	* tree-ssa-copyrename.c (rename_ssa_copies): Likewise.
	* tree-if-conv.c (if_convertible_phi_p): Likewise.
	(predicate_scalar_phi): Likewise.
	* tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
	(vect_analyze_scalar_cycles_1): Likewise.
	* tree-ssa-live.c (register_ssa_partition_check): Likewise.
	* tree-outof-ssa.c (eliminate_useless_phis): Likewise.
	* tree-ssa-reassoc.c (phi_rank): Likewise.
	* tree-parloops.c (separate_decls_in_region_name): Use
	replace_ssa_name_symbol.
	* tree-predcom.c (base_names_in_chain_on): Likewise.
	* matrix-reorg.c (update_type_size): Query the type of the SSA name,
	not its variable.
	* gimple-ssa-strength-reduction.c (create_mul_ssa_cand): Likewise.
	(create_mul_imm_cand): Likewise.
	(create_add_ssa_cand): Likewise.
	(create_add_imm_cand): Likewise.
	(slsr_process_add): Likewise.
	* tree-inline.c (remap_ssa_name): Do not set the type of the
	new SSA_NAME.
	* tree-ssa-structalias.c (get_constraint_for_ssa_var): Clarify
	assert.  Check for default def first.

From-SVN: r190116
2012-08-03 08:55:43 +00:00
Bill Schmidt 3cfd446903 gimple-ssa-strength-reduction.c (struct slsr_cand_d): Change base_name to base_expr.
2012-08-01  Bill Schmidt  <wschmidt@linux.ibm.com>

	* gimple-ssa-strength-reduction.c (struct slsr_cand_d): Change
	base_name to base_expr.
	(struct cand_chain_d): Likewise.
	(base_cand_hash): Likewise.
	(base_cand_eq): Likewise.
	(record_potential_basis): Likewise.
	(alloc_cand_and_find_basis): Likewise.
	(create_mul_ssa_cand): Likewise.
	(create_mul_imm_cand): Likewise.
	(create_add_ssa_cand): Likewise.
	(create_add_imm_cand): Likewise.
	(slsr_process_cast): Likewise.
	(slsr_process_copy): Likewise.
	(dump_candidate): Likewise.
	(base_cand_dump_callback): Likewise.
	(unconditional_cands_with_known_stride_p): Likewise.
	(cand_increment): Likewise.

From-SVN: r190038
2012-08-01 14:00:35 +00:00
Bill Schmidt 2749c8f6b3 re PR tree-optimization/46556 (Code size regression in struct access)
gcc:

	PR tree-optimization/46556
	* gimple-ssa-strength-reduction.c (enum cand_kind): Add CAND_REF.
	(base_cand_map): Change to hash table.
	(base_cand_hash): New function.
	(base_cand_free): Likewise.
	(base_cand_eq): Likewise.
	(lookup_cand): Change base_cand_map to hash table.
	(find_basis_for_candidate): Likewise.
	(base_cand_from_table): Exclude CAND_REF.
	(restructure_reference): New function.
	(slsr_process_ref): Likewise.
	(find_candidates_in_block): Call slsr_process_ref.
	(dump_candidate): Handle CAND_REF.
	(base_cand_dump_callback): New function.
	(dump_cand_chains): Change base_cand_map to hash table.
	(replace_ref): New function.
	(replace_refs): Likewise.
	(analyze_candidates_and_replace): Call replace_refs.
	(execute_strength_reduction): Change base_cand_map to hash table.

gcc/testsuite:

	PR tree-optimization/46556
	* testsuite/gcc.dg/tree-ssa/slsr-27.c: New.
	* testsuite/gcc.dg/tree-ssa/slsr-28.c: New.
	* testsuite/gcc.dg/tree-ssa/slsr-29.c: New.

From-SVN: r190037
2012-08-01 13:02:38 +00:00
Nathan Froyd 5322d07e9c expmed.h (alg_hash, [...]): Delete macro definitions and re-purpose as inline functions.
* expmed.h (alg_hash, alg_hash_used_p, sdiv_pow2_cheap,
	smod_pow2_cheap, zero_cost, add_cost, neg_cost, shift_cost)
	shiftadd_cost, shiftsub0_cost, shiftsub1_cost, mul_cost,
	sdiv_cost, udiv_cost, mul_widen_cost, mul_highpart_cost): Delete
	macro definitions and re-purpose as inline functions.
	(alg_hash_entry_ptr, set_alg_hash_used_p, sdiv_pow2_cheap_ptr,
	set_sdiv_pow2_cheap, smod_pow2_cheap_ptr, set_smod_pow2_cheap,
	zero_cost_ptr, set_zero_cost, add_cost_ptr, set_add_cost,
	neg_cost_ptr, set_neg_cost, shift_cost_ptr, set_shift_cost,
	shiftadd_cost_ptr, set_shiftadd_cost, shiftsub0_cost_ptr,
	set_shiftsub0_cost, shiftsub1_cost_ptr, set_shiftsub1_cost,
	mul_cost_ptr, set_mul_cost, sdiv_cost_ptr, set_sdiv_cost,
	udiv_cost_ptr, set_udiv_cost, mul_widen_cost_ptr,
	set_mul_widen_cost, mul_highpart_cost_ptr, set_mul_highpart_cost):
	New functions.
	(convert_cost_ptr): New function, split out from...
	(set_convert_cost, convert_cost): ...here.
	* expmed.c, tree-ssa-loop-ivopts.c: Update for new functions.
	* gimple-ssa-strength-reduction.c: Likewise.

From-SVN: r189919
2012-07-27 21:01:16 +00:00
Bill Schmidt 6dd8f4bb61 tree-ssa-loop-ivopts.c (mbc_entry_hash): Remove.
2012-07-26  Bill Schmidt  <wschmidt@linux.ibm.com>

	* tree-ssa-loop-ivopts.c (mbc_entry_hash): Remove.
	(mbc_entry_eq): Likewise.
	(mult_costs): Likewise.
	(cost_tables_exist): Likewise.
	(initialize_costs): Likewise.
	(finalize_costs): Likewise.
	(tree_ssa_iv_optimize_init): Remove call to initialize_costs.
	(add_regs_cost): Remove.
	(multiply_regs_cost): Likewise.
	(add_const_cost): Likewise.
	(extend_or_trunc_reg_cost): Likewise.
	(negate_reg_cost): Likewise.
	(struct mbc_entry): Likewise.
	(multiply_by_const_cost): Likewise.
	(get_address_cost): Change add_regs_cost calls to add_cost lookups;
	change multiply_by_const_cost to mult_by_coeff_cost.
	(force_expr_to_var_cost): Likewise.
	(difference_cost): Change multiply_by_const_cost to mult_by_coeff_cost.
	(get_computation_cost_at): Change add_regs_cost calls to add_cost
	lookups; change multiply_by_const_cost to mult_by_coeff_cost.
	(determine_iv_cost): Change add_regs_cost calls to add_cost lookups.
	(tree_ssa_iv_optimize_finalize): Remove call to finalize_costs.
	* tree-ssa-address.c (expmed.h): New #include.
	(most_expensive_mult_to_index): Change multiply_by_const_cost to
	mult_by_coeff_cost.
	* gimple-ssa-strength-reduction.c (expmed.h): New #include.
	(stmt_cost): Change to use mult_by_coeff_cost, mul_cost, add_cost,
	neg_cost, and convert_cost instead of IVOPTS interfaces.
	(execute_strength_reduction): Remove calls to initialize_costs and
	finalize_costs.
	* expmed.c (struct init_expmed_rtl): Add convert rtx_def.
	(init_expmed_one_mode): Initialize convert rtx_def; initialize
	x_convert_cost for related modes.
	(mult_by_coeff_cost): New function.
	* expmed.h (NUM_MODE_INT): New #define.
	(struct target_expmed): Add x_convert_cost matrix.
	(set_convert_cost): New inline function.
	(convert_cost): Likewise.
	(mult_by_coeff_cost): New extern decl.
	* tree-flow.h (initialize_costs): Remove decl.
	(finalize_costs): Likewise.
	(multiply_by_const_cost): Likewise.
	(add_regs_cost): Likewise.
	(multiply_regs_cost): Likewise.
	(add_const_cost): Likewise.
	(extend_or_trunc_reg_cost): Likewise.
	(negate_reg_cost): Likewise.
	* Makefile.in (gimple-ssa-strength-reduction.o): Update dependencies.
	(tree-ssa-address.o): Update dependencies.

From-SVN: r189890
2012-07-26 13:10:04 +00:00
Bill Schmidt 75cfe445d9 invoke.texi: Add -fhoist-adjacent-loads and -ftree-slsr to list of flags controlling...
2012-07-18  Bill Schmidt  <wschmidt@linux.ibm.com>

	* doc/invoke.texi: Add -fhoist-adjacent-loads and -ftree-slsr to list
	of flags controlling optimization; add -ftree-slsr to list of flags
	enabled by default at -O; add -fhoist-adjacent-loads to list of flags
	enabled by default at -O2; add -fvect-cost-model to list of flags
	enabled by default at -O3; document -fhoist-adjacent-loads and
	-ftree-slsr.
	* opts.c (default_option): Make -ftree-slsr default at -O1 and above.
	* gimple-ssa-strength-reduction.c (gate_strength_reduction): Use
	flag_tree_slsr.
	* common.opt: Add -ftree-slsr with flag_tree_slsr.

From-SVN: r189617
2012-07-18 15:15:36 +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
Bill Schmidt f9453c07d6 tree-pass.h (pass_strength_reduction): New decl.
gcc:

2012-06-26  Bill Schmidt  <wschmidt@linux.ibm.com>

	* tree-pass.h (pass_strength_reduction): New decl.
	* tree-ssa-loop-ivopts.c (initialize_costs): Make non-static.
	(finalize_costs): Likewise.
	* timevar.def (TV_TREE_SLSR): New timevar.
	* gimple-ssa-strength-reduction.c: New.
	* tree-flow.h (initialize_costs): New decl.
	(finalize_costs): Likewise.
	* Makefile.in (tree-ssa-strength-reduction.o): New dependencies.
	* passes.c (init_optimization_passes): Add pass_strength_reduction.

gcc/testsuite:

2012-06-26  Bill Schmidt  <wschmidt@linux.ibm.com>

	* gcc.dg/tree-ssa/slsr-1.c: New test.
	* gcc.dg/tree-ssa/slsr-2.c: Likewise.
	* gcc.dg/tree-ssa/slsr-3.c: Likewise.
	* gcc.dg/tree-ssa/slsr-4.c: Likewise.

From-SVN: r188989
2012-06-26 16:27:50 +00:00