aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
AgeCommit message (Collapse)AuthorFilesLines
2010-06-09re PR tree-optimization/44423 (Massive performance regression in SSE code ↵Martin Jambor1-3/+4
due to SRA) 2010-06-09 Martin Jambor <mjambor@suse.cz> PR tree-optimization/44423 * tree-sra.c (dump_access): Dump also grp_assignment_read. (analyze_access_subtree): Pass negative allow_replacements to children if the current type is scalar. * testsuite/gcc.dg/tree-ssa/pr44423.c: New test. From-SVN: r160462
2010-06-01gimplify.c: Do not include except.h and optabs.h.Steven Bosscher1-2/+0
* gimplify.c: Do not include except.h and optabs.h. (gimplify_body): Do not initialize RTL profiling. * gimple-low.c: Do not include rtl.h, diagnostic.h, langhooks.h, langhooks-def.h, timevar.h, except.h, hashtab.h, and expr.h. * gimple-fold.c: Do not include rtl.h, tm_p.h, ggc.h, basic-block.h, output.h, expr.h, diagnostic.h, timevar.h, value-prof.h, and langhooks.h. * tree-pretty-print.h: Include pretty-print.h. * gimple-pretty-print.h: Include pretty-print.h. * tree-pretty-print.c: Do not include diagnostic.h. * tree-vrp.c: Likewise. * tree-tailcall.c: Likewise * tree-scalar-evolution.c: Likewise * tree-ssa-dse.c: Likewise * tree-chrec.c: Likewise * tree-ssa-sccvn.c: Likewise * tree-ssa-copyrename.c: Likewise * tree-nomudflap.c: Likewise * tree-call-cdce.c: Likewise * tree-stdarg.c: Likewise * tree-ssa-math-opts.c: Likewise * tree-nrv.c: Likewise * tree-ssa-sink.c: Likewise * tree-browser.c: Likewise * tree-ssa-loop-ivcanon.c: Likewise * tree-ssa-loop.c: Likewise * tree-parloops.c: Likewise * tree-ssa-address.c: Likewise * tree-ssa-ifcombine.c: Likewise * tree-if-conv.c: Likewise * tree-data-ref.c: Likewise * tree-affine.c: Likewise * tree-ssa-phiopt.c: Likewise * tree-ssa-coalesce.c: Likewise * tree-ssa-pre.c: Likewise * tree-ssa-live.c: Likewise * tree-predcom.c: Likewise * tree-ssa-forwprop.c: Likewise * tree-ssa-dce.c: Likewise * tree-ssa-ter.c: Likewise * tree-ssa-loop-prefetch.c: Likewise * tree-optimize.c: Likewise * tree-ssa-phiprop.c: Likewise * tree-object-size.c: Likewise * tree-outof-ssa.c: Likewise * tree-ssa-structalias.c: Likewise * tree-switch-conversion.c: Likewise * tree-ssa-reassoc.c: Likewise * tree-ssa-operands.c: Likewise * tree-vectorizer.c: Likewise * tree-vect-data-refs.c: Likewise * tree-vect-generic.c: Likewise * tree-vect-stmts.c: Likewise * tree-vect-patterns.c: Likewise * tree-vect-slp.c: Likewise * tree-vect-loop.c: Likewise * tree-ssa-loop-ivopts.c: Likewise * tree-ssa-loop-im.c: Likewise * tree-ssa-loop-niter.c: Likewise * tree-ssa-loop-unswitch.c: Likewise * tree-ssa-loop-manip.c: Likewise * tree-ssa-loop-ch.c: Likewise * tree-dump.c: Likewise * tree-complex.c: Likewise * tree-into-ssa.c: Do not include diagnostic.h and expr.h. * tree-ssa-uninit.c: Likewise * tree-ssa-threadupdate.c: Likewise * tree-ssa-uncprop.c: Likewise * tree-ssa-ccp.c: Likewise * tree-ssa-dom.c: Likewise * tree-ssa-propagate.c: Likewise * tree-ssa-alias.c: Likewise * tree-dfa.c: Likewise * tree-cfgcleanup.c: Likewise * tree-sra.c: Likewise * tree-ssa-copy.c: Likewise * tree-ssa.c: Likewise * tree-profile.c: Likewise * tree-cfg.c: Likewise * tree-ssa-threadedge.c: Likewise * tree-vect-loop-manip.c: Likewise * tree-inline.c: Do not include diagnostic.h and expr.h. Include rtl.h. (copy_decl_for_dup_finish): Do not use NULL_RTX. * tree-loop-linear.c: Do not include diagnostic.h, expr.h, and optabs.h. * tree-loop-distribution.c: Likewise. From-SVN: r160125
2010-05-21diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or ↵Joseph Myers1-0/+1
langhooks-def.h. * diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h. (diagnostic_initialize): Initialize x_data not last_function. (diagnostic_report_current_function): Move to tree-diagnostic.c. (default_diagnostic_starter): Call diagnostic_report_current_module not diagnostic_report_current_function. (diagnostic_report_diagnostic): Initialize x_data not abstract_origin. (verbatim): Likewise. * diagnostic.h (struct diagnostic_info): Change abstract_origin to x_data. (struct diagnostic_context): Change last_function to x_data. (diagnostic_auxiliary_data): Replace with diagnostic_context_auxiliary_data and diagnostic_info_auxiliary_data. (diagnostic_last_function_changed, diagnostic_set_last_function, diagnostic_report_current_function): Move to tree-diagnostic.h. (print_declaration, dump_generic_node, print_generic_stmt, print_generic_stmt_indented, print_generic_expr, print_generic_decl, debug_c_tree, dump_omp_clauses, print_call_name, debug_generic_expr, debug_generic_stmt, debug_tree_chain, default_tree_printer): Move to tree-pretty-print.h. (debug_gimple_stmt, debug_gimple_seq, print_gimple_seq, print_gimple_stmt, print_gimple_expr, dump_gimple_stmt): Move to gimple-pretty-print.h. * pretty-print.c: Don't include tree.h (pp_base_format): Don't handle %K here. (pp_base_tree_identifier): Move to tree-pretty-print.c. * pretty-print.h (text_info): Change abstract_origin to x_data. (pp_tree_identifier, pp_unsupported_tree, pp_base_tree_identifier): Move to tree-pretty-print.h. * gimple-pretty-print.h, tree-diagnostic.c, tree-diagnostic.h, tree-pretty-print.h: New files. * tree-pretty-print.c: Include tree-pretty-print.h. (percent_K_format): New. Moved from pretty-print.c. (pp_base_tree_identifier): Move from pretty-print.c. * c-objc-common.c: Include tree-pretty-print.h. (c_tree_printer): Handle %K here. * langhooks.c: Include tree-diagnostic.h. (lhd_print_error_function): Use diagnostic_abstract_origin macro. * toplev.c: Include tree-diagnostic.h and tree-pretty-print.h. (default_tree_printer): Handle %K using percent_K_format. (general_init): Use default_tree_diagnostic_starter. * tree.c: Include tree-diagnostic.h and tree-pretty-print.h. (free_lang_data): Use default_tree_diagnostic_starter. * c-pretty-print.c: Include tree-pretty-print.h. * cfgexpand.c: Include tree-pretty-print.h and gimple-pretty-print.h. * cgraphunit.c: Include tree-pretty-print.h and gimple-pretty-print.h. * dwarf2out.c: Include tree-pretty-print.h. * except.c: Include tree-pretty-print.h. * gimple-pretty-print.c: Include tree-pretty-print.h and gimple-pretty-print.h. * gimplify.c: Include tree-pretty-print.h. * graphite-poly.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-cp.c: Include tree-pretty-print.h. * ipa-inline.c: Include gimple-pretty-print.h. * ipa-prop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-pure-const.c: Include gimple-pretty-print.h. * ipa-struct-reorg.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-type-escape.c: Include tree-pretty-print.h. * print-rtl.c: Include tree-pretty-print.h. * print-tree.c: Include gimple-pretty-print.h. * sese.c: Include tree-pretty-print.h. * tree-affine.c: Include tree-pretty-print.h. * tree-browser.c: Include tree-pretty-print.h. * tree-call-cdce.c: Include gimple-pretty-print.h. * tree-cfg.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-chrec.c: Include tree-pretty-print.h. * tree-data-ref.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-dfa.c: Include tree-pretty-print.h. * tree-if-conv.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-inline.c: Include tree-pretty-print.h. * tree-into-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-nrv.c: Include tree-pretty-print.h. * tree-object-size.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-outof-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-parloops.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-predcom.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-scalar-evolution.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-sra.c: Include tree-pretty-print.h. * tree-ssa-address.c: Include tree-pretty-print.h. * tree-ssa-alias.c: Include tree-pretty-print.h. * tree-ssa-ccp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-coalesce.c: Include tree-pretty-print.h. * tree-ssa-copy.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-copyrename.c: Include tree-pretty-print.h. * tree-ssa-dce.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-dom.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-dse.c: Include gimple-pretty-print.h. * tree-ssa-forwprop.c: Include tree-pretty-print.h. * tree-ssa-ifcombine.c: Include tree-pretty-print.h. * tree-ssa-live.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-im.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-ivcanon.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-ivopts.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-niter.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-prefetch.c: Include tree-pretty-print.h. * tree-ssa-math-opts.c: Include gimple-pretty-print.h. * tree-ssa-operands.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-phiprop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-pre.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-propagate.c: Include gimple-pretty-print.h. * tree-ssa-reassoc.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-sccvn.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-sink.c: Include gimple-pretty-print.h. * tree-ssa-ter.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-uninit.c: Include gimple-pretty-print.h. * tree-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-stdarg.c: Include gimple-pretty-print.h. * tree-switch-conversion.c: Include gimple-pretty-print.h. * tree-tailcall.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-data-refs.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-loop-manip.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-loop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-patterns.c: Include gimple-pretty-print.h. * tree-vect-slp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-stmts.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vectorizer.c: Include tree-pretty-print.h. * tree-vrp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * value-prof.c: Include tree-pretty-print.h and gimple-pretty-print.h. * var-tracking.c: Include tree-pretty-print.h. * Makefile.in (OBJS-common): Add tree-diagnostic.o. (tree-diagnostic.o): New dependencies. (c-objc-common.o, c-pretty-print.o, langhooks.o, tree.o, tree-inline.o, print-tree.o, stor-layout.o, tree-ssa-uninit.o, tree-ssa.o, tree-into-ssa.o, tree-ssa-ter.o, tree-ssa-coalesce.o, tree-outof-ssa.o, tree-ssa-forwprop.o, tree-ssa-phiprop.o, tree-ssa-ifcombine.o, tree-nrv.o, tree-ssa-copy.o, tree-ssa-propagate.o, tree-ssa-dom.o, tree-ssa-uncprop.o, tree-ssa-live.o, tree-ssa-copyrename.o, tree-ssa-pre.o, tree-ssa-sccvn.o, tree-vrp.o, tree-cfg.o, tree-tailcall.o, tree-ssa-sink.o, tree-if-conv.o, tree-dfa.o, tree-ssa-operands.o, tree-ssa-address.o, tree-ssa-loop-niter.o, tree-ssa-loop-ivcanon.o, tree-ssa-loop-prefetch.o, tree-predcom.o, tree-ssa-loop-ivopts.o, tree-affine.o, tree-ssa-loop-im.o, tree-ssa-math-opts.o, tree-ssa-alias.o, tree-ssa-reassoc.o, gimplify.o, tree-browser.o, tree-chrec.o, tree-scalar-evolution.o, tree-data-ref.o, sese.o, graphite-poly.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-patterns.o, tree-vect-slp.o, tree-vect-stmts.o, tree-vect-data-refs.o, tree-vectorizer.o, tree-parloops.o, tree-stdarg.o, tree-object-size.o, gimple-pretty-print.o, tree-pretty-print.o, diagnostic.o, toplev.o, print-rtl.o, except.o, dwarf2out.o, cgraphunit.o, ipa-prop.o, ipa-cp.o, ipa-inline.o, ipa-pure-const.o, ipa-type-escape.o, ipa-struct-reorg.o, tree-ssa-dce.o, tree-call-cdce.o, tree-ssa-ccp.o, tree-sra.o, tree-switch-conversion.o, var-tracking.o, value-prof.o, cfgexpand.o, pretty-print.o): Update dependencies. cp: * error.c: Include tree-diagnostic.h and tree-pretty-print.h. (cp_print_error_function): Use diagnostic_abstract_origin macro. (cp_printer): Handle %K here using percent_K_format. * cxx-pretty-print.c: Include tree-pretty-print.h. * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update dependencies. From-SVN: r159685
2010-05-17re PR middle-end/44133 (Uninit warning regression with new SRA)Martin Jambor1-22/+29
2010-05-17 Martin Jambor <mjambor@suse.cz> PR middle-end/44133 * tree-sra.c (create_access_replacement): New parameter rename, mark the replaement for renaming only when it is true. (get_access_replacement): Pass true in the rename parameter of create_access_replacement. (get_unrenamed_access_replacement): New function. (replace_uses_with_default_def_ssa_name): New parameter racc, get the replacement declaration from it. * testsuite/gcc.dg/tree-ssa/pr44133.c: New test. * testsuite/gcc.dg/tree-ssa/sra-9.c: Make the scan regular expression more precise. From-SVN: r159482
2010-05-13re PR debug/43983 (var-tracking needlessly throws away location info for ↵Jakub Jelinek1-1/+28
SRAed vars) PR debug/43983 * var-tracking.c (track_expr_p): Allow tracking of variables optimized by SRA. * Makefile.in (dwarf2out.o): Depend on $(TREE_FLOW_H). * tree-sra.c (create_access_replacement): Call unshare_expr before passing expr to SET_DECL_DEBUG_EXPR, and remove any SSA_NAMEs from it. * dwarf2out.c: Include tree-flow.h. (struct var_loc_node): Rename var_loc_note field to loc, add comment. (size_of_loc_descr, output_loc_operands, output_loc_operands_raw): Handle DW_OP_bit_piece. (decl_piece_bitsize, decl_piece_varloc_ptr, decl_piece_node, construct_piece_list, adjust_piece_list): New functions. (add_var_loc_to_decl): Handle SRA optimized variables. Adjust for var_loc_note to loc field renaming. (dw_loc_list_1): For WANT_ADDRESS == 2 prefer DECL_MODE of decl in VAR_LOCATION note. (new_loc_descr_op_bit_piece): New function. (dw_sra_loc_expr): New function. (dw_loc_list): Use it. Don't handle the last range after the loop, handle it inside of the loop. Adjust for var_loc_note to loc field renaming. (add_location_or_const_value_attribute): Only special case single entry loc lists if loc is NOTE_P. Adjust for var_loc_note to loc field renaming. (dwarf2out_var_location): Don't set newloc->var_loc_note and newloc->next here. * gcc.dg/guality/sra-1.c: New test. From-SVN: r159357
2010-05-04tree-sra.c (build_access_from_expr_1): The first parameter type changed to ↵Martin Jambor1-193/+275
simple tree. 2010-05-04 Martin Jambor <mjambor@suse.cz> * tree-sra.c (build_access_from_expr_1): The first parameter type changed to simple tree. (build_access_from_expr): Likewise, gsi parameter was eliminated. (scan_assign_result): Renamed to assignment_mod_result, enum elements renamed as well. (build_accesses_from_assign): Removed all parameters except for a simple gimple statement. Now returns a simple bool. (scan_function): All non-analysis parts moved to separate functions sra_modify_function_body and ipa_sra_modify_function_body. Removed all parameters and updated both callers. (sra_modify_expr): Removed parameter data. (sra_modify_function_body): New function. (perform_intra_sra): Call sra_modify_function_body to modify the function body. (replace_removed_params_ssa_names): Parameter data changed into adjustments vector. (sra_ipa_modify_expr): Likewise. Also removed unused parameter gsi and changed the parameter dont_convert to convert with the opposite meaning. (sra_ipa_modify_assign): Parameter data changed into adjustments vector, return value changed to bool. (ipa_sra_modify_function_body): New function. (sra_ipa_reset_debug_stmts): Updated a comment. (modify_function): Use ipa_sra_modify_function_body to modify function body. From-SVN: r159038
2010-04-23re PR tree-optimization/43846 (array vs members, total scalarization issues)Martin Jambor1-12/+33
2010-04-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/43846 * tree-sra.c (struct access): New flag grp_assignment_read. (build_accesses_from_assign): Set grp_assignment_read. (sort_and_splice_var_accesses): Propagate grp_assignment_read. (enum mark_read_status): New type. (analyze_access_subtree): Propagate grp_assignment_read, create accesses also if both direct_read and root->grp_assignment_read. * testsuite/gcc.dg/tree-ssa/sra-10.c: New test. From-SVN: r158668
2010-04-23re PR middle-end/43835 (IPA-SRA doesn't rewrite attributes)Martin Jambor1-0/+3
2010-04-23 Martin Jambor <mjambor@suse.cz> PR middle-end/43835 * tree-sra.c (ipa_sra_preliminary_function_checks): Check that the function does not have type attributes. * testsuite/gcc.c-torture/execute/pr43835.c: New test. From-SVN: r158667
2010-04-19gimple.h (create_tmp_reg): Declare.Martin Jambor1-8/+2
2010-04-19 Martin Jambor <mjambor@suse.cz> * gimple.h (create_tmp_reg): Declare. * gimplify.c (create_tmp_reg): New function. (gimplify_return_expr): Use create_tmp_reg. (gimplify_omp_atomic): Likewise. (gimple_regimplify_operands): Likewise. * tree-dfa.c (make_rename_temp): Likewise. * tree-predcom.c (predcom_tmp_var): Likewise. (reassociate_to_the_same_stmt): Likewise. * tree-sra.c (replace_uses_with_default_def_ssa_name): Likewise. (get_replaced_param_substitute): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-ssa-phiopt.c (cond_store_replacement): Likewise. * tree-ssa-pre.c (get_representative_for): Likewise. (create_expression_by_pieces): Likewise. * tree-tailcall.c (adjust_return_value_with_ops): Likewise. (create_tailcall_accumulator): Likewise. From-SVN: r158523
2010-04-13tree-sra.c (replace_uses_with_default_def_ssa_name): New function.Martin Jambor1-9/+42
2010-04-13 Martin Jambor <mjambor@suse.cz> * tree-sra.c (replace_uses_with_default_def_ssa_name): New function. (sra_modify_assign): Delete stmts loading dead data even if racc has no children. Call replace_uses_with_default_def_ssa_name to handle SSA_NAES on lhs. * testsuite/gcc.dg/tree-ssa/sra-9.c: New test. From-SVN: r158271
2010-04-07ipa-reference.c (mark_load): Use get_base_address.Richard Guenther1-1/+3
2010-04-07 Richard Guenther <rguenther@suse.de> * ipa-reference.c (mark_load): Use get_base_address. (mark_store): Likewise. * tree-ssa-ccp.c (gimplify_and_update_call_from_tree): Avoid inserting GIMPLE_NOPs into the IL. * tree-ssa-structalias.c (get_constraint_for_component_ref): Explicitly strip handled components and indirect references. * fold-const.c (fold_unary_loc): Do not strip qualifiers when folding address expressions. * gimple.c (gimple_ior_addresses_taken_1): Use get_base_address. * tree-ssa-alias.c (decl_refs_may_alias_p): Do not use operand_equal_p to compare decls. (ptr_deref_may_alias_decl_p): Likewise. * tree-ssa-operands.c (get_asm_expr_operands): Simplify * tree-ssa-forwprop.c (forward_propagate_into_gimple_cond): Handle reversed comparison ops. * tree-sra.c (asm_visit_addr): Use get_base_address. * ipa-prop.c (visit_store_addr_for_mod_analysis): Use get_base_address. * ipa-reference.c (mark_address): Use get_base_address. From-SVN: r158069
2010-04-07tree-sra.c (find_param_candidates): Allow scalar va_list types.Martin Jambor1-1/+1
2010-04-07 Martin Jambor <mjambor@suse.cz> * tree-sra.c (find_param_candidates): Allow scalar va_list types. From-SVN: r158057
2010-03-17re PR tree-optimization/43347 (Warning about symbols generated by SRA being ↵Martin Jambor1-4/+4
used uninitialized) 2010-03-17 Martin Jambor <mjambor@suse.cz> PR tree-optimization/43347 * tree-sra.c (create_access_replacement): Set TREE_NO_WARNING when the original base is DECL_ARTIFICIAL or DECL_IGNORED_P. From-SVN: r157515
2010-03-15PR tree/optimization/43141Martin Jambor1-0/+21
2010-03-15 Martin Jambor <mjambor@suse.cz> PR tree/optimization/43141 * tree-sra.c (create_abstract_origin): New function. (modify_function): Call create_abstract_origin. From-SVN: r157456
2010-03-04re PR tree-optimization/43164 (ice in completely_scalarize_record, at ↵Martin Jambor1-2/+10
tree-sra.c:85) 2010-03-04 Martin Jambor <mjambor@suse.cz> PR tree-optimization/43164 PR tree-optimization/43191 * tree-sra.c (type_consists_of_records_p): Reject records with zero-size bit-fields at the end. * testsuite/gcc.c-torture/compile/pr43164.c: New test. * testsuite/gcc.c-torture/compile/pr43191.c: Likewise. From-SVN: r157232
2010-02-18re PR tree-optimization/43066 (ICE: SIGFPE with empty struct and va_arg)Martin Jambor1-1/+1
2010-02-18 Martin Jambor <mjambor@suse.cz> PR tree-optimization/43066 * tree-sra.c (build_ref_for_offset_1): Return false on encountering an array with zero-sized element type. * testsuite/gcc.c-torture/compile/pr43066.c: New test. From-SVN: r156863
2010-02-08re PR middle-end/42898 (volatile structures and compound literal initializers)Martin Jambor1-2/+5
2010-02-08 Martin Jambor <mjambor@suse.cz> PR middle-end/42898 * tree-sra.c (build_accesses_from_assign): Do not mark in should_scalarize_away_bitmap if stmt has volatile ops. (sra_modify_assign): Do not process assigns piecemeal if if stmt has volatile ops. From-SVN: r156599
2010-01-31tree-sra.c (ptr_parm_has_direct_uses): Rewrite to be conservatively correct.Richard Guenther1-25/+34
2010-01-31 Richard Guenther <rguenther@suse.de> * tree-sra.c (ptr_parm_has_direct_uses): Rewrite to be conservatively correct. From-SVN: r156413
2010-01-22Makefile.in (tree-sra.o): Add $(EXPR_H) dependency.Steve Ellcey1-0/+1
2010-01-22 Steve Ellcey <sje@cup.hp.com> * Makefile.in (tree-sra.o): Add $(EXPR_H) dependency. * tree-sra.c: Add include of expr.h. From-SVN: r156181
2010-01-22re PR tree-optimization/42833 (sra miscompiles qemu)Richard Henderson1-9/+13
PR tree-opt/42833 * tree-sra.c (sra_modify_assign): Delay re-gimplification of the RHS until after generate_subtree_copies has insertted its code before the current statement. From-SVN: r156176
2010-01-21re PR tree-optimization/42585 (SRA is not good for structure copies with one ↵Martin Jambor1-23/+158
replacement any more) 2010-01-21 Martin Jambor <mjambor@suse.cz> PR tree-optimization/42585 * tree-sra.c (struct access): New field grp_total_scalarization. (dump_access): Dump the new field. (should_scalarize_away_bitmap): New variable. (cannot_scalarize_away_bitmap): Likewise. (sra_initialize): Allocate new bitmaps. (sra_deinitialize): Free new bitmaps. (create_access_1): New function. (create_access): Parts moved to create_access_1. (type_consists_of_records_p): New function. (completely_scalarize_record): Likewise. (build_access_from_expr): Set bit in cannot_scalarize_away_bitmap. (build_accesses_from_assign): Set bits in should_scalarize_away_bitmap. (sort_and_splice_var_accesses): Hint groups with a total_scalarization access. (analyze_all_variable_accesses): Completely scalarize small eligible records. * testsuite/gcc.dg/tree-ssa/pr42585.c: New test. From-SVN: r156156
2010-01-21tree-sra.c (build_ref_for_offset_1): Allow for zero size fields.Martin Jambor1-1/+6
2010-01-21 Martin Jambor <mjambor@suse.cz> * tree-sra.c (build_ref_for_offset_1): Allow for zero size fields. From-SVN: r156155
2010-01-14re PR tree-optimization/42706 (ICE in gimple_op, at gimple.h:1634, (IPA SRA))Martin Jambor1-5/+66
2010-01-14 Martin Jambor <mjambor@suse.cz> PR tree-optimization/42706 * tree-sra.c (encountered_recursive_call): New variable. (encountered_unchangable_recursive_call): Likewise. (sra_initialize): Initialize both new variables. (callsite_has_enough_arguments_p): New function. (scan_function): Call decl and flags check only for IPA-SRA, check whether there is a recursive call and whether it has enough arguments. (all_callers_have_enough_arguments_p): New function. (convert_callers): Look for recursive calls only when encountered_recursive_call is set. (ipa_early_sra): Bail out either if !all_callers_have_enough_arguments_p or encountered_unchangable_recursive_call. * testsuite/gcc.dg/ipa/pr42706.c: New testcase. From-SVN: r155911
2010-01-14re PR tree-optimization/42714 (ICE in create_tmp_var, at gimplify.c:504)Martin Jambor1-2/+14
2010-01-14 Martin Jambor <mjambor@suse.cz> PR tree-optimization/42714 * tree-sra.c (sra_ipa_modify_assign): Handle incompatible-type constructors specially. * gcc/testsuite/g++.dg/torture/pr42714.C: New test. From-SVN: r155905
2010-01-13re PR tree-optimization/42704 (ICE in verify_ssa after early SRA)Martin Jambor1-1/+3
2010-01-13 Martin Jambor <mjambor@suse.cz> PR tree-optimization/42704 * tree-sra.c (sra_modify_assign): Do not delete assignments to SSA_NAMEs. * testsuite/g++.dg/torture/pr42704.C: New test. From-SVN: r155865
2010-01-13re PR tree-optimization/42703 (ICE in generate_subtree_copies with out of ↵Martin Jambor1-1/+7
bounds array access) 2010-01-13 Martin Jambor <mjambor@suse.cz> PR tree-optimization/42703 * tree-sra.c (analyze_access_subtree): Check that we can build a reference to the original data within the aggregate. * testsuite/gcc.c-torture/compile/pr42703.c: New test. From-SVN: r155863
2010-01-07re PR tree-optimization/42157 (ICE building stage 1 libgcc: SEGV in ↵Martin Jambor1-2/+4
compare_access_positions) 2010-01-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/42157 * tree-sra.c (compare_access_positions): Stabilize sort if both accesses have integer types, return zero immediately if they are the same. From-SVN: r155689
2010-01-05re PR tree-optimization/42508 (wrong code with "-O1 -fipa-sra")Jakub Jelinek1-2/+10
PR tree-optimization/42508 * tree-sra.c (convert_callers): Check for recursive call by comparing cgraph nodes instead of decls. (modify_function): Call ipa_modify_formal_parameters also on all same_body aliases. * g++.dg/opt/pr42508.C: New test. * cgraphunit.c (cgraph_materialize_all_clones): Compare cgraph nodes when checking for same_body aliases. From-SVN: r155640
2010-01-04re PR tree-optimization/42398 (internal compiler error: in sra_modify_expr, ↵Martin Jambor1-20/+6
at tree-sra.c:2175) 2010-01-04 Martin Jambor <mjambor@suse.cz> PR tree-optimization/42398 * tree-sra.c (struct access): Removed flag grp_different_types. (dump_access): Do not dump the removed flag. (sort_and_splice_var_accesses): Do not set the removed flag. (sra_modify_expr): Check for type compatibility directly. * testsuite/gcc.c-torture/compile/pr42398.c: New test. From-SVN: r155631
2010-01-01re PR debug/42455 ("-fcompare-debug failure" at -O2 in 'recent' builds)Richard Guenther1-34/+39
2010-01-01 Richard Guenther <rguenther@suse.de> PR debug/42455 * tree-sra.c (analyze_all_variable_accesses): Work in DECL_UID order. From-SVN: r155559
2009-12-13re PR tree-optimization/42357 (another ice in create_tmp_var)Richard Guenther1-1/+2
2009-12-13 Richard Guenther <rguenther@suse.de> PR tree-optimization/42357 * tree-sra.c (sra_modify_assign): Do not tear apart struct copies. * g++.dg/torture/pr42357.C: New testcase. From-SVN: r155193
2009-12-01re PR tree-optimization/42237 (internal compiler error: verify_stmts failed)Martin Jambor1-4/+14
2009-12-01 Martin Jambor <mjambor@suse.cz> PR tree-optimization/42237 * tree-sra.c (sra_ipa_modify_assign): Split gimple_reg_type assignments in between references into two. * testsuite/gcc.c-torture/compile/pr42237.c: New test. From-SVN: r154874
2009-11-30re PR middle-end/42196 (ICE when SRAing partial assigments to complex number)Martin Jambor1-6/+33
2009-11-30 Martin Jambor <mjambor@suse.cz> PR middle-end/42196 * tree-sra.c (struct access): New field grp_different_types. (dump_access): Dump grp_different_types. (compare_access_positions): Prefer scalars and vectors over other scalar types. (sort_and_splice_var_accesses): Set grp_different_types if appropriate. (sra_modify_expr): Use the original also when dealing with a complex or vector group accessed as multiple types. * testsuite/gcc.c-torture/compile/pr42196-1.c: New test. * testsuite/gcc.c-torture/compile/pr42196-2.c: New test. * testsuite/gcc.c-torture/compile/pr42196-3.c: New test. From-SVN: r154834
2009-11-27re PR middle-end/42006 (Termination problem with -O2 and -O3)Martin Jambor1-2/+6
2009-11-27 Martin Jambor <mjambor@suse.cz> PR middle-end/42006 * tree-sra.c (get_replaced_param_substitute): Call create_tmp_var instead of create_tmp_var. Set DECL_GIMPLE_REG_P to one manually for vector and complex types. (get_adjustment_for_base): Describe return value in the comment. * testsuite/gcc.c-torture/execute/pr42006.c: New test. From-SVN: r154715
2009-11-24re PR tree-optimization/42154 (Wrong code from (early) SRA)Martin Jambor1-7/+26
2009-11-24 Martin Jambor <mjambor@suse.cz> PR tree-optimization/42154 * tree-sra.c (struct access): Added comments. (sra_modify_expr): Build references to the old aggregate with build_ref_for_offset instead of reusing access->expr. (load_assign_lhs_subreplacements): Likewise. * testsuite/gcc.c-torture/execute/pr42154.c: New test. From-SVN: r154493
2009-11-21re PR middle-end/42025 (ICE verify_stmts failed (non-trivial conversion at ↵Martin Jambor1-18/+68
assignment)) 2009-11-21 Martin Jambor <mjambor@suse.cz> PR middle-end/42025 * tree-sra.c (access_precludes_ipa_sra_p): New function. (splice_param_accesses): Check all accesses by calling access_precludes_ipa_sra_p. (sra_ipa_modify_expr): Rename argument erite to dont_convert and do not convert types if it is true. (sra_ipa_modify_assign): Convert types in case of mismatch. * testsuite/gcc.c-torture/compile/pr42025-1.c: New test. * testsuite/gcc.c-torture/compile/pr42025-2.c: New test. From-SVN: r154413
2009-11-05tree-sra.c (struct access): Changed comment of next_sibling field.Martin Jambor1-23/+29
2009-11-04 Martin Jambor <mjambor@suse.cz> * tree-sra.c (struct access): Changed comment of next_sibling field. (analyze_modified_params): Loop over accesses of a group rather than over all with the ame base, pass a common bitmap to walk_aliased_vdefs. (unmodified_by_ref_scalar_representative): Build link lists of accesses of a group. (splice_param_accesses): Likewise. From-SVN: r153935
2009-11-02re PR tree-optimization/41750 (IPA-SRA is broken)Martin Jambor1-25/+31
2009-11-02 Martin Jambor <mjambor@suse.cz> PR tree-optimization/41750 * tree-sra.c (analyze_modified_params): Loop over all representatives of components of a parameter. * testsuite/gcc.c-torture/execute/pr41750.c: New test. From-SVN: r153809
2009-10-30tree-sra.c (build_ref_for_offset_1): Remove a comment.Martin Jambor1-2/+0
2009-10-30 Martin Jambor <mjambor@suse.cz> * tree-sra.c (build_ref_for_offset_1): Remove a comment. From-SVN: r153751
2009-10-29re PR tree-optimization/41775 (IPA-SRA: ice in rewrite_stmt, at ↵Martin Jambor1-9/+13
tree-into-ssa.c:1302) 2009-10-29 Martin Jambor <mjambor@suse.cz> PR tree-optimization/41775 * tree-sra.c (build_ref_for_offset): Unshare *expr if not NULL. (generate_subtree_copies): Do not unshare agg. (load_assign_lhs_subreplacements): Do not unshare rhs. (sra_modify_assign): Do not unshare exprs. (propagate_subacesses_accross_link): Renamed to propagate_subaccesses_across_link. * testsuite/g++.dg/torture/pr41775.C: New testcase. From-SVN: r153699
2009-10-20tree-sra.c (build_ref_for_offset_1): Skip fields without size or with size ↵Eric Botcazou1-1/+4
that can't be represented as a host integer. * tree-sra.c (build_ref_for_offset_1) <RECORD_TYPE>: Skip fields without size or with size that can't be represented as a host integer. From-SVN: r153008
2009-10-16* tree-sra.c (build_ref_for_offset_1): Update comment.Eric Botcazou1-1/+2
From-SVN: r152893
2009-10-01re PR middle-end/12392 (very long optimized compile)Martin Jambor1-2/+12
2009-10-01 Martin Jambor <mjambor@suse.cz> PR middle-end/12392 * tree-sra.c (convert_callers): Do not call compute_inline_parameters on one caller more than once. From-SVN: r152368
2009-10-01re PR bootstrap/41395 (Revision 151800 failed bootstrap)Martin Jambor1-5/+14
2009-10-01 Martin Jambor <mjambor@suse.cz> PR bootstrap/41395 * tree-sra.c (is_va_list_type): New function. (find_var_candidates): Call is_va_list_type. (find_param_candidates): Check that the type or the type pointed to are not va_list types. From-SVN: r152366
2009-09-17common.opt (fipa-sra): New switch.Martin Jambor1-37/+1401
2009-09-17 Martin Jambor <mjambor@suse.cz> * common.opt (fipa-sra): New switch. * opts.c (decode_options): Turn flag_ipa_sra on for opt2. * timevar.def (TV_IPA_SRA): New timevar. * params.def (ipa-sra-ptr-growth-factor): New parameter. * doc/invoke.texi: Document -fipa-sra and ipa-sra-ptr-growth-factor. * tree-sra.c: Include cgraph.c. (enum sra_mode): Added SRA_MODE_EARLY_IPA. (struct access): Added fields stmt, grp_maybe_modified, grp_scalar_ptr and grp_not_necessarilly_dereferenced. (func_param_count): New variable. (encountered_apply_args): New variable. (bb_dereferences): New variable. (final_bbs): New variable. (no_accesses_representant): New variable. (no_accesses_p): New function. (dump_access): Dump the new fields. (sra_initialize): Set encountered_apply_args to false. (get_ssa_base_param): New function. (mark_parm_dereference): New function. (create_access): Caring for INIDRECT_REFs and different handling of varialble length accesses in early IPA SRA. Store the stmt - a new parameter - to the new access. (build_access_from_expr_1): New parameter stmt, passed to create_access. Handle INDIRECT_REFs. (build_access_from_expr): Pass the current statement to build_access_from_expr_1. (disqualify_ops_if_throwing_stmt): Trigger only in intraprocedural passes. (build_accesses_from_assign): Pass the current statement to build_access_from_expr_1. Do not create assign links in IPA-SRA. (scan_function): Call handle_ssa_defs on phi nodes. Set bits in final_bbs when necessary. Check for calls to __builtin_apply_args. Fixup EH info if anythng was changed. (is_unused_scalar_param): New function. (ptr_parm_has_direct_uses): New function. (find_param_candidates): New function. (mark_maybe_modified): New function. (analyze_modified_params): New function. (propagate_dereference_distances): New function. (dump_dereferences_table): New function. (analyze_caller_dereference_legality): New function. (unmodified_by_ref_scalar_representative): New function. (splice_param_accesses): New function. (decide_one_param_reduction): New function. (enum ipa_splicing_result): New type. (splice_all_param_accesses): New function. (get_param_index): New function. (turn_representatives_into_adjustments): New function. (analyze_all_param_acesses): New function. (get_replaced_param_substitute): New function. (get_adjustment_for_base): New function. (replace_removed_params_ssa_names): New function. (sra_ipa_reset_debug_stmts): New function. (sra_ipa_modify_expr): New function. (sra_ipa_modify_assign): New function. (convert_callers): New function. (modify_function): New function. (ipa_sra_preliminary_function_checks): New function. (ipa_early_sra): New function. (ipa_early_sra_gate): New function. (pass_early_ipa_sra): New variable. * Makefile.in (tree-sra.o): Add cgraph.h to dependencies. Testsuite: * gcc.dg/struct/wo_prof_escape_arg_to_local.c: Do not run IPA-SRA. * gcc.dg/ipa/ipa-sra-1.c: New test. * gcc.dg/ipa/ipa-sra-2.c: New test. * gcc.dg/ipa/ipa-sra-3.c: New test. * gcc.dg/ipa/ipa-sra-4.c: New test. * gcc.dg/ipa/ipa-sra-5.c: New test. * gcc.c-torture/execute/ipa-sra-1.c: New test. * gcc.c-torture/execute/ipa-sra-2.c: New test. From-SVN: r151800
2009-09-14Squash commit of EH in gimpleRichard Henderson1-2/+1
From-SVN: r151696
2009-09-09re PR target/41089 (stdarg pass produces wrong code)Martin Jambor1-1/+7
2009-09-09 Martin Jambor <mjambor@suse.cz> PR tree-optimization/41089 * tree-sra.c (find_var_candidates): Do not consider va_lists in early SRA. From-SVN: r151566
2009-09-07re PR middle-end/41282 (Revision 151394 failed to compile mplayer)Martin Jambor1-19/+23
2009-09-07 Martin Jambor <mjambor@suse.cz> PR middle-end/41282 * tree-sra.c (create_artificial_child_access): Return NULL if build_ref_for_offset fails. (propagate_subacesses_accross_link): Allow build_ref_for_offset and create_artificial_child_access to fail. * testsuite/gcc.c-torture/compile/pr41282.c: New test. From-SVN: r151484
2009-09-04re PR tree-optimization/41112 (ACATS c43205b fails at -O2 (tree-sra))Martin Jambor1-5/+25
2009-09-04 Martin Jambor <mjambor@suse.cz> PR tree-optimization/41112 * tree-sra.c (build_ref_for_offset_1): Signal that we cannot handle variable-bounded arrays. (expr_with_var_bounded_array_refs_p): New function. (analyze_access_subtree): Call expr_with_var_bounded_array_refs_p. * testsuite/gnat.dg/array8.adb: New test. From-SVN: r151420
2009-09-03tree-sra.c (duplicate_expr_for_different_base): Removed.Martin Jambor1-22/+11
2009-09-03 Martin Jambor <mjambor@suse.cz> * tree-sra.c (duplicate_expr_for_different_base): Removed. (create_artificial_child_access): Use build_ref_for_offset instead of duplicate_expr_for_different_base. (propagate_subacesses_accross_link): Likewise. From-SVN: r151394