Commit Graph

370 Commits

Author SHA1 Message Date
Richard Biener 4d69799530 backport: re PR ipa/81112 (internal compiler error: tree check: expected integer_cst, have range_expr in get_len, at tree.h:5321)
2017-06-29  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2017-06-19  Richard Biener  <rguenther@suse.de>

	PR ipa/81112
	* ipa-prop.c (find_constructor_constant_at_offset): Handle
	RANGE_EXPR conservatively.

	* g++.dg/torture/pr81112.C: New testcase.

From-SVN: r249772
2017-06-29 08:53:27 +00:00
Richard Biener 26d7dc48b6 re PR ipa/79970 (ICE in add_stack_var, at cfgexpand.c:450 with always_inline attribute)
2017-03-09  Richard Biener  <rguenther@suse.de>

	PR ipa/79970
	* ipa-prop.c (ipa_modify_formal_parameters): Avoid changing
	alignment of BLKmode params.

	* gcc.dg/torture/pr79970.c: New testcase.

From-SVN: r246001
2017-03-09 13:20:03 +00:00
Martin Jambor 86cd0334f3 [PR 78140] Reuse same IPA bits and VR info
2017-03-01  Martin Jambor  <mjambor@suse.cz>

	PR lto/78140
	* ipa-prop.h (ipa_bits): Removed field known.
	(ipa_jump_func): Removed field vr_known.  Changed fields bits and m_vr
	to pointers.  Adjusted their comments to warn about their sharing.
	(ipcp_transformation_summary): Change bits to a vector of pointers.
	(ipa_check_create_edge_args): Moved to ipa-prop.c, declare.
	(ipa_get_ipa_bits_for_value): Declare.
	* tree-vrp.h (value_range): Mark as GTY((for_user)).
	* ipa-prop.c (ipa_bit_ggc_hash_traits): New.
	(ipa_bits_hash_table): Likewise.
	(ipa_vr_ggc_hash_traits): Likewise.
	(ipa_vr_hash_table): Likewise.
	(ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr
	being pointers and vr_known being removed.
	(ipa_set_jf_unknown): Likewise.
	(ipa_get_ipa_bits_for_value): New function.
	(ipa_set_jfunc_bits): Likewise.
	(ipa_get_value_range): New overloaded functions.
	(ipa_set_jfunc_vr): Likewise.
	(ipa_compute_jump_functions_for_edge): Use the above functions to
	construct bits and vr parts of jump functions.
	(ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate
	ipa_bits_hash_table and ipa_vr_hash_table if they do not already
	exist.
	(ipcp_grow_transformations_if_necessary): Also allocate
	ipa_bits_hash_table and ipa_vr_hash_table if they do not already
	exist.
	(ipa_node_params_t::duplicate): Do not copy bits, just pointers to
	them.  Fix too long lines.
	(ipa_write_jump_function): Adjust for bits and m_vr being pointers and
	vr_known being removed.
	(ipa_read_jump_function): Use new setter functions to construct bits
	and vr parts of jump functions or set them to NULL.
	(write_ipcp_transformation_info): Adjust for bits being pointers.
	(read_ipcp_transformation_info): Likewise.
	(ipcp_update_bits): Likewise.  Fix excessively long lines a trailing
	space.
	Include gt-ipa-prop.h.
	* ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits
	being pointers.
	(ipcp_store_bits_results): Likewise.
	(propagate_vr_across_jump_function): Adjust for m_vr being a pointer.
	Do not write to existing jump functions but use a temporary instead.

From-SVN: r245805
2017-03-01 10:37:27 +01:00
Martin Jambor 03108bad95 [PR 79579] Avoid segfault on NULL ipa_edge_args_vector
2017-02-21  Martin Jambor  <mjambor@suse.cz>

	PR lto/79579
	* ipa-prop.c (ipa_prop_write_jump_functions): Bail out if no edges
	have been analyzed.

From-SVN: r245628
2017-02-21 15:01:52 +01:00
Martin Jambor 159f01f8a9 [PR 79375] Avoid passing NULL by reference
2017-02-08  Martin Jambor  <mjambor@suse.cz>

	PR ipa/79375
	* ipa-prop.c (ipa_alloc_node_params): Make static, return bool
	whether allocation happened.
	(ipa_initialize_node_params): Do not call ipa_alloc_node_params if
	nothing was allocated.

From-SVN: r245275
2017-02-08 10:47:09 +01:00
Martin Liska e806796de0 Fix memory leaks in IPA CP (PR ipa/79337).
2017-02-03  Martin Liska  <mliska@suse.cz>

	PR ipa/79337
	* ipa-prop.c (ipa_node_params_t::insert): Remove current
	implementation.
	(ipa_node_params_t::remove): Likewise.
	* ipa-prop.h (ipa_node_params::ipa_node_params): Make default
	initialization from removed ipa_node_params_t::insert.
	(ipa_node_params::~ipa_node_params): Move from removed
	ipa_node_params_t::release.
	* symbol-summary.h (symbol_summary::m_released): New member.
	Do not release a summary twice.  Do not allow to call finalizer
	for types of a summary that live in GGC memory.

From-SVN: r245145
2017-02-03 08:20:02 +00:00
Martin Liska a0a348b167 Call symbol_summary<>::release instead of ~symbol_summary (PR ipa/79285).
2017-01-31  Martin Liska  <mliska@suse.cz>

	PR ipa/79285
	* ipa-prop.c (ipa_free_all_node_params): Call release method
	instead of ~sumbol_summary to not to trigger double times
	dtor of hash_map.

From-SVN: r245058
2017-01-31 10:54:41 +00:00
Martin Jambor cf157d80bc [PR 79198] Call ipa-prop func summary destructor
2017-01-24  Martin Jambor  <mjambor@suse.cz>

	PR bootstrap/79198
	* ipa-prop.c (ipa_free_all_node_params): Call summary destructor.
	* ipa-prop.c (ipa_node_params_t::insert): Initialize fields known_csts
	and known_contexts.

From-SVN: r244860
2017-01-24 11:04:21 +01:00
Martin Jambor bda2bc48c2 Fix compute_complex_assign_jump_func
2017-01-23  Martin Jambor  <mjambor@suse.cz>

	* ipa-prop.c (load_from_param_1): Removed.
	(load_from_unmodified_param): Bits from load_from_param_1 put back
	here.
	(load_from_param): Removed.
	(compute_complex_assign_jump_func): Removed stmt2 and just replaced it
	with stmt.  Reverted back to use of load_from_unmodified_param.

testsuite/
	* gcc.dg/ipa/vrp8.c: New test.

From-SVN: r244803
2017-01-23 14:05:00 +01:00
Martin Jambor f65f1ae3b9 [PR 79108] Put ipa_node_params to GC memory
2017-01-23  Martin Jambor  <mjambor@suse.cz>

	PR ipa/79108
	* ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()).
	(ipa_node_params): Annotate with GTY((for_user)).  Make descriptors
	field a pointer to garbage collected vector, mark lattices and
	ipcp_orig_node with GTY((skip)).
	(ipa_get_param_count): Adjust to descriptors being a pointer.
	(ipa_get_param): Likewise.
	(ipa_get_type): Likewise.
	(ipa_get_param_move_cost): Likewise.
	(ipa_set_param_used): Likewise.
	(ipa_get_controlled_uses): Likewise.
	(ipa_set_controlled_uses): Likewise.
	(ipa_is_param_used): Likewise.
	(ipa_node_params_t): Move into garbage collector.  New methods insert
	and remove.
	(ipa_node_params_sum): Annotate wth GTY(()).
	(ipa_check_create_node_params): Adjust to ipa_node_params_sum being
	garbage collected.
	(ipa_load_from_parm_agg): Adjust declaration.
	* ipa-icf.c (param_used_p): Adjust to descriptors being a pointer.
	* ipa-profile.c (ipa_profile): Likewise.
	* ipa-prop.c (ipa_get_param_decl_index_1): Likewise.
	(ipa_populate_param_decls): Make descriptors parameter garbage
	collected.
	(ipa_dump_param): Adjust to descriptors being a pointer.
	(ipa_alloc_node_params): Likewise.
	(ipa_initialize_node_params): Likewise.
	(load_from_param_1): Make descriptors parameter garbage collected.
	(load_from_unmodified_param): Likewise.
	(load_from_param): Likewise.
	(ipa_load_from_parm_agg): Likewise.
	(ipa_node_params::~ipa_node_params): Removed.
	(ipa_free_all_node_params): Remove call to delete operator.
	(ipa_node_params_t::insert): New.
	(ipa_node_params_t::remove): Likewise.
	(ipa_node_params_t::duplicate): Adjust to descriptors being a pointer,
	copy known_csts and known_contexts vectors.
	(ipa_read_node_info): Adjust to descriptors being a pointer.
	(ipcp_modif_dom_walker): Make m_descriptors field garbage
	collected.
	(ipcp_transform_function): Make descriptors variable garbage
	collected.

testsuite/
	* gfortran.dg/lto/pr79108_0.f90: New test.

From-SVN: r244802
2017-01-23 14:01:31 +01:00
Martin Jambor a5e14a42da [PR 78365] Prudent type handling in IPA VR-prop
2017-01-09  Martin Jambor  <mjambor@suse.cz>

	PR ipa/78365
	PR ipa/78599
	* ipa-prop.h (ipa_jump_func): Swap positions of vr_known and m_vr.
	* ipa-cp.c (ipa_vr_operation_and_type_effects): New function.
	(propagate_vr_accross_jump_function): Use the above function for all
	value range computations for pass-through jump functions and type
	converasion from explicit value range values.
        (ipcp_propagate_stage): Do not attempt to deduce types of formal
        parameters from TYPE_ARG_TYPES.
	* ipa-prop.c (ipa_write_jump_function): Remove trailing whitespace.
	(ipa_write_node_info): Stream type of the actual argument.
	(ipa_read_node_info): Likewise. Also remove trailing whitespace.

testsuite/
	* gcc.dg/torture/pr78365.c: New test.

From-SVN: r244232
2017-01-09 19:26:37 +01:00
Jakub Jelinek cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00
Richard Biener a77af1829f re PR ipa/78515 (ICE: in fold_binary_loc, at fold-const.c:8999 with -Os -mavx512bw)
2016-11-25  Richard Biener  <rguenther@suse.de>

	PR ipa/78515
	* ipa-prop.c (compute_complex_assign_jump_func): Properly identify
	unary, binary and single RHSs.
	* tree.def (BIT_INSERT_EXPR): Adjust tree code name.

	* gcc.dg/torture/pr78515.c: New testcase.

From-SVN: r242876
2016-11-25 14:05:04 +00:00
Richard Sandiford 899ca90e6d Add SET_DECL_MODE
This may no longer be necessary with the current version
of the SVE patches, but it does at least make things consistent
with the TYPE_MODE/SET_TYPE_MODE split.

gcc/ada/
2016-11-16  Richard Sandiford  <richard.sandiford@arm.com>
 	    Alan Hayward  <alan.hayward@arm.com>
 	    David Sherwood  <david.sherwood@arm.com>

	* gcc-interface/utils.c (create_label_decl): Use SET_DECL_MODE.

gcc/c/
2016-11-16  Richard Sandiford  <richard.sandiford@arm.com>
 	    Alan Hayward  <alan.hayward@arm.com>
 	    David Sherwood  <david.sherwood@arm.com>

	* c-decl.c (merge_decls): Use SET_DECL_MODE.
	(make_label, finish_struct): Likewise.

gcc/cp/
2016-11-16  Richard Sandiford  <richard.sandiford@arm.com>
 	    Alan Hayward  <alan.hayward@arm.com>
 	    David Sherwood  <david.sherwood@arm.com>

	* class.c (finish_struct_bits): Use SET_DECL_MODE.
	(build_base_field_1, layout_class_type, finish_struct_1): Likewise.
	* decl.c (make_label_decl): Likewise.
	* pt.c (tsubst_decl): Likewise.

gcc/fortran/
2016-11-16  Richard Sandiford  <richard.sandiford@arm.com>
 	    Alan Hayward  <alan.hayward@arm.com>
 	    David Sherwood  <david.sherwood@arm.com>

	* trans-common.c (build_common_decl): Use SET_DECL_MODE.
	* trans-decl.c (gfc_build_label_decl): Likewise.
	* trans-types.c (gfc_get_array_descr_info): Likewise.

gcc/lto/
2016-11-16  Richard Sandiford  <richard.sandiford@arm.com>
 	    Alan Hayward  <alan.hayward@arm.com>
 	    David Sherwood  <david.sherwood@arm.com>

	* lto.c (offload_handle_link_vars): Use SET_DECL_MODE.

gcc/
2016-11-16  Richard Sandiford  <richard.sandiford@arm.com>
 	    Alan Hayward  <alan.hayward@arm.com>
 	    David Sherwood  <david.sherwood@arm.com>

	* tree.h (SET_DECL_MODE): New macro.
	* cfgexpand.c (avoid_deep_ter_for_debug): Use SET_DECL_MODE.
	(expand_gimple_basic_block): Likewise.
	* function.c (split_complex_args): Likeise.
	* ipa-prop.c (ipa_modify_call_arguments): Likewise.
	* omp-simd-clone.c (ipa_simd_modify_stmt_ops): Likewise.
	* stor-layout.c (layout_decl, relayout_decl): Likewise.
	(finish_bitfield_representative): Likewise.
	* tree.c (make_node_stat): Likewise.
	* tree-inline.c (remap_ssa_name): Likewise.
	(tree_function_versioning): Likewise.
	* tree-into-ssa.c (rewrite_debug_stmt_uses): Likewise.
	* tree-sra.c (sra_ipa_reset_debug_stmts): Likewise.
	* tree-ssa-ccp.c (optimize_atomic_bit_test_and): Likewise.
	* tree-ssa-loop-ivopts.c (remove_unused_ivs): Likewise.
	* tree-ssa.c (insert_debug_temp_for_var_def): Likewise.
	* tree-streamer-in.c (unpack_ts_decl_common_value_fields): Likewise.
	* varasm.c (make_debug_expr_from_rtl): Likewise.

libcc1/
2016-11-16  Richard Sandiford  <richard.sandiford@arm.com>
 	    Alan Hayward  <alan.hayward@arm.com>
 	    David Sherwood  <david.sherwood@arm.com>

	* plugin.cc (plugin_build_add_field): Use SET_DECL_MODE.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>

From-SVN: r242585
2016-11-18 10:03:12 +00:00
Kugan Vivekanandarajah a2b4c18823 pr78268.C: New test.
gcc/testsuite/ChangeLog:

2016-11-13  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* g++.dg/torture/pr78268.C: New test.

gcc/ChangeLog:

2016-11-13  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* ipa-cp.c (ipa_get_jf_pass_through_result): Skip unary expressions.
	(propagate_vr_accross_jump_function): Handle unary expressions.
	* ipa-prop.c (ipa_set_jf_unary_pass_through): New.
	(load_from_param_1): New.
	(load_from_unmodified_param): Factor common part into load_from_param_1.
	(load_from_param): New.
	(compute_complex_assign_jump_func): Handle unary expressions.
	(update_jump_functions_after_inlining): Likewise.
	(ipa_write_jump_function): Likewise.
	(ipa_read_jump_function): Likewise.

From-SVN: r242368
2016-11-13 22:04:36 +00:00
Kugan Vivekanandarajah e32d2c92d9 revert: ipa-cp.c (ipa_get_jf_pass_through_result): Handle unary expressions.
2016-11-10  Kugan Vivekanandarajah  <kuganv@linaro.org>

	Revert
	2016-11-09  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* ipa-cp.c (ipa_get_jf_pass_through_result): Handle unary expressions.
	(propagate_vr_accross_jump_function): Likewise.
	* ipa-prop.c (ipa_set_jf_unary_pass_through): New.
	(load_from_param_1): New.
	(load_from_unmodified_param): Factor common part into load_from_param_1.
	(load_from_param): New.
	(compute_complex_assign_jump_func): Handle unary expressions.
	(ipa_write_jump_function): Likewise.
	(ipa_read_jump_function): Likewise.

From-SVN: r242032
2016-11-10 07:13:39 +00:00
Kugan Vivekanandarajah d6e8a41c87 Handle unary pass-through jump functions for ipa-vrp
Handle unary pass-through jump functions for ipa-vrp
gcc/testsuite/ChangeLog:

2016-11-09  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* gcc.dg/ipa/vrp7.c: New test.


gcc/ChangeLog:

2016-11-09  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* ipa-cp.c (ipa_get_jf_pass_through_result): Handle unary expressions.
	(propagate_vr_accross_jump_function): Likewise.
	* ipa-prop.c (ipa_set_jf_unary_pass_through): New.
	(load_from_param_1): New.
	(load_from_unmodified_param): Factor common part into load_from_param_1.
	(load_from_param): New.
	(compute_complex_assign_jump_func): Handle unary expressions.
	(ipa_write_jump_function): Likewise.
	(ipa_read_jump_function): Likewise.

From-SVN: r241990
2016-11-09 01:44:04 +00:00
Kugan Vivekanandarajah 5d5f1e95b1 Fix ice in set_value_range
Fix ice in set_value_range
gcc/ChangeLog:

2016-11-09  Kugan Vivekanandarajah  <kuganv@linaro.org>

	PR ipa/78121
	* ipa-cp.c (propagate_vr_accross_jump_function): Pass param type.
	Also fold constant passed as argument while computing value range.
	(propagate_constants_accross_call): Pass param type.
	* ipa-prop.c: export ipa_get_callee_param_type.
	* ipa-prop.h: export ipa_get_callee_param_type.

gcc/testsuite/ChangeLog:

2016-11-09  Kugan Vivekanandarajah  <kuganv@linaro.org>

	PR ipa/78121
	* gcc.dg/ipa/pr78121.c: New test.

From-SVN: r241989
2016-11-09 01:41:26 +00:00
Kugan Vivekanandarajah f75036994f ADDR_EXPR and nonnull
ADDR_EXPR and nonnull
gcc/ChangeLog:

2016-10-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* ipa-prop.c (ipa_compute_jump_functions_for_edge): Create nonzero
	value range for pointers in more cases.

gcc/testsuite/ChangeLog:

2016-10-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* gcc.dg/ipa/vrp5.c: New test.
	* gcc.dg/ipa/vrp6.c: New test.

From-SVN: r241428
2016-10-21 20:13:55 +00:00
Kugan Vivekanandarajah 718625ad3a Use get/set_ptr_nonnull in ipa-vrp
Use get/set_ptr_nonnull in ipa-vrp
gcc/ChangeLog:

2016-10-18  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* ipa-prop.c (ipa_compute_jump_functions_for_edge): Set value range
	for pointer type too.
	(ipcp_update_vr): set_ptr_nonnull for pointer.

gcc/testsuite/ChangeLog:

2016-10-18  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* gcc.dg/ipa/vrp4.c: New test.

From-SVN: r241288
2016-10-17 23:37:57 +00:00
Prathamesh Kulkarni 676b4899d6 ipa-prop.c (ipcp_transform_function): Set fields m_vr and bits to NULL of (*ipcp_transformations)][node->uid].
2016-10-09  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	* ipa-prop.c (ipcp_transform_function): Set fields m_vr and bits to NULL of
	(*ipcp_transformations)][node->uid].

From-SVN: r240903
2016-10-09 18:40:09 +00:00
Jakub Jelinek 8813a647b5 tree-ssa.c (target_for_debug_bind, [...]): Use VAR_P and/or VAR_OR_FUNCTION_DECL_P macros.
* tree-ssa.c (target_for_debug_bind, verify_phi_args,
	ssa_undefined_value_p, maybe_optimize_var): Use VAR_P and/or
	VAR_OR_FUNCTION_DECL_P macros.
	* tree-chkp.c (chkp_register_var_initializer, chkp_make_static_bounds,
	chkp_get_bounds_for_decl_addr, chkp_parse_array_and_component_ref,
	chkp_find_bounds_1): Likewise.
	* ipa-polymorphic-call.c (decl_maybe_in_construction_p): Likewise.
	* hsa-gen.c (get_symbol_for_decl): Likewise.
	* cgraphunit.c (check_global_declaration, analyze_functions,
	handle_alias_pairs, thunk_adjust, cgraph_node::expand_thunk):
	Likewise.
	* gimple-fold.c (can_refer_decl_in_current_unit_p,
	canonicalize_constructor_val, gimple_get_virt_method_for_vtable):
	Likewise.
	* tree.c (set_decl_section_name, copy_node_stat,
	need_assembler_name_p, free_lang_data_in_decl, find_decls_types_r,
	merge_dllimport_decl_attributes, handle_dll_attribute,
	decl_init_priority_insert, auto_var_in_fn_p, array_at_struct_end_p,
	verify_type): Likewise.
	* gimple-ssa-isolate-paths.c (find_implicit_erroneous_behavior,
	find_explicit_erroneous_behavior): Likewise.
	* sdbout.c (sdbout_toplevel_data, sdbout_late_global_decl): Likewise.
	* ipa.c (process_references): Likewise.
	* tree-chkp-opt.c (chkp_get_check_result): Likewise.
	* varasm.c (get_block_for_decl, use_blocks_for_decl_p, make_decl_rtl,
	notice_global_symbol, assemble_variable, mark_decl_referenced,
	build_constant_desc, output_constant_def_contents, do_assemble_alias,
	make_decl_one_only, default_section_type_flags,
	categorize_decl_for_section, default_encode_section_info): Likewise.
	* trans-mem.c (requires_barrier): Likewise.
	* gimple-expr.c (mark_addressable): Likewise.
	* cfgexpand.c (add_scope_conflicts_1, expand_one_var,
	expand_used_vars_for_block, clear_tree_used, stack_protect_decl_p,
	expand_debug_expr): Likewise.
	* tree-dump.c (dequeue_and_dump): Likewise.
	* ubsan.c (instrument_bool_enum_load): Likewise.
	* tree-pretty-print.c (print_declaration): Likewise.
	* simplify-rtx.c (delegitimize_mem_from_attrs): Likewise.
	* tree-ssa-uninit.c (warn_uninitialized_vars): Likewise.
	* asan.c (asan_protect_global, instrument_derefs): Likewise.
	* tree-into-ssa.c (rewrite_stmt, maybe_register_def,
	pass_build_ssa::execute): Likewise.
	* var-tracking.c (var_debug_decl, track_expr_p): Likewise.
	* tree-ssa-loop-ivopts.c (force_expr_to_var_cost, split_address_cost):
	Likewise.
	* ipa-split.c (test_nonssa_use, consider_split, mark_nonssa_use):
	Likewise.
	* tree-inline.c (insert_debug_decl_map, remap_ssa_name,
	can_be_nonlocal, remap_decls, copy_debug_stmt,
	initialize_inlined_parameters, add_local_variables,
	reset_debug_binding, replace_locals_op): Likewise.
	* dse.c (can_escape): Likewise.
	* ipa-devirt.c (compare_virtual_tables, referenced_from_vtable_p):
	Likewise.
	* tree-diagnostic.c (default_tree_printer): Likewise.
	* tree-streamer-in.c (unpack_ts_decl_common_value_fields,
	unpack_ts_decl_with_vis_value_fields,
	lto_input_ts_decl_common_tree_pointers): Likewise.
	* builtins.c (builtin_save_expr, fold_builtin_expect,
	readonly_data_expr): Likewise.
	* tree-ssa-structalias.c (new_var_info, get_constraint_for_ssa_var,
	create_variable_info_for, set_uids_in_ptset, visit_loadstore):
	Likewise.
	* gimple-streamer-out.c (output_gimple_stmt): Likewise.
	* gimplify.c (force_constant_size, gimplify_bind_expr,
	gimplify_decl_expr, gimplify_var_or_parm_decl,
	gimplify_compound_lval, gimplify_init_constructor,
	gimplify_modify_expr, gimplify_asm_expr, gimplify_oacc_declare,
	gimplify_type_sizes): Likewise.
	* cgraphbuild.c (record_reference, record_type_list, mark_address,
	mark_load, mark_store, pass_build_cgraph_edges::execute): Likewise.
	* tree-ssa-live.c (mark_all_vars_used_1, remove_unused_scope_block_p,
	remove_unused_locals): Likewise.
	* tree-ssa-alias.c (ptr_deref_may_alias_decl_p, ptrs_compare_unequal,
	ref_maybe_used_by_call_p_1, call_may_clobber_ref_p_1): Likewise.
	* function.c (instantiate_expr, instantiate_decls_1,
	setjmp_vars_warning, add_local_decl): Likewise.
	* alias.c (ao_ref_from_mem, get_alias_set, compare_base_symbol_refs):
	Likewise.
	* tree-stdarg.c (find_va_list_reference, va_list_counter_struct_op,
	va_list_ptr_read, va_list_ptr_write, check_all_va_list_escapes,
	optimize_va_list_gpr_fpr_size): Likewise.
	* tree-nrv.c (pass_nrv::execute): Likewise.
	* tsan.c (instrument_expr): Likewise.
	* tree-ssa-dce.c (remove_dead_stmt): Likewise.
	* vtable-verify.c (verify_bb_vtables): Likewise.
	* tree-dfa.c (ssa_default_def, set_ssa_default_def,
	get_ref_base_and_extent): Likewise.
	* toplev.c (wrapup_global_declaration_1, wrapup_global_declaration_2):
	Likewise.
	* tree-sra.c (static bool constant_decl_p, find_var_candidates,
	analyze_all_variable_accesses): Likewise.
	* tree-nested.c (get_nonlocal_debug_decl,
	convert_nonlocal_omp_clauses, note_nonlocal_vla_type,
	note_nonlocal_block_vlas, convert_nonlocal_reference_stmt,
	get_local_debug_decl, convert_local_omp_clauses,
	convert_local_reference_stmt, nesting_copy_decl, remap_vla_decls):
	Likewise.
	* tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Likewise.
	* stmt.c (decl_overlaps_hard_reg_set_p): Likewise.
	* dbxout.c (dbxout_late_global_decl, dbxout_type_fields,
	dbxout_symbol, dbxout_common_check): Likewise.
	* expr.c (expand_assignment, expand_expr_real_2, expand_expr_real_1,
	string_constant): Likewise.
	* hsa.c (hsa_get_declaration_name): Likewise.
	* passes.c (rest_of_decl_compilation): Likewise.
	* tree-ssanames.c (make_ssa_name_fn): Likewise.
	* tree-streamer-out.c (pack_ts_decl_common_value_fields,
	pack_ts_decl_with_vis_value_fields,
	write_ts_decl_common_tree_pointers): Likewise.
	* stor-layout.c (place_field): Likewise.
	* symtab.c (symtab_node::maybe_create_reference,
	symtab_node::verify_base, symtab_node::make_decl_local,
	symtab_node::copy_visibility_from,
	symtab_node::can_increase_alignment_p): Likewise.
	* dwarf2out.c (add_var_loc_to_decl, tls_mem_loc_descriptor,
	decl_by_reference_p, reference_to_unused, rtl_for_decl_location,
	fortran_common, add_location_or_const_value_attribute,
	add_scalar_info, add_linkage_name, set_block_abstract_flags,
	local_function_static, gen_variable_die, dwarf2out_late_global_decl,
	optimize_one_addr_into_implicit_ptr,
	optimize_location_into_implicit_ptr): Likewise.
	* gimple-low.c (record_vars_into): Likewise.
	* ipa-visibility.c (update_vtable_references): Likewise.
	* tree-ssa-address.c (fixed_address_object_p, copy_ref_info):
	Likewise.
	* lto-streamer-out.c (tree_is_indexable, get_symbol_initial_value,
	DFS::DFS_write_tree_body, write_symbol): Likewise.
	* langhooks.c (lhd_warn_unused_global_decl,
	lhd_set_decl_assembler_name): Likewise.
	* attribs.c (decl_attributes): Likewise.
	* except.c (output_ttype): Likewise.
	* varpool.c (varpool_node::get_create, ctor_for_folding,
	varpool_node::assemble_decl, varpool_node::create_alias): Likewise.
	* fold-const.c (fold_unary_loc): Likewise.
	* ipa-prop.c (ipa_compute_jump_functions_for_edge,
	ipa_find_agg_cst_from_init): Likewise.
	* omp-low.c (expand_omp_regimplify_p, expand_omp_taskreg,
	expand_omp_target, lower_omp_regimplify_p,
	grid_reg_assignment_to_local_var_p, grid_remap_prebody_decls,
	find_link_var_op): Likewise.
	* tree-chrec.c (chrec_contains_symbols): Likewise.
	* tree-cfg.c (verify_address, verify_expr, verify_expr_location_1,
	gimple_duplicate_bb, move_stmt_op, replace_block_vars_by_duplicates,
	execute_fixup_cfg): Likewise.

From-SVN: r240900
2016-10-09 13:19:48 +02:00
Prathamesh Kulkarni 67b974787c ipa-cp.c (ipcp_alignment_lattice): Remove.
2016-10-09  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	* ipa-cp.c (ipcp_alignment_lattice): Remove.
	(ipcp_param_lattices): Remove field alignment.
	(print_all_lattices): Remove call to ipcp_alignment_lattice::print.
	(set_all_contains_variable): Remove call to
	ipcp_alignment_lattice::set_to_bottom.
	(initialize_node_lattices): Likewise.
	(propagate_alignment_accross_jump_function): Remove.
	(propagate_constants_accross_call): Remove call to
	propagate_alignment_accross_jump_function.
	(ipcp_store_alignment_results): Remove.
	(ipcp_driver): Remove call to ipcp_store_alignment_results.
	(propagate_bits_accross_jump_function): Handle ancestor jump function.
	* ipa-prop.c (ipa_print_node_jump_functions_for_edge): Remove
	pretty-printing of alignment jump function.
	(ipa_set_jf_unknown): Remove assignment to jfunc->alignment.known.
	(ipa_compute_jump_functions_for_edge): Adjust ipa_bits jump function for
	alignments and remove computing ipa_alignment jump function.
	(ipa_node_params_t::duplicate): Remove copying of src_trans->alignments.
	(ipa_write_jump_functions): Remove streaming for ipa_alignment.
	(ipa_read_jump_function): Remove reading of ipa_alignment.
	(write_ipcp_transformation_info): Remove streaming for alignment
	propagation summary.
	(read_ipcp_transformation_info): Remove reading of alignment
	propagation summary. 
	(ipcp_update_alignments): Remove.
	(ipcp_update_bits): Adjust to set alignment for parameters of pointer
	type.
	(ipcp_transform_function): Remove call to ipcp_update_alignments()
	and remove assignment to (*ipcp_transformations)[node->uid].alignments.
	* ipa-prop.h (ipa_alignment): Remove.
	(ipa_jump_func): Remove field alignment.
	(ipcp_transformation_summary): Remove field alignments. 
	* doc/invoke.texi: Mark fipa-cp-alignment as obsolete.
	* opts.c (default_options_table): Remove entry for fipa-cp-alignment.
	(enable_fdo_optimizations): Remove checking for fipa-cp-alignment.

testsuite/
	* gcc.dg/ipa/propalign-1.c: Adjust scan-ipa-dump.
	* gcc.dg/ipa/propalign-2.c: Likewise
	* gcc.dg/ipa/propalign-3.c: Likewise.
	* gcc.dg/ipa/propalign-4.c: Likewise.
	* gcc.dg/ipa/propalign-5.c: Likewise.

From-SVN: r240898
2016-10-09 04:48:50 +00:00
Kugan Vivekanandarajah 3a4228babc Fix ipa-vrp convert value_range
gcc/ChangeLog:

2016-09-27  Kugan Vivekanandarajah  <kuganv@linaro.org>

	PR ipa/77677
	* ipa-prop.c (ipa_compute_jump_functions_for_edge): Use
	extract_range_from_unary_expr to convert value_range.
	* tree-vrp.c (extract_range_from_unary_expr_1): Rename to.
	(extract_range_from_unary_expr): This.
	* tree-vrp.h (extract_range_from_unary_expr): Declare.

gcc/testsuite/ChangeLog:

2016-09-27  Kugan Vivekanandarajah  <kuganv@linaro.org>

	PR ipa/77677
	* gcc.dg/torture/pr77677-2.c: New test.

From-SVN: r240517
2016-09-27 03:41:14 +00:00
Kugan Vivekanandarajah 8bc5448f39 Add IPA VRP
gcc/lto/ChangeLog:
2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* lto-partition.c: Include tree-vrp.h.
	* lto.c: Likewise.

gcc/testsuite/ChangeLog:

2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments
	will be optimized away.
	* gcc.dg/ipa/vrp1.c: New test.
	* gcc.dg/ipa/vrp2.c: New test.
	* gcc.dg/ipa/vrp3.c: New test.

gcc/ChangeLog:

2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* common.opt: New option -fipa-vrp.
	* ipa-cp.c (ipa_get_vr_lat): New.
	(ipcp_vr_lattice::print): Likewise.
	(print_all_lattices): Call ipcp_vr_lattice::print.
	(ipcp_vr_lattice::meet_with): New.
	(ipcp_vr_lattice::meet_with_1): Likewise.
	(ipcp_vr_lattice::top_p): Likewise.
	(ipcp_vr_lattice::bottom_p): Likewsie.
	(ipcp_vr_lattice::set_to_bottom): Likewise.
	(set_all_contains_variable): Call VR set_to_bottom.
	(initialize_node_lattices): Init VR lattices.
	(propagate_vr_accross_jump_function): New.
	(propagate_constants_accross_call): Call
	propagate_vr_accross_jump_function.
	(ipcp_store_vr_results): New.
	(ipcp_driver): Handle VR.
	* ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR.
	(ipa_set_jf_unknown): Likewise.
	(ipa_compute_jump_functions_for_edge): Likewise.
	(ipa_node_params_t::duplicate): Likewise.
	(ipa_write_jump_function): Likewise.
	(ipa_read_jump_function): Likewise.
	(write_ipcp_transformation_info): Likewise.
	(read_ipcp_transformation_info): Likewise.
	(ipcp_update_vr): New.
	(ipcp_transform_function): Handle VR.
	* ipa-prop.h (struct ipa_vr): New.
	* cgraph.c: Include tree-vrp.h.
	* cgraphunit.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa.c: Likewise.

From-SVN: r240292
2016-09-20 23:29:05 +00:00
Jason Merrill 146ec50fd5 Add inline functions for various bitwise operations.
* hwint.h (least_bit_hwi, pow2_or_zerop, pow2p_hwi, ctz_or_zero):
	New.
	* hwint.c (exact_log2): Use pow2p_hwi.
	(ctz_hwi, ffs_hwi): Use least_bit_hwi.
	* alias.c (memrefs_conflict_p): Use pow2_or_zerop.
	* builtins.c (get_object_alignment_2, get_object_alignment)
	(get_pointer_alignment, fold_builtin_atomic_always_lock_free): Use
	least_bit_hwi.
	* calls.c (compute_argument_addresses, store_one_arg): Use
	least_bit_hwi.
	* cfgexpand.c (expand_one_stack_var_at): Use least_bit_hwi.
	* combine.c (force_to_mode): Use least_bit_hwi.
	* emit-rtl.c (set_mem_attributes_minus_bitpos, adjust_address_1):
	Use least_bit_hwi.
	* expmed.c (synth_mult, expand_divmod): Use ctz_or_zero, ctz_hwi.
	(init_expmed_one_conv): Use pow2p_hwi.
	* fold-const.c (round_up_loc, round_down_loc): Use pow2_or_zerop.
	(fold_binary_loc): Use pow2p_hwi.
	* function.c (assign_parm_find_stack_rtl): Use least_bit_hwi.
	* gimple-fold.c (gimple_fold_builtin_memory_op): Use pow2p_hwi.
	* gimple-ssa-strength-reduction.c (replace_ref): Use least_bit_hwi.
	* hsa-gen.c (gen_hsa_addr_with_align, hsa_bitmemref_alignment):
	Use least_bit_hwi.
	* ipa-cp.c (ipcp_alignment_lattice::meet_with_1): Use least_bit_hwi.
	* ipa-prop.c (ipa_modify_call_arguments): Use least_bit_hwi.
	* omp-low.c (oacc_loop_fixed_partitions)
	(oacc_loop_auto_partitions): Use least_bit_hwi.
	* rtlanal.c (nonzero_bits1): Use ctz_or_zero.
	* stor-layout.c (place_field): Use least_bit_hwi.
	* tree-pretty-print.c (dump_generic_node): Use pow2p_hwi.
	* tree-sra.c (build_ref_for_offset): Use least_bit_hwi.
	* tree-ssa-ccp.c (ccp_finalize): Use least_bit_hwi.
	* tree-ssa-math-opts.c (bswap_replace): Use least_bit_hwi.
	* tree-ssa-strlen.c (handle_builtin_memcmp): Use pow2p_hwi.
	* tree-vect-data-refs.c (vect_analyze_group_access_1)
	(vect_grouped_store_supported, vect_grouped_load_supported)
	(vect_permute_load_chain, vect_shift_permute_load_chain)
	(vect_transform_grouped_load): Use pow2p_hwi.
	* tree-vect-generic.c (expand_vector_divmod): Use ctz_or_zero.
	* tree-vect-patterns.c (vect_recog_divmod_pattern): Use ctz_or_zero.
	* tree-vect-stmts.c (vectorizable_mask_load_store): Use
	least_bit_hwi.
	* tsan.c (instrument_expr): Use least_bit_hwi.
	* var-tracking.c (negative_power_of_two_p): Use pow2_or_zerop.

From-SVN: r240194
2016-09-16 15:20:44 -04:00
Prathamesh Kulkarni 209ca542ca Patch for performing interprocedural bitwise constant propagation.
2016-08-26  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
	    Martin Jambhor  <mjambor@suse.cz>

	* common.opt: New option -fipa-bit-cp.
	* doc/invoke.texi: Document -fipa-bit-cp.
	* opts.c (default_options_table): Add entry for -fipa-bit-cp.
	(enable_fdo_optimizations): Check for flag_ipa_bit_cp.
	* tree-ssa-ccp.h: New header file.
	* tree-ssa-ccp.c: Include tree-ssa-ccp.h
	(bit_value_binop_1): Change to bit_value_binop_1 and export it.
	Replace all occurences of tree parameter by two new params: signop, int.
	(bit_value_unop_1): Change to bit_value_unop and export it.
	Replace all occurences of tree parameter by two new params: signop,
	int.
	(bit_value_binop): Change call from bit_value_binop_1 to
	bit_value_binop.
	(bit_value_assume_aligned): Likewise.
	(bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop.
	(do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p
	to ccp_finalize.
	(ccp_finalize): Skip processing if val->mask == 0.
	* ipa-cp.c: Include tree-ssa-ccp.h
	(ipcp_bits_lattice): New class.
	(ipcp_param_lattice (bits_lattice): New member.
	(print_all_lattices): Call ipcp_bits_lattice::print.
	(set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. 
	(initialize_node_lattices): Likewise.
	(propagate_bits_accross_jump_function): New function.
	(propagate_constants_accross_call): Call
	propagate_bits_accross_jump_function.
	(ipcp_propagate_stage): Store parameter types when in_lto_p is true.
	(ipcp_store_bits_results): New function.
	(ipcp_driver): Call ipcp_store_bits_results.
	* ipa-prop.h (ipa_bits): New struct.
	(ipa_jump_func): Add new member bits of type ipa_bits.
	(ipa_param_descriptor): Change decl to decl_or_type.
	(ipa_get_param): Change decl to decl_or_type and assert on
	PARM_DECL.
	(ipa_get_type): New function.
	(ipcp_transformation_summary): New member bits.
	* ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type.
	(ipa_populate_param_decls): Likewise.
	(ipa_dump_param): Likewise.
	(ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump
	function.
	(ipa_set_jf_unknown): Set ipa_bits::known to false.
	(ipa_compute_jump_functions_for_edge): Compute jump function for bits
	propagation.
	(ipa_node_params_t::duplicate): Copy src->bits into dst->bits.
	(ipa_write_jump_function): Add streaming for ipa_bits.
	(ipa_read_jump_function): Add support for reading streamed ipa_bits.
	(write_ipcp_transformation_info): Add streaming for ipa_bits
	summary for ltrans.
	(read_ipcp_transfomration_info): Add support for reading streamed ipa_bits.
	(ipcp_update_bits): New function.
	(ipcp_transform_function): Call ipcp_update_bits.

testsuite/
	* gcc.dg/ipa/propbits-1.c: New test-case.
	* gcc.dg/ipa/propbits-2.c: Likewise.
	* gcc.dg/ipa/propbits-3.c: Likewise.

Co-Authored-By: Martin Jambor <mjambor@suse.cz>

From-SVN: r239769
2016-08-26 08:05:39 +00:00
Richard Biener fe7afdf5b5 re PR target/68273 (Wrong code on mips/mipsel due to (invalid?) peeking at alignments in function_arg.)
2016-08-09  Richard Biener  <rguenther@suse.de>

	PR ipa/68273
	* ipa-prop.c (ipa_modify_formal_parameters): Build
	parameter types with natural alignment also for the
	over-aligned case.

From-SVN: r239273
2016-08-09 07:38:13 +00:00
Martin Jambor 04643334f9 Allow constant global VAR_DECLs in constant jump functions
2016-05-18  Martin Jambor  <mjambor@suse.cz>

	PR ipa/69708
	* ipa-cp.c (ipa_get_jf_pass_through_result): Allow non-ip constant
	input for NOP_EXPR pass-through functions.
	* ipa-prop.c (ipa_compute_jump_functions_for_edge): Allow
	aggregate global constant VAR_DECLs in constant jump functions.

testsuite/
	* gcc.dg/ipa/iinline-cstagg-2.c: New test.
	* gcc.dg/ipa/ipcp-cstagg-5.c: Likewise.
	* gcc.dg/ipa/ipcp-cstagg-6.c: Likewise.
	* gcc.dg/ipa/ipcp-cstagg-7.c: Likewise.

From-SVN: r236418
2016-05-18 18:44:08 +02:00
Martin Jambor 776e4fe2ca Const parameters are always unmodified
2016-05-18  Martin Jambor  <mjambor@suse.cz>

	PR ipa/69708
	* ipa-prop.c (parm_preserved_before_stmt_p): Return true for loads
	from TREE_READONLY parameters.

From-SVN: r236417
2016-05-18 18:41:19 +02:00
Martin Jambor 91bb9f80e5 Indirect inlining of targets from references of global constants
2016-05-18  Martin Jambor  <mjambor@suse.cz>

	PR ipa/69708
	* cgraph.h (cgraph_indirect_call_info): New field
	guaranteed_unmodified.
	* ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value
	to ipa_find_agg_cst_for_param, check guaranteed_unmodified when
	appropriate.
	* ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also
	pass the parameter value to ipa_find_agg_cst_for_param.
	* ipa-prop.c (ipa_load_from_parm_agg): New parameter
	guaranteed_unmodified, store AA results there instead of bailing out
	if present.
	(ipa_note_param_call): Also initialize guaranteed_unmodified flag.
	(ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag.
	(find_constructor_constant_at_offset): New function.
	(ipa_find_agg_cst_from_init): Likewise.
	(ipa_find_agg_cst_for_param): Also seearch for aggregate values in
	static initializers of contants, report back through a new paameter
	from_global_constant if that was the case.
	(try_make_edge_direct_simple_call): Also pass parameter value to
	ipa_find_agg_cst_for_param, check guaranteed_unmodified when
	appropriate.
	(ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified.
	(ipa_read_indirect_edge_info): Likewise.
	* ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration.
	(ipa_load_from_parm_agg): Likewise.

testsuite/
	* gcc.dg/ipa/iinline-cstagg-1.c: New test.
	* gcc.dg/ipa/ipcp-cstagg-1.c: Likewise.
	* gcc.dg/ipa/ipcp-cstagg-2.c: Likewise.
	* gcc.dg/ipa/ipcp-cstagg-3.c: Likewise.
	* gcc.dg/ipa/ipcp-cstagg-4.c: Likewise.

From-SVN: r236416
2016-05-18 18:38:56 +02:00
Martin Jambor 29799e9db1 Respect --param ipa-max-agg-items=0
2016-05-18  Martin Jambor  <mjambor@suse.cz>

	PR ipa/70646
	* ipa-prop.c (determine_locally_known_aggregate_parts): Bail out early
	if parameter PARAM_IPA_MAX_AGG_ITEMS is zero.

From-SVN: r236390
2016-05-18 15:06:24 +02:00
Richard Biener 5f9a167b52 re PR middle-end/70424 (Pointer derived from integer gets reduced alignment)
2016-03-29  Richard Biener  <rguenther@suse.de>

	PR middle-end/70424
	* ipa-prop.c (ipa_compute_jump_functions_for_edge): Always
	use alignment returned by get_pointer_alignment_1 if it is
	bigger than BITS_PER_UNIT.
	* builtins.c (get_pointer_alignment_1): Do not return true
	for alignment extracted from SSA info.

From-SVN: r234517
2016-03-29 12:36:39 +00:00
Kugan Vivekanandarajah d8126ae1cf ipa-prop.c (ipa_set_jf_constant): Remove redundant unshare_expr.
gcc/ChangeLog:

2016-01-22  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* ipa-prop.c (ipa_set_jf_constant): Remove redundant unshare_expr.

From-SVN: r232725
2016-01-22 12:09:58 +00:00
Jakub Jelinek 818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
Jan Hubicka 2994ab20f1 ipa-cp.c (ipa_get_indirect_edge_target_1): Use can_refer; do not speculate to impossible targets.
* ipa-cp.c (ipa_get_indirect_edge_target_1): Use can_refer; do not
	speculate to impossible targets.
	* ipa-prop.c (try_make_edge_direct_virtual_call): Likewise.

From-SVN: r231705
2015-12-16 17:26:20 +00:00
Martin Jambor 9e64af1875 Add an asssert and testcase for PR 68064
2015-12-11  Martin Jambor  <mjambor@suse.cz>

	PR ipa/68064
	* ipa-prop.c (ipa_compute_jump_functions_for_edge): Add checking
	assert that align is nonzero.

testsuite/
	* g++.dg/torture/pr68064.C: New test.

From-SVN: r231559
2015-12-11 12:27:11 +01:00
Jeff Law 3daacdcd5f re PR tree-optimization/68619 (error: loop with header 6 not in loop tree)
2015-12-10  Jeff Law  <law@redhat.com>

	PR tree-optimization/68619
	* tree-ssa-dom.c (dom_opt_dom_walker::before_dom_children): Propgate
	return value from optimize_stmt.
	(dom_opt_dom_walker): Add new argument to dom_walker constructor.
	(pass_dominator:execute): If a block has an unreachable edge,
	remove all jump threads through any successor of the affected block.
	(record_equivalences_from_phis): Ignore alternative if the edge
	does not have EDGE_EXECUTABLE set.
	(single_incoming_edge_ignoring_loop_edges): Similarly.
	(optimize_stmt): If a gimple_code has a compile-time constant
	condition, return the edge taken for that constant value.  Also
	change the condition to true/false as necessary.
	* domwalk.h (dom_walker::dom_walker): Add new argument
	skip_unreachable_blocks.  Don't provide empty constructor body.
	(dom_walker::before_dom_children): Change return type.
	(dom_walker::bb_reachable): Declare new private method.
	(dom_walker::propagate_unreachable_to_edges): Likewise.
	(dom_walker::m_unreachable_dom): Declare new private data member.
	(dom_walker::m_skip_unreachable_blocks): Likewise.
	* domwalk.c: Include dumpfile.h.
	(dom_walker::dom_walker): New constructor.  Initialize private data
	members.  If needed, set EDGE_EXECUTABLE for all edges in the CFG,
	extracted from tree-ssa-sccvn.c.
	(dom_walker::bb_reachable): New method extracted from tree-ssa-sccvn.c
	(dom_walker::propagate_unreachable_to_edges): Likewise.
	(dom_walker::walk): Only call before_dom_children on reachable
	blocks.  If before_dom_children returns an edge, then clear
	EDGE_EXECUTABLE for all other outgoing edges from the same block.
	For unreachable blocks, call propagate_unreachable_to_edges.
	Similarly, only call after_dom_children on reachable blocks.  For
	unreachable blocks, conditionally clear m_unreachable_dom.
	* tree-ssa-sccvn.c (sccvn_dom_walker::unreachable_dom): Remove
	private data member.
	(sccvn_dom_walker::after_dom_children): Use methods from dom_walker
	class.
	(run_scc_vn): Likewise.
	(sccvn_dom_walker::before_dom_children): Likewise.  Return the taken
	outgoing edge if a COND, SWITCH, or GOTO are optimized.
	* compare-elim.c (find_comparison_dom_walker::before_dom_children):
	Change return type to an edge.  Always return NULL.
	* fwprop.c (single_def_use_dom_walker::before_dom_children): Likewise.
	* gimple-ssa-strength-reduction.c
	(find_candidates_dom_walker::before_dom_children): Likewise.
	* ipa-prop.c (analysis_dom_walker::before_dom_children): Likewise.
	(ipcp_modif_dom_walker::before_dom_children): Likewise.
	* tree-into-ssa.c (rewrite_dom_walker::before_dom_children): Likewise.
	(rewrite_update_dom_walker::before_dom_children): Likewise.
	(mark_def_dom_children::before_dom_children): Likewise.
	* tree-ssa-dse.c (dse_dom_walker::before_dom_children): Likewise.
	* tree-ssa-loop-im.c
	(invariantness_dom_walker::before_dom_children): Likewise.
	(move_computations_dom_walker::before_dom_walker): Likewise.
	* tree-ssa-phiopt.c
	(nontrapping_dom_walker::before_dom_children): Likewise.
	* tree-ssa-pre.c
	(eliminate_dom_walker::before_dom_children): Likewise.
	* tree-ssa-propagate.c
	(substitute_and_fold_dom_walker::before_dom_children): Likewise.
	* tree-ssa-strlen.c
	(strlen_dom_walker::before_dom_children): Likewise.
	* tree-ssa-uncprop.c
	(uncprop_dom_walker::before_dom_children): Likewise.

	PR tree-optimization/68619
	* gcc.dg/tree-ssa/pr68619-1.c: New test.
	* gcc.dg/tree-ssa/pr68619-2.c: New test.
	* gcc.dg/tree-ssa/pr68619-3.c: New test.
	* gcc.dg/tree-ssa/pr68619-4.c: New test.
	* gcc.dg/tree-ssa/pr68619-5.c: New test.

From-SVN: r231527
2015-12-10 09:34:43 -07:00
Martin Liska c34311917f Fix memory leaks in IPA.
* ipa-inline-analysis.c (estimate_function_body_sizes): Call
	body_info release function.
	* ipa-prop.c (ipa_release_body_info): New function.
	(ipa_analyze_node): Call the function.
	(ipa_node_params::~ipa_node_params): Release known_csts.
	* ipa-prop.h (ipa_release_body_info): Declare.

From-SVN: r230028
2015-11-09 15:47:01 +00:00
Eric Botcazou ee45a32dae Merge of the scalar-storage-order branch.
From-SVN: r229965
2015-11-08 18:33:42 +00:00
Andrew MacLeod 68a750e938 alias.c: Remove unused headers.
2015-10-30  Andrew MacLeod  <amacleod@redhat.com>
	
	* alias.c: Remove unused headers.
	* asan.c: Likewise.
	* attribs.c: Likewise.
	* auto-inc-dec.c: Likewise.
	* auto-profile.c: Likewise.
	* bb-reorder.c: Likewise.
	* bitmap.c: Likewise.
	* bt-load.c: Likewise.
	* builtins.c: Likewise.
	* caller-save.c: Likewise.
	* calls.c: Likewise.
	* ccmp.c: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfgexpand.c: Likewise.
	* cfghooks.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgloopanal.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.c: Likewise.
	* cgraphbuild.c: Likewise.
	* cgraphclones.c: Likewise.
	* cgraphunit.c: Likewise.
	* cilk-common.c: Likewise.
	* combine-stack-adj.c: Likewise.
	* combine.c: Likewise.
	* compare-elim.c: Likewise.
	* convert.c: Likewise.
	* coverage.c: Likewise.
	* cppbuiltin.c: Likewise.
	* cprop.c: Likewise.
	* cse.c: Likewise.
	* cselib.c: Likewise.
	* data-streamer-in.c: Likewise.
	* data-streamer-out.c: Likewise.
	* data-streamer.c: Likewise.
	* dbxout.c: Likewise.
	* dce.c: Likewise.
	* ddg.c: Likewise.
	* debug.c: Likewise.
	* df-core.c: Likewise.
	* df-problems.c: Likewise.
	* df-scan.c: Likewise.
	* dfp.c: Likewise.
	* dojump.c: Likewise.
	* dominance.c: Likewise.
	* domwalk.c: Likewise.
	* double-int.c: Likewise.
	* dse.c: Likewise.
	* dumpfile.c: Likewise.
	* dwarf2asm.c: Likewise.
	* dwarf2cfi.c: Likewise.
	* dwarf2out.c: Likewise.
	* emit-rtl.c: Likewise.
	* except.c: Likewise.
	* explow.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* final.c: Likewise.
	* fixed-value.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* fwprop.c: Likewise.
	* gcse.c: Likewise.
	* generic-match-head.c: Likewise.
	* ggc-common.c: Likewise.
	* gimple-builder.c: Likewise.
	* gimple-expr.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-iterator.c: Likewise.
	* gimple-low.c: Likewise.
	* gimple-match-head.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* gimple-ssa-isolate-paths.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimple-streamer-in.c: Likewise.
	* gimple-streamer-out.c: Likewise.
	* gimple-walk.c: Likewise.
	* gimple.c: Likewise.
	* gimplify-me.c: Likewise.
	* gimplify.c: Likewise.
	* godump.c: Likewise.
	* graph.c: Likewise.
	* graphds.c: Likewise.
	* haifa-sched.c: Likewise.
	* hw-doloop.c: Likewise.
	* ifcvt.c: Likewise.
	* init-regs.c: Likewise.
	* internal-fn.c: Likewise.
	* ipa-chkp.c: Likewise.
	* ipa-comdats.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-icf-gimple.c: Likewise.
	* ipa-icf.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* ipa-inline-transform.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-polymorphic-call.c: Likewise.
	* ipa-profile.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-ref.c: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa-visibility.c: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-conflicts.c: Likewise.
	* ira-costs.c: Likewise.
	* ira-emit.c: Likewise.
	* ira-lives.c: Likewise.
	* ira.c: Likewise.
	* jump.c: Likewise.
	* langhooks.c: Likewise.
	* lcm.c: Likewise.
	* lists.c: Likewise.
	* loop-doloop.c: Likewise.
	* loop-init.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-iv.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lra-assigns.c: Likewise.
	* lra-coalesce.c: Likewise.
	* lra-constraints.c: Likewise.
	* lra-eliminations.c: Likewise.
	* lra-lives.c: Likewise.
	* lra-remat.c: Likewise.
	* lra-spills.c: Likewise.
	* lra.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-compress.c: Likewise.
	* lto-opts.c: Likewise.
	* lto-section-in.c: Likewise.
	* lto-section-out.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* mcf.c: Likewise.
	* mode-switching.c: Likewise.
	* modulo-sched.c: Likewise.
	* optabs.c: Likewise.
	* opts-global.c: Likewise.
	* passes.c: Likewise.
	* plugin.c: Likewise.
	* postreload-gcse.c: Likewise.
	* postreload.c: Likewise.
	* predict.c: Likewise.
	* print-tree.c: Likewise.
	* profile.c: Likewise.
	* real.c: Likewise.
	* realmpfr.c: Likewise.
	* recog.c: Likewise.
	* ree.c: Likewise.
	* reg-stack.c: Likewise.
	* regcprop.c: Likewise.
	* reginfo.c: Likewise.
	* regrename.c: Likewise.
	* regstat.c: Likewise.
	* reload.c: Likewise.
	* reload1.c: Likewise.
	* reorg.c: Likewise.
	* resource.c: Likewise.
	* rtl-chkp.c: Likewise.
	* rtl-error.c: Likewise.
	* rtlanal.c: Likewise.
	* rtlhooks.c: Likewise.
	* sanopt.c: Likewise.
	* sched-deps.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-rgn.c: Likewise.
	* sdbout.c: Likewise.
	* sel-sched-dump.c: Likewise.
	* sel-sched-ir.c: Likewise.
	* sel-sched.c: Likewise.
	* sese.c: Likewise.
	* shrink-wrap.c: Likewise.
	* simplify-rtx.c: Likewise.
	* stack-ptr-mod.c: Likewise.
	* statistics.c: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* store-motion.c: Likewise.
	* stringpool.c: Likewise.
	* symtab.c: Likewise.
	* target-globals.c: Likewise.
	* targhooks.c: Likewise.
	* toplev.c: Likewise.
	* tracer.c: Likewise.
	* trans-mem.c: Likewise.
	* tree-affine.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-chkp-opt.c: Likewise.
	* tree-chkp.c: Likewise.
	* tree-chrec.c: Likewise.
	* tree-complex.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-diagnostic.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-iterator.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-object-size.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-profile.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-copy.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-ifcombine.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-loop-ch.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-loop-unswitch.c: Likewise.
	* tree-ssa-loop.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-scopedtables.c: Likewise.
	* tree-ssa-sink.c: Likewise.
	* tree-ssa-strlen.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-tail-merge.c: Likewise.
	* tree-ssa-ter.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-switch-conversion.c: Likewise.
	* tree-tailcall.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-vrp.c: Likewise.
	* tree.c: Likewise.
	* tsan.c: Likewise.
	* ubsan.c: Likewise.
	* value-prof.c: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.
	* varpool.c: Likewise.
	* vmsdbgout.c: Likewise.
	* vtable-verify.c: Likewise.
	* web.c: Likewise.
	* wide-int-print.cc: Likewise.
	* wide-int.cc: Likewise.
	* xcoffout.c: Likewise.

From-SVN: r229585
2015-10-30 15:48:59 +00:00
Andrew MacLeod 957060b5c5 alias.c: Reorder #include statements and remove duplicates.
2015-10-29  Andrew MacLeod  <amacleod@redhat.com>

	* alias.c: Reorder #include statements and remove duplicates.
	* asan.c: Likewise.
	* attribs.c: Likewise.
	* auto-inc-dec.c: Likewise.
	* auto-profile.c: Likewise.
	* bb-reorder.c: Likewise.
	* bt-load.c: Likewise.
	* builtins.c: Likewise.
	* caller-save.c: Likewise.
	* calls.c: Likewise.
	* ccmp.c: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfgexpand.c: Likewise.
	* cfghooks.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgloopanal.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.c: Likewise.
	* cgraphbuild.c: Likewise.
	* cgraphclones.c: Likewise.
	* cgraphunit.c: Likewise.
	* cilk-common.c: Likewise.
	* combine-stack-adj.c: Likewise.
	* combine.c: Likewise.
	* compare-elim.c: Likewise.
	* convert.c: Likewise.
	* coverage.c: Likewise.
	* cppbuiltin.c: Likewise.
	* cprop.c: Likewise.
	* cse.c: Likewise.
	* cselib.c: Likewise.
	* data-streamer-in.c: Likewise.
	* data-streamer-out.c: Likewise.
	* data-streamer.c: Likewise.
	* dbxout.c: Likewise.
	* dce.c: Likewise.
	* ddg.c: Likewise.
	* debug.c: Likewise.
	* df-core.c: Likewise.
	* df-problems.c: Likewise.
	* df-scan.c: Likewise.
	* dfp.c: Likewise.
	* dojump.c: Likewise.
	* dominance.c: Likewise.
	* double-int.c: Likewise.
	* dse.c: Likewise.
	* dumpfile.c: Likewise.
	* dwarf2asm.c: Likewise.
	* dwarf2cfi.c: Likewise.
	* dwarf2out.c: Likewise.
	* emit-rtl.c: Likewise.
	* except.c: Likewise.
	* explow.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* final.c: Likewise.
	* fixed-value.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* fwprop.c: Likewise.
	* gcse.c: Likewise.
	* generic-match-head.c: Likewise.
	* ggc-common.c: Likewise.
	* gimple-builder.c: Likewise.
	* gimple-expr.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-iterator.c: Likewise.
	* gimple-low.c: Likewise.
	* gimple-match-head.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* gimple-ssa-isolate-paths.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimple-streamer-in.c: Likewise.
	* gimple-streamer-out.c: Likewise.
	* gimple-walk.c: Likewise.
	* gimple.c: Likewise.
	* gimplify-me.c: Likewise.
	* gimplify.c: Likewise.
	* godump.c: Likewise.
	* graph.c: Likewise.
	* graphite-poly.c: Likewise.
	* haifa-sched.c: Likewise.
	* hw-doloop.c: Likewise.
	* ifcvt.c: Likewise.
	* incpath.c: Likewise.
	* init-regs.c: Likewise.
	* internal-fn.c: Likewise.
	* ipa-chkp.c: Likewise.
	* ipa-comdats.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-icf-gimple.c: Likewise.
	* ipa-icf.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* ipa-inline-transform.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-polymorphic-call.c: Likewise.
	* ipa-profile.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-ref.c: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa-visibility.c: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-conflicts.c: Likewise.
	* ira-costs.c: Likewise.
	* ira-emit.c: Likewise.
	* ira-lives.c: Likewise.
	* ira.c: Likewise.
	* jump.c: Likewise.
	* langhooks.c: Likewise.
	* lcm.c: Likewise.
	* lists.c: Likewise.
	* loop-doloop.c: Likewise.
	* loop-init.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-iv.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lra-assigns.c: Likewise.
	* lra-coalesce.c: Likewise.
	* lra-constraints.c: Likewise.
	* lra-eliminations.c: Likewise.
	* lra-lives.c: Likewise.
	* lra-remat.c: Likewise.
	* lra-spills.c: Likewise.
	* lra.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-compress.c: Likewise.
	* lto-opts.c: Likewise.
	* lto-section-in.c: Likewise.
	* lto-section-out.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* mode-switching.c: Likewise.
	* modulo-sched.c: Likewise.
	* omp-low.c: Likewise.
	* optabs.c: Likewise.
	* opts-global.c: Likewise.
	* passes.c: Likewise.
	* plugin.c: Likewise.
	* postreload-gcse.c: Likewise.
	* postreload.c: Likewise.
	* predict.c: Likewise.
	* print-tree.c: Likewise.
	* profile.c: Likewise.
	* real.c: Likewise.
	* realmpfr.c: Likewise.
	* recog.c: Likewise.
	* ree.c: Likewise.
	* reg-stack.c: Likewise.
	* regcprop.c: Likewise.
	* reginfo.c: Likewise.
	* regrename.c: Likewise.
	* regstat.c: Likewise.
	* reload.c: Likewise.
	* reload1.c: Likewise.
	* reorg.c: Likewise.
	* resource.c: Likewise.
	* rtl-chkp.c: Likewise.
	* rtl-error.c: Likewise.
	* rtlanal.c: Likewise.
	* rtlhooks.c: Likewise.
	* sanopt.c: Likewise.
	* sched-deps.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-rgn.c: Likewise.
	* sese.c: Likewise.
	* shrink-wrap.c: Likewise.
	* simplify-rtx.c: Likewise.
	* stack-ptr-mod.c: Likewise.
	* statistics.c: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* store-motion.c: Likewise.
	* stringpool.c: Likewise.
	* symtab.c: Likewise.
	* target-globals.c: Likewise.
	* targhooks.c: Likewise.
	* toplev.c: Likewise.
	* tracer.c: Likewise.
	* trans-mem.c: Likewise.
	* tree-affine.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-chkp-opt.c: Likewise.
	* tree-chkp.c: Likewise.
	* tree-chrec.c: Likewise.
	* tree-complex.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-diagnostic.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-iterator.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-object-size.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-profile.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-copy.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-ifcombine.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-loop-ch.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-loop-unswitch.c: Likewise.
	* tree-ssa-loop.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-scopedtables.c: Likewise.
	* tree-ssa-sink.c: Likewise.
	* tree-ssa-strlen.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-tail-merge.c: Likewise.
	* tree-ssa-ter.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-switch-conversion.c: Likewise.
	* tree-tailcall.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-vrp.c: Likewise.
	* tree.c: Likewise.
	* tsan.c: Likewise.
	* ubsan.c: Likewise.
	* value-prof.c: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.
	* varpool.c: Likewise.
	* vtable-verify.c: Likewise.
	* web.c: Likewise.
	* wide-int-print.cc: Likewise.
	* wide-int.cc: Likewise.
	* xcoffout.c: Likewise.

From-SVN: r229526
2015-10-29 13:57:32 +00:00
Martin Liska 7e729474b2 Correctly fill up cgraph_node::local.versionable flag.
* cgraphclones.c (cgraph_node::create_virtual_clone):
	Verify cgraph_node.local.versionable instead of calling
	tree_versionable_function_p.
	* ipa-cp.c (determine_versionability): Save the information
	to ipa_node_params summary.
	(ipcp_versionable_function_p): Use it.
	(ipcp_propagate_stage): Pass IPA_NODE_REF to a called function.
	(ipcp_generate_summary): Do not compute cgraph_node
	versionability.
	* ipa-inline-analysis.c (inline_generate_summary): Compute
	versionability for all cgraph nodes.
	* ipa-prop.c (ipa_node_params_t::duplicate): Duplicate
	ipa_node_params::versionability.
	* ipa-prop.h (struct ipa_node_params): Declare it.

From-SVN: r229055
2015-10-20 11:59:51 +00:00
Trevor Saunders 355fe0884b switch from gimple to gimple*
This renames the gimple_statement_base struct to gimple removes the
typedef of gimple_statement_base * to gimple, and then adjusts all of
the places that use the type.

gcc/ChangeLog:

2015-09-19  Trevor Saunders  <tbsaunde@tbsaunde.org>

	* coretypes.h (gimple): Change typedef to be a forward
	declaration.
	* gimple.h (gimple_statement_base): rename to gimple.
	* (all functions and types using gimple): Adjust.
	* *.[ch]: Likewise.

gcc/cp/ChangeLog:

2015-09-19  Trevor Saunders  <tbsaunde@tbsaunde.org>

	* cp-gimplify.c (gimplify_must_not_throw_expr): Adjust.

From-SVN: r227941
2015-09-20 00:52:59 +00:00
Mikhail Maltsev fcb87c50b0 Share memory blocks between pool allocators
gcc/
	* Makefile.in: Add memory-block.cc
	(pool_allocator::initialize): Use fixed block size.
	(pool_allocator::release): Use memory_block_pool.
	(pool_allocator::allocate): Likewise.
	* asan.c (asan_mem_ref_pool): Adjust to use common block size in all
	object pools.
	* cfg.c (initialize_original_copy_tables): Likewise.
	* cselib.c (elt_list_pool, elt_loc_list_pool,
	cselib_val_pool): Likewise.
	* df-problems.c (df_chain_alloc): Likewise.
	* df-scan.c (df_scan_alloc): Likewise.
	* dse.c (cse_store_info_pool, rtx_store_info_pool,
	read_info_type_pool, insn_info_type_pool, bb_info_pool,
	group_info_pool, deferred_change_pool): Likewise.
	* et-forest.c (et_nodes, et_occurrences): Likewise.
	* ipa-cp.c (ipcp_cst_values_pool, ipcp_sources_pool,
	ipcp_agg_lattice_pool): Likewise.
	* ipa-inline-analysis.c (edge_predicate_pool): Likewise.
	* ipa-profile.c (histogram_pool): Likewise.
	* ipa-prop.c (ipa_refdesc_pool): Likewise.
	* ira-build.c (live_range_pool, allocno_pool, object_pool,
	initiate_cost_vectors, pref_pool, copy_pool): Likewise.
	* ira-color.c (update_cost_record_pool): Likewise.
	* lra-lives.c (lra_live_range_pool): Likewise.
	* lra.c (lra_insn_reg_pool, lra_copy_pool): Likewise.
	* memory-block.cc: New file.
	* memory-block.h: New file.
	* regcprop.c (queued_debug_insn_change_pool): Use common block size.
	* sched-deps.c (sched_deps_init): Likewise.
	* sel-sched-ir.c (sched_lists_pool): Likewise.
	* stmt.c (expand_case, expand_sjlj_dispatch_table): Likewise.
	* tree-sra.c (access_pool): Likewise.
	* tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Likewise.
	* tree-ssa-pre.c (pre_expr_pool, bitmap_set_pool): Likewise.
	* tree-ssa-reassoc.c (operand_entry_pool): Likewise.
	* tree-ssa-sccvn.c (allocate_vn_table): Likewise.
	* tree-ssa-strlen.c (strinfo_pool): Likewise.
	* tree-ssa-structalias.c (variable_info_pool): Likewise.
	* var-tracking.c (attrs_def_pool, var_pool, valvar_pool,
	location_chain_pool, shared_hash_pool, loc_exp_dep_pool): Likewise.

gcc/c-family/
	* c-format.c (check_format_arg): Adjust to use common block size in all
	object pools.

From-SVN: r227817
2015-09-16 00:56:54 +00:00
Martin Liska a7d1f3fedc re PR ipa/66896 (ipa-prop.c:2479 runtime error: member call on null pointer of type 'struct ipa_polymorphic_call_context')
Fix PR ipa/66896.

	* g++.dg/ipa/pr66896.c: New test.
	PR ipa/66896.
	* ipa-prop.c (update_jump_functions_after_inlining): Create properly
	dst_ctx if it does not exist.

From-SVN: r225887
2015-07-16 14:48:18 +00:00
Martin Liska fb0b291494 Add new object_allocator and clean-up allocator usage.
* c-format.c (static void check_format_info_main): Use
	object_allocator instead of pool_allocator.
	(check_format_arg): Likewise.
	(check_format_info_main): Likewise.
	* alloc-pool.h
	(object_allocator): Add new class.
	(pool_allocator::initialize): Use the underlying class.
	(pool_allocator::allocate): Likewise.
	(pool_allocator::remove): Likewise.
	(operator new): A new generic allocator.
	* asan.c (struct asan_mem_ref): Remove unused members.
	(asan_mem_ref_new): Replace new operator with
	object_allocator::allocate.
	(free_mem_ref_resources): Change deallocation.
	* cfg.c (initialize_original_copy_tables): Replace pool_allocator
	with object_allocator.
	* config/sh/sh.c (add_constant): Replace new operator with
	object_allocator::allocate.
	(sh_reorg): Change call to a release method.
	* cselib.c (struct elt_list): Remove unused members.
	(new_elt_list): Replace new operator with
	object_allocator::allocate.
	(new_elt_loc_list): Likewise.
	(new_cselib_val): Likewise.
	(unchain_one_elt_list): Change delete operator with remove method.
	(unchain_one_elt_loc_list): Likewise.
	(unchain_one_value): Likewise.
	(cselib_finish): Release newly added static allocators.
	* cselib.h (struct cselib_val): Remove unused members.
	(struct elt_loc_list): Likewise.
	* df-problems.c (df_chain_alloc): Replace pool_allocator with
	object_allocator.
	* df-scan.c (struct df_scan_problem_data): Likewise.
	(df_scan_alloc): Likewise.
	* df.h (struct dataflow): Likewise.
	* dse.c (struct read_info_type): Likewise.
	(struct insn_info_type): Likewise.
	(struct dse_bb_info_type): Likewise.
	(struct group_info): Likewise.
	(struct deferred_change): Likewise.
	(get_group_info): Likewise.
	(delete_dead_store_insn): Likewise.
	(free_read_records): Likewise.
	(replace_read): Likewise.
	(check_mem_read_rtx): Likewise.
	(scan_insn): Likewise.
	(dse_step1): Likewise.
	(dse_step7): Likewise.
	* et-forest.c (struct et_occ): Remove unused members.
	(et_new_occ): Use allocate instead of new operator.
	(et_new_tree): Likewise.
	(et_free_tree): Call release method explicitly.
	(et_free_tree_force): Likewise.
	(et_free_pools): Likewise.
	(et_split): Use remove instead of delete operator.
	* et-forest.h (struct et_node): Remove unused members.
	* ipa-cp.c: Change pool_allocator to object_allocator.
	* ipa-inline-analysis.c: Likewise.
	* ipa-profile.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-prop.h: Likewise.
	* ira-build.c (initiate_cost_vectors): Cast return value.
	(ira_allocate_cost_vector): Likewise.
	* ira-color.c (struct update_cost_record): Remove unused members.
	* lra-int.h (struct lra_live_range): Likewise.
	(struct lra_copy): Likewise.
	(struct lra_insn_reg): Likewise.
	* lra-lives.c (lra_live_ranges_finish): Release new static allocator.
	* lra.c (new_insn_reg): Replace new operator with allocate method.
	(free_insn_regs): Same for operator delete.
	(finish_insn_regs): Release new static allocator.
	(finish_insn_recog_data): Likewise.
	(lra_free_copies): Replace delete operator with remove method.
	(lra_create_copy): Replace operator new with allocate method.
	(invalidate_insn_data_regno_info): Same for remove method.
	* regcprop.c (struct queued_debug_insn_change): Remove unused members.
	(free_debug_insn_changes): Replace delete operator with remove method.
	(replace_oldest_value_reg): Replace operator new with allocate method.
	(pass_cprop_hardreg::execute): Release new static variable.
	* sched-deps.c (sched_deps_init): Change pool_allocator to
	object_allocator.
	* sel-sched-ir.c: Likewise.
	* sel-sched-ir.h: Likewise.
	* stmt.c (expand_case): Likewise.
	(expand_sjlj_dispatch_table): Likewise.
	* tree-sra.c (struct access): Remove unused members.
	(struct assign_link): Likewise.
	(sra_deinitialize): Release newly added static pools.
	(create_access_1):Replace operator new with allocate method.
	(build_accesses_from_assign): Likewise.
	(create_artificial_child_access): Likewise.
	* tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Change
	pool_allocator to object_allocator.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c (allocate_vn_table): Likewise.
	* tree-ssa-strlen.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* var-tracking.c (onepart_pool_allocate): New function.
	(unshare_variable): Use the newly added function.
	(variable_merge_over_cur): Likewise.
	(variable_from_dropped): Likewise.
	(variable_was_changed): Likewise.
	(set_slot_part): Likewise.
	(emit_notes_for_differences_1): Likewise.
	(vt_finalize): Release newly added static pools.

From-SVN: r225869
2015-07-16 11:26:05 +00:00
Martin Jambor 56b4006243 Give struct param_aa_atatus and struct func_body_info an ipa_ prefix.
2015-07-16  Martin Jambor  <mjambor@suse.cz>

	* ipa-prop.h (param_aa_status): Rename to ipa_param_aa_status.  Adjust
	all uses.  Fix two typos in its general comment.
	(func_body_info): Rename to ipa_func_body_info.  Adjust all uses.

From-SVN: r225867
2015-07-16 11:48:20 +02:00
Andrew MacLeod 48d859bb42 gimple-pretty-print.h: Don't include pretty-print.h.
* gimple-pretty-print.h: Don't include pretty-print.h.
	* tree-streamer.h: Don't include lto-streamer.h.
	* gimple-streamer.h: Include tree-streamer.h rather than lto-streamer.h.
	* gimple-streamer-in.c: Remove redundant includes.
	* gimple-streamer-out.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-icf.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* ipa-polymorphic-call.c: Likewise.
	* ipa-profile.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* tree-streamer-in.c: Likewise.
	* tree-streamer-out.c: Likewise.
	* tree-streamer.c: Likewise.
	* lto/lto.c: Remove redundant includes.

From-SVN: r225847
2015-07-15 19:57:03 +00:00
Paolo Bonzini ff302741f1 Limit AA walking when inlining analysis examines parameters
2015-07-15  Paolo Bonzini  <bonzini@gnu.org>
	    Martin Jambor  <mjambor@suse.cz>

	* ipa-inline-analysis.c (unmodified_parm_or_parm_agg_item): Accept
	struct func_body_info* instead of struct ipa_node_params*, expecting
	fbi->info to be filled in.  Replace throughout.  Adjust call to
	ipa_load_from_parm_agg.
	(set_cond_stmt_execution_predicate): Accept struct func_body_info*
	instead of struct ipa_node_params*.  Adjust calls to other functions
	so that they pass either fbi or fbi->info.
	(set_switch_stmt_execution_predicate): Likewise.
	(will_be_nonconstant_predicate): Likewise.
	(compute_bb_predicates): Likewise.
	(estimate_function_body_sizes): Move asserts earlier.  Fill in
	struct func_body_info, replace parms_info with fbi.info.  Adjust
	calls to functions that now accept struct func_body_info.
	* ipa-prop.c (param_aa_status, struct ipa_bb_info): Move to ipa-prop.h.
	(struct func_body_info): Likewise.
	(ipa_load_from_parm_agg_1): Rename to ipa_load_from_parm_agg,
	remove static.  Adjust callers.
	(ipa_load_from_parm_agg): Remove.
	* ipa-prop.h (param_aa_status, ipa_bb_info): Move from ipa-prop.c.
	(func_body_info): Likewise.
	(ipa_load_from_parm_agg): Adjust prototype.


Co-Authored-By: Martin Jambor <mjambor@suse.cz>

From-SVN: r225838
2015-07-15 17:58:43 +02:00