aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
AgeCommit message (Collapse)AuthorFilesLines
2011-07-08tree-sra.c (analyze_all_variable_accesses): Dump that a struture is too big ↵Martin Jambor1-6/+14
for total scalarization. 2011-07-08 Martin Jambor <mjambor@suse.cz> * tree-sra.c (analyze_all_variable_accesses): Dump that a struture is too big for total scalarization. From-SVN: r176033
2011-07-01tree-sra.c (tree_non_mode_aligned_mem_p): Also ignore MEM_REFs.Martin Jambor1-0/+1
2011-07-01 Martin Jambor <mjambor@suse.cz> * tree-sra.c (tree_non_mode_aligned_mem_p): Also ignore MEM_REFs. From-SVN: r175760
2011-06-30tree-sra.c (struct access): Rename total_scalarization to ↵Martin Jambor1-25/+51
grp_total_scalarization 2011-06-30 Martin Jambor <mjambor@suse.cz> * tree-sra.c (struct access): Rename total_scalarization to grp_total_scalarization (completely_scalarize_var): New function. (sort_and_splice_var_accesses): Set total_scalarization in the representative access. (analyze_access_subtree): Propagate total scalarization accross the tree, no holes in totally scalarized trees, simplify coverage computation. (analyze_all_variable_accesses): Call completely_scalarize_var instead of completely_scalarize_record. * testsuite/gcc.dg/tree-ssa/sra-12.c: New test. From-SVN: r175733
2011-06-30re PR tree-optimization/49094 (ARM aligned(1) attribute is sometimes dropped)Martin Jambor1-1/+25
2011-06-30 Martin Jambor <mjambor@suse.cz> PR tree-optimization/49094 * tree-sra.c (tree_non_mode_aligned_mem_p): New function. (build_accesses_from_assign): Use it. * testsuite/gcc.dg/tree-ssa/pr49094.c: New test. From-SVN: r175703
2011-06-24re PR tree-optimization/49516 (SRA generates memory references into its ↵Martin Jambor1-1/+2
replacements) 2011-06-24 Martin Jambor <mjambor@suse.cz> PR tree-optimizations/49516 * tree-sra.c (sra_modify_assign): Choose the safe path for aggregate copies if we also did scalar replacements. * testsuite/g++.dg/tree-ssa/pr49516.C: New test. From-SVN: r175376
2011-06-24Improve dump files for SRA early candidate check v2Andi Kleen1-22/+95
v2: Include message improvements from Eric Botcazou gcc/: 2011-06-24 Andi Kleen <ak@linux.intel.com> * tree-sra.c (type_internals_preclude_sra_p): Add msg parameter. Split up ifs and report reason in *msg. (reject): Add. (find_var_candiate): Add msg variable. Split up ifs and report reason to reject. (find_param_candidates): Add msg variable. Pass msg to type_internals_preclude_sra_p. From-SVN: r175370
2011-06-22re PR debug/47858 (IPA-SRA decreases quality of debug info)Jakub Jelinek1-11/+70
PR debug/47858 * gimple.h (enum gimple_debug_subcode): Add GIMPLE_DEBUG_SOURCE_BIND. (gimple_build_debug_source_bind_stat): New prototype. (gimple_build_debug_source_bind): Define. (gimple_debug_source_bind_p, gimple_debug_source_bind_get_var, gimple_debug_source_bind_get_value, gimple_debug_source_bind_get_value_ptr, gimple_debug_source_bind_set_var, gimple_debug_source_bind_set_value): New inlines. * gimple.c (gimple_build_debug_source_bind_stat): New function. * gimple-pretty-print.c (dump_gimple_debug): Handle GIMPLE_DEBUG_SOURCE_BIND. * sese.c (rename_uses): Handle gimple_debug_source_bind_p. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. * tree-parloops.c (eliminate_local_variables, separate_decls_in_region): Likewise. (separate_decls_in_region_debug): Renamed from separate_decls_in_region_debug_bind. Handle gimple_debug_source_bind_p. * tree.h (decl_debug_args_lookup, decl_debug_args_insert): New prototypes. (DECL_HAS_DEBUG_ARGS_P): Define. (struct tree_function_decl): Add has_debug_args_flag field. * tree.c (debug_args_for_decl): New variable. (decl_debug_args_lookup, decl_debug_args_insert): New functions. * tree-into-ssa.c (mark_def_sites): Handle uses in debug stmts. (rewrite_debug_stmt_uses): New function. (rewrite_stmt): Use it to rewrite debug stmt uses. * rtl.def (DEBUG_PARAMETER_REF): New. * rtl.h (DEBUG_PARAMETER_REF_DECL): Define. * cselib.c (rtx_equal_for_cselib_1, cselib_hash_rtx): Handle DEBUG_PARAMETER_REF. * rtl.c (rtx_equal_p_cb, rtx_equal_p, iterative_hash_rtx): Likewise. * print-rtl.c (print_rtx): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Prefer replacing of SSA_NAMEs with DEBUG_EXPR_DECLs initialized in source bind debug stmts in the first bb. * tree-inline.c (remap_ssa_name): If remapping default def of a PARM_DECL fails, map to a DEBUG_EXPR_DECL set in a source bind debug stmt. (remap_gimple_stmt): Handle gimple_debug_source_bind_p. (maybe_move_debug_stmts_to_successors): Likewise. (copy_debug_stmt): Likewise. Avoid shadowing a variable. (tree_function_versioning): If DECL_HAS_DEBUG_ARGS_P, copy debug args vector from old_decl to new_decl. * ipa-prop.c (ipa_modify_call_arguments): For optimized away or modified parameters, add debug bind stmts before call setting DEBUG_EXPR_DECL which is remembered in debug args vector. * cfgexpand.c (expand_call_stmt): Call expand_debug_expr on DECL_DEBUG_EXPRs from debug args vector. (expand_debug_source_expr): New function. (expand_debug_locations): Use it for source bind insns. (expand_gimple_basic_block): Handle gimple_debug_source_bind_p. * var-tracking.c (prepare_call_arguments): Add debug args to call_arguments if any. * dwarf2out.c (dwarf_stack_op_name, size_of_loc_descr, output_loc_operands, output_loc_operands_raw, resolve_addr_in_expr, compare_loc_operands): Handle DW_OP_GNU_parameter_ref. (get_ref_die_offset, parameter_ref_descriptor): New functions. (mem_loc_descriptor): Handle DEBUG_PARAMETER_REF. (gen_subprogram_die): Handle parameters identified by DEBUG_PARAMETER_REF. * dwarf2.h (enum dwarf_location_atom): Add DW_OP_GNU_parameter_ref. From-SVN: r175288
2011-06-18tree-sra.c (type_internals_preclude_sra_p): Return true if the element type ↵Eric Botcazou1-6/+8
is volatile. * tree-sra.c (type_internals_preclude_sra_p) <ARRAY_TYPE>: Return true if the element type is volatile. ada/ * gcc-interface/decl.c (gnat_to_gnu_component_type): Use GNAT_TYPE local variable throughout. Remove useless call to Base_Type. (gnat_to_gnu_field): Use GNAT_FIELD_TYPE local variable throughout. Take it also into account for the volatileness of the field. Set the TREE_SIDE_EFFECTS flag as well in this case. Reorder some warnings. From-SVN: r175176
2011-06-16re PR tree-optimization/49343 (ICE on field with variable offset)Martin Jambor1-4/+8
2011-06-16 Martin Jambor <mjambor@suse.cz> PR tree-optimization/49343 * tree-sra.c (build_ref_for_model): Use component_ref_field_offset to calculate offset, provide 2nd operand for the new COMPONENT_REF. * testsuite/gnat.dg/discr31.adb: New test. * testsuite/gnat.dg/discr31.ads: Likewise. From-SVN: r175111
2011-06-14dumping cleanup phase 1 -- Removing TODO_dump_funcDavid Li1-7/+3
From-SVN: r175051
2011-06-10tree-sra.c (all_callers_have_enough_arguments_p): Rename to ...Jan Hubicka1-23/+29
* tree-sra.c (all_callers_have_enough_arguments_p): Rename to ... (not_all_callers_have_enough_arguments_p): ... this one; turn into worker for cgraph_for_node_and_aliases. (convert_callers_for_node): Break out from ... (convert_callers): ... here. (modify_function): Use collect_callers_of_node. (ipa_early_sra): Use cgraph_for_node_and_aliases. From-SVN: r174904
2011-06-08tree-sra.c (mark_rw_status): Removed.Martin Jambor1-31/+14
2011-06-08 Martin Jambor <mjambor@suse.cz> * tree-sra.c (mark_rw_status): Removed. (analyze_access_subtree): New parameter parent instead of mark_read and mark_write, propagate from that. From-SVN: r174806
2011-05-04tree.h (int_const_binop): Remove notrunc argument.Richard Guenther1-2/+2
2011-05-04 Richard Guenther <rguenther@suse.de> * tree.h (int_const_binop): Remove notrunc argument. * fold-const.c (int_const_binop): Remove notrunc argument. Always create integer constants that are properly truncated. (extract_muldiv_1): Expand one notrunc int_const_binop caller. (const_binop): Remove zero notrunc argument to int_const_binop. (size_binop_loc): Likewise. (fold_div_compare): Likewise. (maybe_canonicalize_comparison_1): Likewise. (fold_comparison): Likewise. (fold_binary_loc): Likewise. (multiple_of_p): Likewise. * expr.c (store_constructor): Likewise. * gimple-fold.c (maybe_fold_offset_to_array_ref): Likewise. (maybe_fold_stmt_addition): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * stor-layout.c (layout_type): Likewise. * tree-data-ref.c (tree_fold_divides_p): Likewise. * tree-sra.c (build_ref_for_offset): Likewise. (build_user_friendly_ref_for_offset): Likewise. * tree-ssa-address.c (maybe_fold_tmr): Likewise. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Likewise. * tree-ssa-loop-niter.c (inverse): Likewise. * tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise. * tree-ssa.c (maybe_rewrite_mem_ref_base): Likewise. * tree-switch-conversion.c (check_range): Likewise. (build_constructors): Likewise. * tree-vect-generic.c (expand_vector_piecewise): Likewise. * tree-vrp.c (set_and_canonicalize_value_range): Likewise. (extract_range_from_assert): Likewise. (vrp_int_const_binop): Likewise. (extract_range_from_binary_expr): Likewise. (extract_range_from_unary_expr): Likewise. (check_array_ref): Likewise. (find_case_label_range): Likewise. (simplify_div_or_mod_using_ranges): Likewise. * tree-cfg.c (group_case_labels_stmt): Use double-ints for comparing case labels for merging. ada/ * gcc-interface/trans.c (gnat_to_gnu): Remove zero notrunc argument to int_const_binop. (pos_to_constructor): Likewise. fortran/ * trans-types.c (gfc_get_array_type_bounds): Remove zero notrunc argument to int_const_binop. From-SVN: r173356
2011-04-22gengtype.c (open_base_files): Add ipa-inline.h include.Jan Hubicka1-1/+1
* gengtype.c (open_base_files): Add ipa-inline.h include. * ipa-cp.c (ipcp_get_lattice, ipcp_lattice_from_jfunc): Move to ipa-prop.c update all uses. * ipa-prop.c: (ipa_get_lattice, ipa_lattice_from_jfunc): ... here. * ipa-inline-transform.c (inline_call): Use inline_merge_summary to merge summary of inlined function into former caller. * ipa-inline.c (max_benefit): Remove. (edge_badness): Compensate for removal of benefits. (update_caller_keys): Use reset_node_growth_cache/reset_edge_growth_cache. (update_callee_keys): Likewise. (update_all_callee_keys): Likewise. (inline_small_functions): Do not collect max_benefit; do not reset stimated_growth; call free_growth_caches and initialize_growth_caches. * ipa-inline.h (struct condition, type clause_t, struct predicate, struct size_time_entry): New structures. (INLINE_SIZE_SCALE, INLINE_TIME_SCALE, MAX_CLAUSES): New constants. (inline_summary): Remove size_inlining_benefit, time_inlining_benefit and estimated_growth. (edge_growth_cache_entry): New structure. (node_growth_cache, edge_growth_cache): New global vars. (estimate_growth): Turn into inline. (inline_merge_summary, do_estimate_edge_growth, do_estimate_edge_time, initialize_growth_caches, free_growth_caches): Declare. (estimate_edge_growth): Rewrite. (estimate_edge_time): Implement as inline cache lookup. (reset_node_growth_cache, reset_edge_growth_cache): New inline functions. (MAX_TIME): Reduce to allow multiplicatoin by INLINE_SIZE_SCALE. (NUM_CONDITIONS): New constant. (predicate_conditions): New enum. (IS_NOT_CONSTANT): New constant. (edge_removal_hook_holder): New var. (node_growth_cache, edge_growth_cache): New global vars. (true_predicate, single_cond_predicate, false_predicate, not_inlined_predicate, add_condition, add_clause, and_predicates, or_predicates, predicates_equal_p, evaulate_predicate, dump_condition, dump_clause, dump_predicate, account_size_time, evaulate_conditions_for_edge): New functions. (inline_summary_alloc): Move to heap. (inline_node_removal_hook): Clear condition and entry vectors. (inline_edge_removal_hook): New function. (initialize_growth_caches, free_growth_caches): New function. (dump_inline_summary): Update. (edge_execution_predicate): New function. (will_be_nonconstant_predicate): New function. (estimate_function_body_sizes): Compute BB and constantness predicates. (compute_inline_parameters): Do not clear estimated_growth. (estimate_edge_size_and_time): New function. (estimate_calls_size_and_time): New function. (estimate_callee_size_and_time): New function. (remap_predicate): New function. (inline_merge_summary): New function. (do_estimate_edge_time): New function based on... (estimate_edge_time): ... this one. (do_estimate_edge_growth): New function. (do_estimate_growth): New function based on.... (estimate_growth): ... this one. (inline_analyze_function): Analyze after deciding on jump functions. (inline_read_section): New function. (inline_read_summary): Use it. (inline_write_summary): Write all the new data. * ipa-prop.c (ipa_get_param_decl_index): Export. (ipa_lattice_from_jfunc): Move here from ipa-cp.c * ipa-prop.h (ipa_get_param_decl_index, ipa_lattice_from_jfunc): Declare. (ipa_get_lattice): Move hre from ipa-cp.c * Makefile.in (GTFILES): Add ipa-inline.h and ipa-inline-analysis.c * params.def (PARAM_EARLY_INLINING_INSNS): Set to 11. * cgraph.h (cgraph_clone_inlined_nodes, compute_inline_parameters, cgraph_edge_inlinable_p): Remove. * cgraphunit.c: Include ipainline.h (cgraph_process_new_functions): Update call of compute_inline_parameters. * gcc.dg/tree-ssa/pr38699.c: Fix testcase. From-SVN: r172873
2011-04-16cgraphbuild.c: Include ipa-inline.h.Jan Hubicka1-1/+2
* cgraphbuild.c: Include ipa-inline.h. (reset_inline_failed): Use initialize_inline_failed. * cgraph.c: Include ipa-inline.h. (cgraph_create_node_1): Do not initialize estimated_growth. (initialize_inline_failed): More to ipa-inline-analysis.c (dump_cgraph_node): Do not dump inline flags. * cgraph.h (cgraph_local_info): Remove inlineable, versionable and disregard_inline_limits flags. (cgrpah_global_info): Remove estimated_stack_size, stack_frame_offset, time, size, estimated_growth. * ipa-cp.c (ipcp_versionable_function_p, ipcp_generate_summary): Update. * cgraphunit.c (cgraph_decide_is_function_needed): Use DECL_DISREGARD_INLINE_LIMITS. (cgraph_analyze_function): Do not initialize node->local.disregard_inline_limits. * lto-cgraph.c (lto_output_node, input_overwrite_node): Do not stream inlinable, versionable and disregard_inline_limits. * ipa-inline.c (cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_edge_badness, update_caller_keys, update_callee_keys, add_new_edges_to_heap): Update. (cgraph_decide_inlining_of_small_function): Update; set CIF_FUNCTION_NOT_INLINABLE for uninlinable functions. (cgraph_decide_inlining, cgraph_edge_early_inlinable_p, cgraph_decide_inlining_incrementally): Update. * ipa-inline.h (inline_summary): Add inlinable, versionable, disregard_inline_limits, estimated_stack_size, stack_frame_offset, time, size and estimated_growth parameters. (estimate_edge_growth): Update. (initialize_inline_failed): Declare. * ipa-split.c: Include ipa-inline.h (execute_split_functions): Update. * ipa.c (cgraph_postorder): Use DECL_DISREGARD_INLINE_LIMITS. (cgraph_remove_unreachable_nodes): Do not clear inlinable flag. (record_cdtor_fn): Use DECL_DISREGARD_INLINE_LIMITS. * ipa-inline-analysis.c (inline_node_removal_hook): Update; set estimated_growth to INT_MIN. (inline_node_duplication_hook): Likewise. (dump_inline_summary): Dump new fields. (compute_inline_parameters): Update. (estimate_edge_time, estimate_time_after_inlining, estimate_size_after_inlining, estimate_growth, inline_read_summary, inline_write_summary): (initialize_inline_failed): Move here from cgraph.c. * tree-sra.c: Include ipa-inline.h. (ipa_sra_preliminary_function_checks): Update. * lto/lto.c (lto_balanced_map): Update. Update. * Makefile.in: (cgraph.o, cgraphbuild.o): Add dependency on ipa-inline.h From-SVN: r172581
2011-04-11except.c (set_nothrow_function_flags): Call cgraph_get_node instead of ↵Martin Jambor1-1/+1
cgraph_node. 2011-04-11 Martin Jambor <mjambor@suse.cz> * except.c (set_nothrow_function_flags): Call cgraph_get_node instead of cgraph_node. * final.c (rest_of_clean_state): Likewise. * gimple-iterator.c (update_call_edge_frequencies): Likewise. * passes.c (pass_init_dump_file): Likewise. (execute_all_ipa_transforms): Likewise. (function_called_by_processed_nodes_p): Likewise. * predict.c (maybe_hot_frequency_p): Likewise. (probably_never_executed_bb_p): Likewise. (compute_function_frequency): Likewise. * tree-nested.c (check_for_nested_with_variably_modified): Likewise. (unnest_nesting_tree_1): Likewise. (lower_nested_functions): Likewise. * tree-optimize.c (execute_fixup_cfg): Likewise. (tree_rest_of_compilation): Likewise. * tree-profile.c (gimple_gen_ic_func_profiler): Likewise. * tree-sra.c (ipa_early_sra): Likewise. * tree-ssa-loop-ivopts.c (computation_cost): Likewise. * config/i386/i386.c (ix86_compute_frame_layout): Likewise. * ipa.c (record_cdtor_fn): Likewise. * ipa-inline.c (cgraph_early_inlining): Likewise. (compute_inline_parameters_for_current): Likewise. * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise. * ipa-pure-const.c (local_pure_const): Likewise. * ipa-split.c (split_function): Likewise. (execute_split_functions): Likewise. * cgraphbuild.c (build_cgraph_edges): Likewise. (rebuild_cgraph_edges): Likewise. (cgraph_rebuild_references): Likewise. (remove_cgraph_callee_edges): Likewise. * cgraphunit.c (cgraph_mark_if_needed): Likewise. (verify_cgraph_node): Likewise. (cgraph_analyze_functions): Likewise. (cgraph_preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (save_inline_function_body): Likewise. * tree-inline.c (copy_bb): Likewise. (optimize_inline_calls): Likewise. From-SVN: r172257
2011-03-24tree-sra.c (build_ref_for_offset): Strip useless type conversions from the ↵Eric Botcazou1-0/+1
address built for a reference with... * tree-sra.c (build_ref_for_offset): Strip useless type conversions from the address built for a reference with variable offset. From-SVN: r171393
2011-02-17re PR debug/47106 (-fcompare-debug failure (length) with -fpartial-inlining ↵Alexandre Oliva1-1/+2
-flto -fconserve-stack) PR debug/47106 PR debug/47402 * cfgexpand.c (account_used_vars_for_block): Remove. (estimated_stack_frame_size): Use referenced vars. * tree-inline.c (remap_decl): Only mark VAR_DECLs as referenced that were referenced in the original function. Test src_fn rather than cfun. Drop redundant get_var_ann. (setup_one_parameter): Drop redundant get_var_ann. (declare_return_variable): Likewise. (copy_decl_for_dup_finish): Mark VAR_DECLs referenced in src_fn. (copy_arguments_for_versioning): Drop redundant get_var_ann. * ipa-inline.c (compute_inline_parameters): Do not compute disregard_inline_limits here. are not available. (compute_inlinable_for_current, pass_inlinable): New. (pass_inline_parameters): Require PROP_referenced_vars. * cgraphunit.c (cgraph_process_new_functions): Don't run compute_inline_parameters explicitly unless function is in SSA form. (cgraph_analyze_function): Set .disregard_inline_limits. * tree-sra.c (convert_callers): Compute inliner parameters only for functions already in SSA form. * g++.dg/debug/pr47106.C: New. Co-Authored-By: Jan Hubicka <jh@suse.cz> From-SVN: r170249
2011-02-15re PR debug/47106 (-fcompare-debug failure (length) with -fpartial-inlining ↵Alexandre Oliva1-1/+1
-flto -fconserve-stack) PR debug/47106 PR debug/47402 * tree-flow.h (FOR_EACH_REFERENCED_VAR): Add FN argument. Adjust all users. Pass FN to... * tree-flow-inline.h (first_referenced_var): ... this. Add fn argument. * ipa-struct-reorg.c: Adjust. * tree-dfa.c: Adjust. * tree-into-ssa.c: Adjust. * tree-sra.c: Adjust. * tree-ssa-alias.c: Adjust. * tree-ssa-live.c: Adjust. * tree-ssa.c: Adjust. * tree-ssanames.c: Adjust. * tree-tailcall.c: Adjust. From-SVN: r170186
2011-02-09re PR middle-end/45505 (gfortran.dg/pr25923.f90)Martin Jambor1-21/+43
2011-02-09 Martin Jambor <mjambor@suse.cz> PR middle-end/45505 * tree-sra.c (struct access): New flags grp_scalar_read and grp_scalar_write. Changed description of assignment read and write flags. (dump_access): Dump new flags, reorder all of them. (sort_and_splice_var_accesses): Set the new flag accordingly, use them to detect multiple scalar reads. (analyze_access_subtree): Use the new scalar read write flags instead of the old flags. Adjusted comments. * testsuite/gfortran.dg/pr25923.f90: Remove xfails. From-SVN: r169964
2011-01-27re PR tree-optimization/47228 (wrong code with loop)Martin Jambor1-4/+2
2011-01-27 Martin Jambor <mjambor@suse.cz> PR tree-optimization/47228 * tree-sra.c (sra_modify_assign): Use build_ref_for_model instead of build_ref_for_offset. * testsuite/gcc.dg/torture/pr47228.c: New test. From-SVN: r169331
2011-01-26re PR tree-optimization/47237 (builtin_apply_args broken WRT local ABI changes.)Jan Hubicka1-0/+7
PR target/47237 * cgraph.h (cgraph_local_info): New field can_change_signature. * ipa-cp.c (ipcp_update_callgraph): Only compute args_to_skip if callee signature can change. (ipcp_estimate_growth): Call sequence simplify only if calle signature can change. (ipcp_insert_stage): Only compute args_to_skip if signature can change. (cgraph_function_versioning): We can not change signature of functions that don't allow that. * lto-cgraph.c (lto_output_node): Stream local.can_change_signature. (lto_input_node): Likewise. * ipa-inline.c (compute_inline_parameters): Compute local.can_change_signature. * ipa-split.c (visit_bb): Never split away APPLY_ARGS. * tree-sra.c (ipa_sra_preliminary_function_checks): Give up on functions that can not change signature. * i386.c (ix86_function_regparm, ix86_function_sseregparm, init_cumulative_args): Do not use local calling conventions for functions that can not change signature. From-SVN: r169290
2011-01-05re PR tree-optimization/47005 (ACATS c62002a is miscompiled at -O2)Eric Botcazou1-1/+13
PR tree-optimization/47005 * tree-sra.c (struct access): Add 'non_addressable' bit. (create_access): Set it for a DECL_NONADDRESSABLE_P field. (decide_one_param_reduction): Return 0 if the parameter is passed by reference and one of the accesses in the group is non_addressable. From-SVN: r168508
2011-01-03re PR tree-optimization/46801 (FAIL: gnat.dg/pack9.adb scan-tree-dump-not ↵Martin Jambor1-1/+2
optimized "gnat_rcheck") 2011-01-03 Martin Jambor <mjambor@suse.cz> PR tree-optimization/46801 * tree-sra.c (type_internals_preclude_sra_p): Check whether aggregate fields start at byte boundary instead of the bit-field flag. * testsuite/gnat.dg/pack9.adb: Remove xfail. From-SVN: r168431
2010-12-09ipa-prop.h (struct ipa_parm_adjustment): New field alias_ptr_type.Martin Jambor1-1/+5
2010-12-09 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_parm_adjustment): New field alias_ptr_type. * ipa-prop.c (ipa_modify_call_arguments): Use it. * tree-sra.c (splice_param_accesses): Test that all accesses have the same alias reference type. (turn_representatives_into_adjustments): Set alias_ptr_type of the adjustment. From-SVN: r167641
2010-12-09re PR middle-end/46734 (ICE in create_tmp_var, at gimplify.c:505)Martin Jambor1-1/+4
2010-12-09 Martin Jambor <mjambor@suse.cz> PR middle-end/46734 * tree-sra.c (splice_param_accesses): Check that there are not multiple ADDRESSABLE types. * testsuite/g++.dg/tree-ssa/pr46734.C: New test. From-SVN: r167639
2010-11-30diagnostic-core.h: Include bversion.h.Joseph Myers1-1/+0
* diagnostic-core.h: Include bversion.h. * toplev.h: Don't include input.h or bversion.h. (parse_optimize_options): Don't declare here. * alias.c, auto-inc-dec.c, c-aux-info.c, c-convert.c, c-parser.c, caller-save.c, cfg.c, cfganal.c, cfgbuild.c, cfgcleanup.c, combine-stack-adj.c, config/arm/pe.c, config/darwin-c.c, config/host-darwin.c, config/i386/host-cygwin.c, config/i386/host-mingw32.c, config/i386/msformat-c.c, config/i386/netware.c, config/i386/nwld.c, config/i386/winnt-cxx.c, config/i386/winnt-stubs.c, config/ia64/ia64-c.c, config/m32c/m32c-pragma.c, config/mep/mep-pragma.c, config/microblaze/microblaze-c.c, config/rs6000/host-darwin.c, config/rs6000/rs6000-c.c, config/score/score3.c, config/score/score7.c, config/sh/symbian-base.c, config/sh/symbian-c.c, config/sh/symbian-cxx.c, config/sol2-c.c, config/sol2.c, config/v850/v850-c.c, config/vxworks.c, convert.c, cppbuiltin.c, cselib.c, dbgcnt.c, ddg.c, dfp.c, dominance.c, emit-rtl.c, fixed-value.c, fwprop.c, ggc-common.c, gimple.c, gimplify.c, graphite-blocking.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-flattening.c, graphite-interchange.c, graphite-poly.c, graphite-scop-detection.c, graphite.c, haifa-sched.c, implicit-zee.c, integrate.c, ipa-pure-const.c, ipa-reference.c, ira-build.c, ira-conflicts.c, ira-costs.c, ira-lives.c, jump.c, lists.c, loop-doloop.c, loop-iv.c, lto-cgraph.c, lto-compress.c, lto-opts.c, lto-section-in.c, lto-section-out.c, lto-streamer-out.c, lto-symtab.c, modulo-sched.c, optabs.c, params.c, postreload-gcse.c, postreload.c, predict.c, profile.c, regcprop.c, reginfo.c, regmove.c, reorg.c, resource.c, sched-deps.c, sched-ebb.c, sched-rgn.c, sdbout.c, sel-sched-dump.c, sel-sched-ir.c, sese.c, stmt.c, targhooks.c, tree-cfgcleanup.c, tree-mudflap.c, tree-nomudflap.c, tree-object-size.c, tree-outof-ssa.c, tree-phinodes.c, tree-profile.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-live.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-operands.c, tree-ssa-structalias.c, tree-ssa-uninit.c, tree-vect-patterns.c, value-prof.c, var-tracking.c, web.c: Don't include toplev.h. * Makefile.in (TOPLEV_H): Remove. All uses changed to use toplev.h. Dependencies for above files and c-family files changed to remove $(TOPLEV_H) or toplev.h. (C_TREE_H): Don't include $(TOPLEV_H). (DIAGNOSTIC_CORE_H): Use $(INPUT_H) instead of input.h. Add bversion.h. * config/arm/t-pe, config/arm/t-wince-pe, config/i386/t-cygming, config/ia64/t-ia64, config/mep/t-mep, config/score/t-score-elf, config/t-darwin, config/t-sol2, config/t-vxworks, config/v850/t-v850, config/v850/t-v850e: Dependencies for above files changed to remove $(TOPLEV_H) or toplev.h. c-family: * c-common.h (parse_optimize_options): Declare. * c-cppbuiltin.c, c-format.c, c-gimplify.c, c-lex.c, c-omp.c, c-pch.c, c-pragma.c, c-semantics.c: Don't include toplev.h. cp: * cp-gimplify.c, cp-lang.c, cvt.c, cxx-pretty-print.c, error.c, except.c, expr.c, friend.c, init.c, mangle.c, name-lookup.c, optimize.c, parser.c, rtti.c, tree.c, typeck2.c: Don't include toplev.h. * Make-lang.in: Dependencies for above files changed to remove toplev.h. java: * expr.c, lang.c, mangle.c, mangle_name.c, typeck.c, verify-glue.c: Don't include toplev.h. * Make-lang.in: Dependencies for above files changed to remove toplev.h. lto: * Make-lang.in (lto/lto-object.o): Depend on toplev.h instead of $(TOPLEV_H). From-SVN: r167293
2010-11-15re PR tree-optimization/46349 (incorrect scalarization)Martin Jambor1-3/+39
2010-11-15 Martin Jambor <mjambor@suse.cz> PR tree-optimization/46349 * tree-sra.c (contains_bitfld_comp_ref_p): New function. (contains_vce_or_bfcref_p): Likewise. (sra_modify_assign): Use them. * testsuite/gnat.dg/opt9.adb: New file. * testsuite/gnat.dg/opt9_pkg.ads: Likewise From-SVN: r166759
2010-11-14re PR tree-optimization/45722 (FAIL: gcc.c-torture/execute/20040709-2.c ↵Eric Botcazou1-5/+2
execution at -O1 and -Os) PR tree-optimization/45722 * tree-sra.c (build_ref_for_model): Always build a COMPONENT_REF if this is a reference to a component. * ipa-prop.c (ipa_get_member_ptr_load_param): Accept COMPONENT_REF. (ipa_note_param_call): Adjust comment. From-SVN: r166731
2010-11-10re PR tree-optimization/46351 (incorrect scalarization (2))Martin Jambor1-1/+2
2010-11-10 Martin Jambor <mjambor@suse.cz> PR tree-optimization/46351 PR tree-optimization/46377 * tree-sra.c (type_internals_preclude_sra_p): Disqualify types with aggregate bit-fields. * testsuite/gnat.dg/opt10.adb: New file. * testsuite/gnat.dg/opt10_pkg.ads: Likewise. * testsuite/gnat.dg/opt11.adb: Likewise. * testsuite/gnat.dg/opt11.ads: Likewise. From-SVN: r166535
2010-11-03builtins.c (fold_builtin_signbit): Use build_zero_cst instead of fold_convert.Nathan Froyd1-3/+2
gcc/ * builtins.c (fold_builtin_signbit): Use build_zero_cst instead of fold_convert. * c-typeck.c (build_function_call_vec): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * cgraphunit.c (assemble_thunk): Likewise. * config/sparc/sparc.c (sparc_fold_builtin): Likewise. * fold-const.c (fold_unary_loc, fold_mult_zconjz): Likewise. (fold_binary_loc, fold_ternary_loc): Likewise. * gimple-fold.c (get_symbol_constant_value): Likewise. * gimple-low.c (lower_builtin_setjmp): Likewise. * gimple.c (gimple_cond_get_ops_from_tree): Likewise. * gimplify.c (gimplify_init_constructor): Likewise. * lambda.h (build_linear_expr): Likewise. * omp-low.c (omp_reduction_init): Likewise. * tree-inline.c (remap_ssa_name): Likewise. * tree-object-size.c (compute_object_sizes): Likewise. * tree-sra.c (init_subtree_with_zero): Likewise. (sra_ipa_modify_assign): Likewise. * tree-ssa-copy.c (propagate_tree_value_into_stmt): Likewise. * tree-ssa-reassoc.c (eliminate_duplicate_pair): Likewise. (eliminate_plus_minus_pair, eliminate_not_pairs): Likewise. (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_reference_lookup_3): Likewise. * tree-vect-stmts.c (vectorizable_call): Likewise. * tree.c (build_vector_from_ctor, build_one_cst): Likewise. (build_zero_cst): Handle more cases directly. Update comment. gcc/cp/ * class.c (build_base_path, add_vcall_offset): Use build_zero_cst instead of fold_convert. * init.c (build_zero_init): Likewise. * typeck.c (cp_build_binary_op): Likewise. gcc/fortran/ * trans-decl.c (add_argument_checking): Use build_zero_cst instead of fold_convert. * trans-expr.c (gfc_conv_missing_dummy, fill_with_spaces): Likewise. * trans-stmt.c (gfc_trans_do): Likewise. From-SVN: r166227
2010-10-11vec.h (VEC_qsort): Define.Nathan Froyd1-4/+2
gcc/ * vec.h (VEC_qsort): Define. * dbxout.c (output_used_types): Use it. * df-scan.c (df_sort_and_compress_refs): Likewise. (df_sort_and_compress_mws): Likewise. * genautomata.c (uniq_sort_alt_states): Likewise. (evaluate_equiv_classes): Likewise. (output_trans_table): Likewise. (output_state): Likewise. * gimplify.c (compare_case_labels): Likewise. * graphite-sese-to-poly.c (graphite_sort_dominated_info): Likewise. * ipa.c (build_cdtor_fns): Likewise. * lto.c (lto_wpa_write_files): Likewise. * sel-sched.c (fill_vec_av_set): Likewise. * tree-predcom.c (determine_roots_comp): Likewise. * tree-sra.c (sort_and_spliace_var_accesses): Likewise. (splice_param_accesses): Likewise. * tree-ssa-live.c (dump_enumerated_decls): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. (reassociate_bb): Likewise. * tree-ssa-sccvn.c (sort_scc): Likewise. * tree-ssa-structalias.c (sort_fieldstack): Likewise. gcc/ada/ * gcc-interface/utils2.c (gnat_build_constructor): Use VEC_qsort. From-SVN: r165314
2010-10-07tree-sra.c (struct access): New field grp_assignment_write.Martin Jambor1-19/+74
2010-10-07 Martin Jambor <mjambor@suse.cz> * tree-sra.c (struct access): New field grp_assignment_write. (dump_access): Dump grp_assignment_write. (build_accesses_from_assign): Set grp_assignment_write. (sort_and_splice_var_accesses): Aggregate grp_assignment_write. (mark_read_status): Renamed to mark_rw_status, individual values renamed too. (analyze_access_subtree): Changed type of mark_write to mark_read_status. Fixed propagating of mark_read and mark_write. Changed benefit estimate. Updated comment. * testsuite/gcc.dg/tree-ssa/sra-11.c: New test. From-SVN: r165124
2010-09-30tree-sra.c (type_consists_of_records_p): Do not check for trailing zero ↵Martin Jambor1-8/+1
sized bit-fields. 2010-09-30 Martin Jambor <mjambor@suse.cz> * tree-sra.c (type_consists_of_records_p): Do not check for trailing zero sized bit-fields. From-SVN: r164750
2010-09-22tree-sra.c (struct access): New field grp_no_warning.Martin Jambor1-6/+22
2010-09-22 Martin Jambor <mjambor@suse.cz> * tree-sra.c (struct access): New field grp_no_warning. (create_access_replacement): Set TREE_NO_WARNING according to grp_no_warning. (create_artificial_child_access): Use build_ref_for_model and set grp_no_warning if build_user_friendly_ref_for_offset fails. (propagate_subaccesses_across_link): Likewise. From-SVN: r164515
2010-09-15re PR middle-end/45644 (450.soplex in SPEC CPU 2006 is miscompiled)Martin Jambor1-3/+4
2010-09-15 Martin Jambor <mjambor@suse.cz> PR middle-end/45644 * tree-sra.c (create_access): Check for bit-fields directly. * testsuite/gcc.dg/ipa/pr45644.c: New test. From-SVN: r164313
2010-09-15tree-sra.c (generate_subtree_copies): Updated comment.Martin Jambor1-36/+29
2010-09-15 Martin Jambor <mjambor@suse.cz> * tree-sra.c (generate_subtree_copies): Updated comment. (handle_unscalarized_data_in_subtree): Removed parameter lhs which is obtained from the statement iterator instead. (load_assign_lhs_subreplacements): Removed parameters lhs and right_offset, which is obtained from top_racc instead. Parameter lacc is now expected to be the root of the processed tree rather than root's first child. Updated all callers. From-SVN: r164304
2010-09-14tree-sra.c (build_ref_for_offset): Loc made a parameter.Martin Jambor1-36/+53
2010-09-14 Martin Jambor <mjambor@suse.cz> * tree-sra.c (build_ref_for_offset): Loc made a parameter. Set the location of generated statement. Changed all callers. (build_ref_for_model): New parameter loc which used to set location of all generated expressions. Changed all callers. (generate_subtree_copies): Likewise. (init_subtree_with_zero): Likewise. (sra_modify_expr): Set locations of all generated statements and expressions to the location the original statement. (handle_unscalarized_data_in_subtree): Likewise. (load_assign_lhs_subreplacements): Likewise. (sra_modify_constructor_assign): Likewise. (sra_modify_assign): Likewise. From-SVN: r164280
2010-09-10re PR tree-optimization/44972 (ICE: in load_assign_lhs_subreplacements, at ↵Martin Jambor1-160/+143
tree-sra.c:2475) 2010-09-10 Martin Jambor <mjambor@suse.cz> PR tree-optimization/44972 * tree-sra.c: Include toplev.h. (build_ref_for_offset): Entirely reimplemented. (build_ref_for_model): New function. (build_user_friendly_ref_for_offset): New function. (analyze_access_subtree): Removed build_ref_for_offset check. (propagate_subaccesses_across_link): Likewise. (create_artificial_child_access): Use build_user_friendly_ref_for_offset. (propagate_subaccesses_across_link): Likewise. (ref_expr_for_all_replacements_p): Removed. (generate_subtree_copies): Updated comment. Use build_ref_for_model. (sra_modify_expr): Use build_ref_for_model. (load_assign_lhs_subreplacements): Likewise. (sra_modify_assign): Removed ref_expr_for_all_replacements_p checks, checks for return values of build_ref_for_offset. * ipa-cp.c (ipcp_lattice_from_jfunc): No need to check return value of build_ref_for_offset. * ipa-prop.h: Include gimple.h * ipa-prop.c (ipa_compute_jump_functions): Update to look for MEM_REFs. (ipa_analyze_indirect_call_uses): Update comment. * Makefile.in (tree-sra.o): Add $(GIMPLE_H) to dependencies. (IPA_PROP_H): Likewise. * testsuite/gcc.dg/ipa/ipa-sra-1.c: Adjust scanning expressions. * testsuite/gcc.dg/tree-ssa/pr45144.c: Likewise. * testsuite/gcc.dg/tree-ssa/forwprop-5.c: Likewise and scan optimzed dump instead. * testsuite/g++.dg/torture/pr44972.C: New test. From-SVN: r164136
2010-09-03re PR middle-end/45415 (ICE in partition_view_bitmap, at tree-ssa-live.c:334)Michael Matz1-0/+1
PR middle-end/45415 * tree-sra.c (sra_modify_assign): If we modify the statement, say so. * tree-ssa.c (verify_ssa): Check number of operands and links per statement to agree. testsuite/ PR middle-end/45415 * gcc.dg/pr45415.c: New test. From-SVN: r163822
2010-08-19cfgloop.c (get_loop_body_in_bfs_order): Avoid redundant call to bitmap_bit_p.Nathan Froyd1-5/+2
* cfgloop.c (get_loop_body_in_bfs_order): Avoid redundant call to bitmap_bit_p. * config/bfin/bifn.c (bfin_discover_loop): Likewise. * dominance.c (iterate_fix_dominators): Likewise. * dse.c (set_usage_bits): Likewise. (set_position_unneeded, record_store): Likewise. * gimple-fold.c (get_maxval_strlen): Likewise. * haifa-sched.c (fix_inter_tick, fix_recovery_deps): Likewise. * ipa-inline.c (update_caller_keys): Likewise. * ipa-split.c (verify_non_ssa_vars): Likewise. * ipa-type-escape.c (mark_type, close_type_seen): Likewise. (close_type_exposed_parameter, close_type_full_escape): Likewise. (close_addressof_down): Likewise. * ira-color.c (assign_hard_reg, push_allocno_to_stack): Likewise. (setup_allocno_left_conflicts_size): Likewise. (ira_reassign_conflict_allocnos): Likewise. (ira_reassign_pseudos): Likewise. * ira-emit.c (change_loop): Likewise. * loop-invariant.c (mark_regno_live, mark_regno_death): Likewise. * lto-streamer-out.c (write_symbol): Likewise. * predict.c (expr_expected_value_1): Likewise. * regstat.c (regstat_bb_compute_ri): Likewise. * sel-sched.c (create_block_for_bookkeeping): Likewise. (track_scheduled_insns_and_blocks, sel_sched_region_1): Likewise. * stmt.c (expand_case): Likewise. * tree-eh.c (emit_eh_dispatch): Likewise. * tree-into-ssa.c (prune_unused_phi_nodes): Likewise. * tree-loop-distribution.c (make_nodes_having_upstream_mem_writes): Likewise. (rdg_flag_vertex, rdg_flag_loop_exits): Likewise. (rdg_build_components): Likewise. * tree-object-size.c (collect_object_sizes_for): Likewise. * tree-sra.c (convert_callers): Likewise. * tree-ssa-coalesce.c (live_track_add_partition): Likewise. * tree-ssa-live.c (mark_all_vars_used_1): Likewise. * tree-ssa-pre.c (bitmap_set_replace_value): Likewise. From-SVN: r163378
2010-08-05re PR tree-optimization/45144 (SRA optimization issue of bit-field)Jie Zhang1-1/+4
PR tree-optimization/45144 * tree-sra.c (type_consists_of_records_p): Return false if the record contains bit-field. testsuite/ PR tree-optimization/45144 * gcc.dg/tree-ssa/pr45144.c: New test. From-SVN: r162897
2010-08-03tree-sra.c (completely_scalarize_record): New parameter REF, create its own ↵Martin Jambor1-12/+9
access->expr intead of using build_ref_for_offset. 2010-08-03 Martin Jambor <mjambor@suse.cz> * tree-sra.c (completely_scalarize_record): New parameter REF, create its own access->expr intead of using build_ref_for_offset. From-SVN: r162841
2010-07-29dbgcnt.def (eipa_sra): New counter.Martin Jambor1-1/+1
2010-07-29 Martin Jambor <mjambor@suse.cz> * dbgcnt.def (eipa_sra): New counter. * tree-sra.c (ipa_early_sra_gate): Also check eipa_sra debug counter. From-SVN: r162686
2010-07-28re PR tree-optimization/44885 (miscompilation of gnat.dg/aliasing3.adb after ↵Eric Botcazou1-0/+2
mem-ref2) PR tree-optimization/44885 * tree-sra.c (find_param_candidates): Skip pointer types to arrays with non-aliased component. From-SVN: r162621
2010-07-27re PR target/44290 (__naked attribute is broken)Jie Zhang1-7/+0
PR target/44290 Revert 2010-07-23 Jie Zhang <jie@codesourcery.com> * tree-sra.c (ipa_sra_preliminary_function_checks): Return false if ! tree_versionable_function_p. From-SVN: r162579
2010-07-23re PR tree-optimization/44914 (ICE: in calc_dfs_tree, at dominance.c:395 ↵Martin Jambor1-19/+30
with -fipa-sra -fnon-call-exceptions) 2010-07-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/44914 * tree-sra.c (sra_modify_function_body): Return true if CFG was changed, add purging dead eh edges. (ipa_sra_modify_function_body): Return true if CFG was changed, simplify purging dead eh edges. (modify_function): Return true if CFG was changed. (perform_intra_sra): Add TODO_cleanup_cfg to the return value if CFG was changed. (ipa_early_sra): Likewise. * testsuite/g++.dg/tree-ssa/pr44914.C: New test. From-SVN: r162468
2010-07-23re PR target/44290 (__naked attribute is broken)Jie Zhang1-0/+7
PR target/44290 * attribs.c (decl_attributes): Insert "noinline" and "noclone" if "naked". * tree-sra.c (ipa_sra_preliminary_function_checks): Return false if ! tree_versionable_function_p. testsuite/ PR target/44290 * gcc.dg/pr44290-1.c: New test. * gcc.dg/pr44290-2.c: New test. From-SVN: r162466
2010-07-23tree-sra.c (ipa_sra_preliminary_function_checks): Dump proper words when ↵Jie Zhang1-1/+1
!tree_versionable_function_p. * tree-sra.c (ipa_sra_preliminary_function_checks): Dump proper words when !tree_versionable_function_p. From-SVN: r162453
2010-07-22re PR tree-optimization/44891 (non-trivial conversion ICE from early SRA)Martin Jambor1-17/+33
2010-07-22 Martin Jambor <mjambor@suse.cz> PR tree-optimization/44891 * tree-sra.c: Include gimple-pretty-print.h. (replace_uses_with_default_def_ssa_name): Renamed to get_repl_default_def_ssa_name, return the new SSA name instead of replacing the old one. (sra_modify_assign): Dump a message when removing a load, if the LHS is an SSA_NAME, do not do any propagation, just set the RHS to a default definition SSA NAME, type convert if necessary. * Makefile.in (tree-sra.o): Add gimple-pretty-print.h to dependencies. * testsuite/gcc.c-torture/compile/pr44891.c: New test. From-SVN: r162413