summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
Commit message (Collapse)AuthorAgeFilesLines
* 2005-04-05 Andrew MacLeod <amacleod@redhat.com>amacleod2005-04-051-15/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Use update_stmt. Use immediate use iterator. (stmt_is_bumper_for_loop): Use immediate use iterator. * predict.c (strip_builtin_expect): Use update_stmt. * tree-cfg.c (update_modified_stmts): New. Call update_stmt_if_modified on all elements of a STATEMENT_LIST. (bsi_insert_before, bsi_insert_after): Call update_modified_stmts. (bsi_remove): Remove imm_use links and mark the stmt as modified. (bsi_replace): Mark stmt as modified and the update it. * tree-complex.c (update_complex_assignment): Call mark_stmt_modified. (expand_complex_libcal): Call update_stmt. (expand_complex_comparison): Call mark_stmt_modified. (expand_complex_operations_1): Call update_stmt_if_modified. (expand_vector_operations_1): Call mark_stmt_modified. * tree-dfa.c (compute_immediate_uses, free_df_for_stmt, free_df, compute_immediate_uses_for_phi, compute_immediate_uses_for_stmt, add_immediate_use, redirect_immediate_use, redirect_immediate_uses, dump_immediate_uses, debug_immediate_uses, dump_immediate_uses_for, debug_immediate_uses_for): Delete. (mark_new_vars_to_rename): Call update_stmt. * tree-dump.c (dump_option_value_in): Add "stmtaddr". * tree-flow-inline.h (modify_stmt): Rename to mark_stmt_modified. Ignore PHI nodes. (unmodify_stmt): Delete. (update_stmt): New. Force an update of a stmt. (update_stmt_if_modified): update a stmt if it is out of date. (get_stmt_operands): Verify stmt is NOT modified. (stmt_modified_p): Update comment. (delink_imm_use): Remove a use node from its immuse list. (link_imm_use_to_list): Link a use node to a specific list. (link_imm_use): Link a node to the correct list. (set_ssa_use_from_ptr): Set a use node to a specific value, and insert it in the correct list, if appropriate. (link_imm_use_stmt): Link a use node, and set the stmt pointer. (relink_imm_use): Link a use node in place of another node in a list. (relink_imm_use_stmt): LInk a node in place of another node, and set the stmt pointer. (end_safe_imm_use_traverse): New. Terminate a safe immuse iterator. (end_safe_imm_use_p): New. Check for the end of a safe immuse iterator. (first_safe_imm_use): New. Initialize a safe immuse iterator. (next_safe_imm_use): New. Proceed to next safe immuse iterator value. (end_readonly_imm_use_p): New. Check for end of a fast immuse iterator. (first_readonly_imm_use): New. Initialize a fast immuse iterator. (next_readonly_imm_use): New. Get the next fast immuse iterator value. (has_zero_uses): New. Return true if there are no uses of a var. (has_single_use): New. Return true if there is only a single use of a variable. (single_imm_use): New. Return the simgle immediate use. (num_imm_uses): New. Return the number of immediate uses. (get_v_must_def_ops): Use is now a pointer. (use_operand_p, get_v_may_def_op_ptr, get_vuse_op_ptr, get_v_must_def_kill_ptr, get_phi_arg_def_ptr): Return the address of the use node. (get_immediate_uses, num_immediate_uses, immediate_use): Delete. (delink_stmt_imm_use): Delink all immuses from a stmt. (phi_arg_index_from_use): New. Return a phi arg index for a use. * tree-flow.h (struct dataflow_d): Delete. (immediate_use_iterator_d): New. Immediate use iterator struct. (FOR_EACH_IMM_USE_FAST): New. Macro for read only immuse iteration. (FOR_EACH_IMM_USE_SAFE): New. Macro for write-safe immuse iteration. (BREAK_FROM_SAFE_IMM_USE): New. Macro for earlyu exit from write-safe iteration. (struct stmt_ann_d): Remove dataflow_t from struct. * tree-if-conv.c (tree_if_conversion). Don't call free_df. (if_convertible_phi_p): Use FAST immuse iterator. (if_convertible_loop_p): Don't call compute_immediate_uses. (replace_phi_with_cond_modify_expr): Call update_stmt. * tree-into-ssa.c (mark_def_sites, ssa_mark_def_sites): Call update_stmt_if_modified. (rewrite_all_into_ssa): Initialize ssa operands. * tree-loop-linear.c (linear_transform_loops): Don't call free_df or compute_immediate_uses. * tree-optimize.c (execute_todo): Call verify_ssa whenever the ssa_property is available. (execute_one_pass): Change parameters passed to execute_todo. * tree-outof-ssa.c (rewrite_trees): Don't call modify_stmt. (remove_ssa_form): Call fini_ssa_operands. (insert_backedge_copies): Delete call to modify_stmt. * tree-phinodes.c (make_phi_node): Initialize use nodes. (release_phi_node): Delink any use nodes before releasing. (resize_phi_node): Relink any use nodes. (remove_phi_arg_num): Delink the use node. (remove_phi_node): Release the ssa_name AFTER releasing the phi node. (remove_all_phi_nodes_for): Release phi node first. * tree-pretty-print.c (dump_generic_node): Print stmt address. * tree-sra.c (mark_all_v_defs): Call update_stmt_if_modified. (scalarize_use, scalarize_copy): Call update_stmt. * tree-ssa-alias.c (compute_may_aliases): Update all modified stmts. (compute_points_to_and_addr_escape): Call mark_stmt_modified. * tree-ssa-cpp.c (need_imm_uses_for): Delete. (ccp_initialize): Remove call to compute_immediate_uses. (substitute_and_fold, execute_fold_all_builtins): Call update_stmt. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Update all modified stmts. (simplify_cond_and_lookup_avail_expr): Call mark_stmt_modified. (simplify_switch_and_lookup_avail_expr): Call mark_stmt_modified. (eliminate_redundant_computations): Call mark_stmt_modified. (cprop_operand): Call mark_stmt_modified. (optimize_stmt): Call update_stmt_if_modified and mark_stmt_modified. * tree-ssa-dse.c (fix_phi_uses, fix_stmt_v_may_defs): Delete. (dse_optimize_stmt): Use new immuse interface. (tree_ssa_dse): Remove calls to compute_immediate_uses and free_df. * tree-ssa-forwprop.c (need_imm_uses_for): Delete. (substitute_single_use_vars): Use new immuse interface. (tree_ssa_forward_propagate_single_use_vars): Remove calls to free_df and compute_immediate_uses. * tree-ssa-loop-im.c (single_reachable_address): Use new immuse interface. (rewrite_mem_refs): Call update_stmt. (determine_lsm): Remove call to compute_imm_uses and free_df. * tree-ssa-loop-ivcanon.c (create_canonical_iv): Call update_stmt. (try_unroll_loop_completely): Call update_stmt. * tree-ssa-loop-ivopts.c (rewrite_address_base): Call update_stmt. (rewrite_use_compare): Call update_stmt. (compute_phi_arg_on_exit): Insert each stmt before trying to process. (rewrite_use) : Call update_stmt. * tree-ssa-loop-manip.c (verify_loop_closed_ssa): Add arg to call. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Call update_stmt. * tree-ssa-operands.c (NULL_USE_OPERAND_P): Remove declaration. (allocate_use_optype, allocate_vuse_optype): Adjust allocation size. (free_uses, free_vuses, free_v_may_defs, free_v_must_defs): Delink use nodes. (initialize_vuse_operand): New. Initialize a vuse operand. (initialize_v_may_def_operand): New. Initialize a maydef operand. (initialize_v_must_def_operand): New. Initialize a mustdef operand. (finalize_ssa_defs): Use stmt parameter. (correct_use_link): Ensure a use node is in the correct list, and has the correct stmt pointer. (finalize_ssa_uses, finalize_ssa_v_may_defs, finalize_ssa_vuses, finalize_ssa_v_must_defs): Also initialize use nodes. (finalize_ssa_stmt_operands): Pass extra stmt operands. (build_ssa_operands): Seperate parsing from final operand construction. (parse_ssa_operands): New. Parse entry point for operand building. (swap_tree_operands): New. Swap 2 tree operands. (update_stmt_operands): Ranamed from get_stmt_operands. Always builds operands. (get_expr_operands): Call swap_tree_operands when needed. (copy_virtual_operands): Use initialize routines for virtual use ops. (create_ssa_artficial_load_stmt): Add extra stmt parameter. (verify_abort): New. Issue imm_use error. (verify_imm_links): New Verify imm_use links for a var. (dump_immediate_uses_for): New. Dump imm_uses for a var to file. (dump_immediate_uses): New. Dump imm_uses for all vars to file. (debug_immediate_uses): New. Dump imm_uses for all vars to stderr. (debug_immediate_uses_for): New. Dump imm_uses for a var to stderr. * tree-ssa-operands.h (struct use_operand_ptr): Delete. (NULL_USE_OPERAND_P) Define. (use_optype_d, v_def_use_operand_type, vuse_optype_d): Add immediate use node. (struct vuse_operand_type): New struct. (SET_USE): Call set_ssa_use_from_ptr. (USE_STMT): Define. (PHI_ARG_INDEX_FROM_USE): Define. * tree-ssa-phiopt.c (replace_phi_edge_with_variable): Set the phi argument via SET_USE, not PHI_ARG_DEF_TREE. * tree-ssa-pre.c (eliminate): Call update_stmt. * tree-ssa-propagate.c (cfg_blocks_get): Use imm_use iterators. Don't call free_df. * tree-ssa-sink.c (all_immediate_uses_same_place): Use imm_use iterator. (nearest_common_dominator_of_uses): Use imm_use iterator. (statement_sink_location): Use imm_use iterator and interface. (execute_sink_code): Don't call compute_immediate_uses or free-df. * tree-ssa-threadupdate.c (create_edge_and_update_destination_phis): Use PHI_ARG_DEF, not PHI_ARG_DEF_TREE. * tree-ssa.c (verify_use, verify_phi_args): Verify some imm_use info. (verify_ssa): Ensure no stmt is marked modify after optimization pass if new parameter is true. (init_tree_ssa): Don't initialize operand cache here. (delete_tree_ssa): Don't destroy operand cache here. (propagate_into_addr): Pass in a use pointer, return true if anything was changed. (replace_immediate_uses): Use imm_use iterator, call update_stmt. (check_phi_redundancy): Use imm_use iterator. (kill_redundant_phi_nodes): Don't call compute_immediate_uses or free_df. * tree-ssanames.c (make_ssa_name): Initialize imm_use node. (release_ssa_name): Delink node and all elements in its imm_use list. * tree-tailcall.c (adjust_return_value): Call update_stmt. * tree-vect-analyze.c (vect_stmt_relevant_p): Use imm_use iterator. * tree-vectorizer.c (need_imm_uses_for): Delete. (vectorize_loops): Dont call compute_immediate_uses or free_df. * tree.h (struct ssa_imm_use_d): Define. (SSA_NAME_IMM_USE_NODE): Define. (struct tree_ssa_name): Add imm_use node. (PHI_DF): Delete. (PHI_ARG_IMM_USE_NODE): Define. (struct phi_arg_d): Add imm_use node. (struct tree_phi_node): Remove struct dataflow_d element. (TDF_STMTADDR): Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97648 138bc75d-0d04-0410-961f-82ee72b054a4
* * params.c (set_param_value): Use gcc_assert & gcc_unreachable.nathan2005-04-031-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | * passes.c (open_dump_file, rest_of_handle_final): Likewise. * postreload-gcse.c (expr_equiv_p, oprs_unchanged_p, hash_scan_set, reg_set_between_after_reload_p, reg_used_between_after_reload_p, get_avail_load_store_reg, eliminate_partially_redundant_load): Likewise. * postreload.c (reload_cse_simplify_set, reload_combine_note_use): Likewise. * predict.c (predict_insn, expected_value_to_br_prob, propagate_freq, expensive_function_p): Likewise. * print-rtl.c (print_rtx): Likewise. * profile.c (instrument_edges, instrument_values, compute_branch_probabilities, branch_prob, union_groups, tree_register_profile_hooks, rtl_register_profile_hooks): Likewise. * protoize.c (in_system_include_dir, file_could_be_converted, file_normally_convertible, gen_aux_info_file, seek_to_line, do_cleaning): Likewise. * tree-ssa-alias.c (collect_points_to_info_r): Likewise. * tree-ssa-ccp.c (execute_fold_all_builtins): Likewise. * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97485 138bc75d-0d04-0410-961f-82ee72b054a4
* * cgraphunit.c, dbxout.c, flow.c, gcse.c, gimplify.c,kazu2005-04-011-1/+1
| | | | | | | | | | | | | | | lambda-code.c, loop.c, machmode.def, mips-tfile.c, modulo-sched.c, passes.c, postreload-gcse.c, tree-eh.c, tree-ssa-ccp.c, varasm.c, config/frv/frv.c, config/frv/frv.h, config/frv/frv.md, config/i386/i386.c, config/i386/i386.h, config/i386/i386.md, config/rs6000/predicates.md, config/rs6000/rs6000.c, config/s390/fixdfdi.h, config/s390/s390.c, config/stormy16/stormy16.c, config/stormy16/stormy16.md, config/vax/vax.md: Fix comment typos. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97362 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.c (fold_builtin): Take decomposed arguments ofkazu2005-03-211-4/+7
| | | | | | | | | | | CALL_EXPR. * fold-const.c (fold_ternary): Update a call to fold_builtin. * gimplify.c (gimplify_call_expr): Likewise. * tree-ssa-ccp.c (ccp_fold, ccp_fold_builtin): Likewise. * tree.h: Update the prototype of fold_builtin. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96800 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.c (expand_movstr): Update a call tokazu2005-03-161-2/+10
| | | | | | | | | | | | | | | | fold_builtin_strcpy. (expand_builtin_strncpy): Update a call to fold_builtin_strncpy. (fold_builtin_strcpy, fold_builtin_strncpy): Take decomosed arguments of CALL_EXPR. (fold_builtin_1): Update calls to fold_builtin_strcpy and fold_builtin_strncpy. * tree-ssa-ccp.c (ccp_fold_builtin): Likewise. * tree.h: Update the prototypes of fold_builtin_strcpy and fold_builtin_strncpy. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96555 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree-ssa-ccp.c (visit_assignment): Verify that result ofkenner2005-02-241-6/+12
| | | | | | | VIEW_CONVERT_EXPR is_gimple_min_invariant. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95510 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-02-18 James A. Morrison <phython@gcc.gnu.org>phython2005-02-191-6/+4
| | | | | | | | * tree-ssa-ccp.c (widen_bitfield): Pass type to build_int_cst and don't call fold_convert. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95260 138bc75d-0d04-0410-961f-82ee72b054a4
* * bitmap.h (BITMAP_XMALLOC, BITMAP_XFREE): Remove.nathan2005-02-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bb-reorder.c (duplicate_computed_gotos): Use BITMAP_ALLOC and BITMAP_FREE. * bt-load.c (btr_def_live_range, combine_btr_defs, migrate_btr_def, migrate_btr_defs): Likewise. * cfgcleanup.c (thread_jump): Likewise. * cfgloop.c (get_loop_body_in_bfs_order): Likewise. * df.c (df_insn_table_realloc, df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_free, df_du_chain_create, df_bb_rd_local_compute, df_rd_local_compute, df_reg_info_compute): Likewise. * dominance.c (init_dom_info, free_dom_info): Likewise. * flow.c (init_propagate_block_info, free_propagate_block_info): Likewise. * gcse.c (alloc_gcse_mem, free_gcse_mem): Likewise. * global.c (allocate_bb_info, free_bb_info, calculate_reg_pav, modify_reg_pav): Likewise. * loop-invariant.c (find_defs, find_invariant_insn, find_invariants, free_inv_motion_data): Likewise. * predict.c (tree_predict_by_opcode, estimate_bb_frequencies): Likewise. * stmt.c (expand_case): Likewise. * tree-cfg.c (tree_duplicate_sese_region): Likewise. * tree-dfa.c (mark_new_vars_to_rename): Likewise. * tree-if-conv.c (get_loop_body_in_if_conv_order): Likewise. * tree-into-ssa.c (insert_phi_nodes_for, def_blocks_free, get_def_blocks_for, mark_def_site_blocks, rewrite_into_ssa, rewrite_ssa_into_ssa): Likewise. * tree-optimize.c (tree_rest_of_compilation): Likewise. * tree-outof-ssa.c (new_temp_expr_table, free_temp_expr_table, analyze_edges_for_bb, perform_edge_inserts): Likewise. * tree-scalar-evolution.c (scev_initialize, scev_finalize): Likewise. * tree-sra.c (tree_sra): Likewise. * tree-ssa-alias.c (init_alias_info, delete_alias_info): Likewise. * tree-ssa-ccp.c (ccp_fold_builtin): Likewise. * tree-ssa-dce.c (tree_dce_init, tree_dce_done): Likewise. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise. * tree-ssa-dse.c (tree_ssa_dse): Likewise. * tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_var): Likewise. * tree-ssa-live.c (new_tree_live_info, delete_tree_live_info, calculate_live_on_entry, calculate_live_on_exit, build_tree_conflict_graph): Likewise. * tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_init, record_use, record_important_candidates, set_use_iv_cost, find_depends, determine_use_iv_costs, iv_ca_new, iv_ca_free, free_loop_data, tree_ssa_iv_optimize_finalize): Likewise. * tree-ssa-loop-manip.c (add_exit_phis_var, get_loops_exit, find_uses_to_rename_use, rewrite_into_loop_closed_ssa, tree_duplicate_loop_to_header_edge): Likewise. * tree-ssa-pre.c (init_pre, fini_pre): Likewise. * tree-ssa.c (verify_flow_insensitive_alias_info, verify_name_tags, verify_ssa, init_tree_ssa, delete_tree_ssa): Likewise. * tree-ssanames.c (marked_ssa_names, init_ssanames, fini_ssanames): Likewise. * tree-vectorizer.c (slpeel_tree_peel_loop_to_edge): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95172 138bc75d-0d04-0410-961f-82ee72b054a4
* * cfganal.c, real.h, reorg.c, timevar.def, tree-ssa-ccp.c,kazu2005-01-221-1/+2
| | | | | | | | | | config/alpha/alpha-protos.h, config/alpha/alpha.h, config/alpha/alpha.md, config/alpha/predicates.md, config/sparc/freebsd.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h: Update copyright. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94064 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree-ssa-ccp.c (maybe_fold_offset_to_component_ref): Always subtractrakdver2005-01-191-28/+23
| | | | | | | the offset of the selected field. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93918 138bc75d-0d04-0410-961f-82ee72b054a4
* PR/18662, also backported from tree-cleanup-branch.kenner2004-11-291-7/+9
| | | | | | | | * tree-ssa-ccp.c (substitute_and_fold): If replaced anything, always call maybe_clean_eh_stmt and modify_stmt. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91451 138bc75d-0d04-0410-961f-82ee72b054a4
* PR/18664kenner2004-11-291-8/+22
| | | | | | | | | | * tree-ssa-operands.c (build_ssa_operands, case MODIFY_EXPR): Ignore a VIEW_CONVERT_EXPR on LHS when deciding if must or may def. * tree-ssa-ccp.c (visit_assignment): If LHS is a VIEW_CONVERT_EXPR, add an inverse VIEW_CONVERT_EXPR to const_val. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91450 138bc75d-0d04-0410-961f-82ee72b054a4
* * fold-const.c (nondestructive_fold_binary_to_constant): Renamesayle2004-11-231-6/+2
| | | | | | | | | | | | | | | | | | | | to fold_binary_to_constant. (nondestructive_fold_unary_to_constant): Likewise, rename to fold_unary_to_constant. (fold_relational_hi_lo): Update call to fold_binary_to_constant. * tree.h (nondestructive_fold_binary_to_constant): Update prototype. (nondestructive_fold_unary_to_constant): Likewise. * tree-ssa-ccp.c (ccp_fold): Update calls to fold_unary_to_constant and fold_binary_to_constant. * tree-ssa-loop-niter.c (EXEC_BINARY, EXEC_UNARY): Delete macros. (inverse, number_of_iterations_cond): Replace uses of EXEC_BINARY and EXEC_UNARY with calls to fold_*nary_to_constant. * tree-ssa-loop-ivopts.c (EXEC_BINARY, EXEC_UNARY): Delete macros. (idx_find_step): Replace uses of EXEC_BINARY with calls to fold_binary_to_constant. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91063 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-11-16 Daniel Berlin <dberlin@dberlin.org>dberlin2004-11-171-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fix PR tree-optimization/18519 * tree-optimize (execute_todo): Add case for TODO_cleanup_cfg. * tree-pass.h: Add TODO_cleanup_cfg. * tree-ssa-ccp.c (pass_ccp): Use TODO_cleanup_cfg. (ccp_finalize): Remove call to cleanup_cfg. * tree-ssa-dce.c (pass_dce): Use TODO_cleanup_cfg and TODO_dump_func. (pass_cd_dce): Ditto. (perform_tree_ssa_dce): Remove call to cleanup_cfg, dump_function_to_file. * tree-ssa-loop-ch.c (copy_loop_headers): Remove call to cleanup_cfg. (pass_ch): Add TODO_cleanup_cfg. * tree-ssa-loop.c (tree_ssa_loop_done): Remove call to cleanup_cfg. (pass_loop_done): Add TODO_cleanup_cfg. * tree-ssa-phiopt.c (pass_phiopt): Ditto. (tree_ssa_phiopt): Remove call to cleanup_cfg. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90783 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree-cfg.c (find_taken_edge): Reject VAL begin NULL.kazu2004-11-041-1/+1
| | | | | | | | * tree-ssa-ccp.c (visit_cond_stmt): Don't call find_taken_edge with VAL being NULL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90083 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-10-27 Daniel Berlin <dberlin@dberlin.org>dberlin2004-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix PR tree-optimization/17133 * tree-cfg.c (rewrite_to_new_ssa_names_bb): Also rewrite must def kill operand. * tree-flow-inline.h: V_MUST_DEF_OP became V_MUST_DEF_RESULT. (get_v_must_def_result_ptr): Modify for new structure of v_must_defs array. (get_v_must_def_kill_ptr): New. (op_iter_next_use): Add support for the kill that occurs in V_MUST_DEFs. (op_iter_next_tree): Ditto. Also V_MAY_DEF_OP became V_MAY_DEF_RESULT. (op_iter_next_def): V_MAY_DEF_OP became V_MAY_DEF_RESULT. (op_iter_init): Initialize new mustu members. (op_iter_next_mustdef): New function. (op_iter_init_mustdef): Ditto. * tree-flow.h (rewrite_def_def_chains): New function. * tree-into-ssa.c (mark_def_sites): Handle mustdefkill operands. (ssa_mark_def_sites): Ditto. (rewrite_stmt): Ditto. (ssa_rewrite_stmt): Ditto. (rewrite_blocks): Factor out from rewrite_into_ssa. (mark_def_block_sites): Ditto. (rewrite_def_def_chains): New function, just rewrites def-def chains without phi node insertion. * tree-pass.h (TODO_fix_def_def_chains): New todo flag. * tree-optimize.c (execute_todo): Handle TODO_fix_def_def_chains. * tree-pretty-print.c (dump_vops): Print out MUST_DEF's so that they include the rhs now. * tree-ssa-ccp.c (visit_assignment): V_MUST_DEF_OP became V_MUST_DEF_RESULT. * tree-ssa-dce.c (mark_operand_necessary): Add phionly argument. Update callers. (mark_really_necessary_kill_operand_phis): New function. (perform_tree_ssa_dce): Call it. (pass_dce): Add TODO_fix_def_def_chains. (pass_cd_dce): Ditto. * tree-ssa-loop-im.c (determine_max_movement): Look at kills as well. (rewrite_mem_refs): Ditto. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt): Look at kills as well. * tree-ssa-operands.c (allocate_v_may_def_optype): v_may_def_operand_type_t became v_def_use_operand_type_t. (allocate_v_must_def_optype) Ditto. (finalize_ssa_v_must_defs): Update for new operand type, as well as setting the use portion as well. (copy_virtual_operands): Copy the kill operand as well. (create_ssa_artficial_load_stmt): V_MUST_DEF_OP became V_MUST_DEF_RESULT. * tree-ssa-operands.h (v_may_def_operand_type): Renamed to v_def_use_operand_type. (v_must_def_optype_d): Use v_def_use_operand_type. (V_MUST_DEF_OP_*): Renamed to V_MUST_DEF_RESULT_* (V_MUST_DEF_KILL_*): New macros. (struct ssa_operand_iterator_d): Add num_v_mustu and v_mustu_i members. Rename existing must_i and num_v_must members to mustd_i and num_v_mustd. (SSA_OP_VMUSTDEFKILL): New flag. (SSA_OP_VIRTUAL_KILLS): New flag. (SSA_OP_ALL_OPERANDS): Add in SSA_OP_ALL_KILLS. (SSA_OP_ALL_KILLS): New flag. (FOR_EACH_SSA_MUSTDEF_OPERAND): New macro. * tree-ssa.c (verify_ssa): Verify virtual kills as well. * tree-vectorizer.c (vect_create_data_ref_ptr): V_MUST_DEF_OP became V_MUST_DEF_RESULT. (rename_variables_in_bb): Rename kill pointer as well. * tree-dfa.c (compute_immediate_uses_for_stmt): Add kills into the immediate uses. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89695 138bc75d-0d04-0410-961f-82ee72b054a4
* PR tree-optimization/17697jakub2004-09-291-0/+8
| | | | | | | | | | | | * tree-ssa-ccp.c (execute_fold_all_builtins): Update eh and cleanup cfg if needed. * g++.dg/opt/pr17697-1.C: New test. * g++.dg/opt/pr17697-2.C: New test. * g++.dg/opt/pr17697-3.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88277 138bc75d-0d04-0410-961f-82ee72b054a4
* PR 15089rth2004-09-291-9/+14
| | | | | | | | | | * tree-ssa-copy.c (may_propagate_copy_into_asm): New. * tree-flow.h (may_propagate_copy_into_asm): Declare. * tree-ssa-ccp.c (replace_uses_in): Use it. * tree-ssa-dom.c (cprop_operand): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88269 138bc75d-0d04-0410-961f-82ee72b054a4
* PR tree-optimization/17474rakdver2004-09-251-3/+5
| | | | | | | | * tree-ssa-ccp.c (maybe_fold_offset_to_component_ref): Determine offset of the field correctly when DECL_FIELD_BIT_OFFSET != 0. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88095 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-09-23 Diego Novillo <dnovillo@redhat.com>jakub2004-09-231-3/+41
| | | | | | | | | | | | | | | | | | | | Jakub Jelinek <jakub@redhat.com> * tree-flow.h (find_new_referenced_vars): Add prototype. * tree-sra.c (find_new_referenced_vars_1, find_new_referenced_vars): Move to... * tree-dfa.c (find_new_referenced_vars_1, find_new_referenced_vars): ... here. (mark_new_vars_to_rename): Walk through all operands. * tree-ssa-ccp.c (convert_to_gimple_builtin): New function. (execute_fold_all_builtins): Use it. (pass_fold_builtins): Add TODO_rename_vars to todo_flags_finish. * gcc.c-torture/execute/builtins/strcpy-2.c: New test. * gcc.c-torture/execute/builtins/strcpy-2-lib.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87983 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree-ssa-ccp.c (get_default_value): Use SSA_NAME_VALUE ratherlaw2004-09-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | than SSA_NAME_EQUIV and SET_SSA_NAME_EQUIV. (substitute_and_fold): Likewise. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Remove everything except invariants from SSA_NAME_VALUE. (thread_across_edge): Use SSA_NAME_VALUE rather than SSA_NAME_EQUIV and SET_SSA_NAME_EQUIV. (restore_vars_to_original_value, record_const_or_copy): Likewise. (record_equivalences_from_phis, record_const_or_copy_1): Likewise. (record_equality, cprop_into_successor_phis): Likewise. (record_equivalences_from_stmt, cprop_operand): Likewise. (lookup_avail_expr): Likewise. * tree-ssa-pre.c (fini_pre): Remove everything except invariants from SSA_NAME_VALUE. * tree.h (SSA_NAME_EQUIV, SET_SSA_NAME_EQUIV): Kill. (struct tree_ssa_name): Kill EQUIV field. Remove GGC skip annotation from the VALUE_HANDLE field. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87979 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree-ssa-ccp.c (get_default_value): If we have a constantlaw2004-09-221-1/+28
| | | | | | | | | | | | | value recorded for an SSA_NAME, then use that constant as the initial lattice value. (substitute_and_fold): Transfer equivalences discovered into SSA_NAME_EQUIV. * tree.h (SSA_NAME_EQUIV): Add comments. (SET_SSA_NAME_EQUIV): Similarly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87844 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-09-17 Jeffrey D. Oldham <oldham@codesourcery.com>zack2004-09-171-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Zack Weinberg <zack@codesourcery.com> * alias.c (find_base_decl): Remove unreachable case '3' block. * expr.c (safe_from_p): Abort if passed a type. * tree-gimple.c (recalculate_side_effects): Abort if passed anything other than an expression. * tree-ssa-pre.c (phi_translate): Return expr immediately if is_gimple_min_invariant is true for it. Reorder cases for clarity. Abort on un-handled tree classes. (valid_in_set): Likewise. * tree.c (tree_code_class_strings): New static data. * tree.h (enum tree_code_class): New. (tree_code_class_strings): Declare. (TREE_CODE_CLASS_STRING, EXCEPTIONAL_CLASS_P, CONSTANT_CLASS_P) (REFERENCE_CLASS_P, COMPARISON_CLASS_P, UNARY_CLASS_P, BINARY_CLASS_P) (STATEMENT_CLASS_P, EXPRESSION_CLASS_P, IS_TYPE_OR_DECL_P): New macros. (TYPE_P, DECL_P, IS_NON_TYPE_CODE_CLASS, IS_EXPR_CODE_CLASS) (checking macros, EXPR_LOCATION, SET_EXPR_LOCATION, EXPR_LOCUS): Update. * tree.def, c-common.def, objc/objc-tree.def: Use tree_code_class enumeration constants instead of code letters. * alias.c, builtins.c, c-common.c, c-format.c, c-lang.c, c-pragma.c * c-typeck.c, cgraphunit.c, convert.c, dbxout.c, dwarf2out.c * emit-rtl.c expr.c, fold-const.c, gimplify.c, lambda-code.c * langhooks.c, langhooks.h, predict.c, print-tree.c, reload1.c, stmt.c * tree-browser.c, tree-cfg.c, tree-chrec.c, tree-complex.c, tree-dfa.c * tree-dump.c, tree-eh.c, tree-gimple.c, tree-inline.c, tree-nested.c * tree-outof-ssa.c, tree-pretty-print.c, tree-sra.c, tree-ssa-ccp.c * tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-forwprop.c, tree-ssa-live.c * tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-operands.c * tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-propagate.c * tree-ssa.c, tree-ssanames.c, tree-tailcall.c, tree.c, varasm.c * config/sol2-c.c, config/arm/arm.c, config/i386/winnt.c * config/pa/pa.c, config/pa/pa.h, config/sh/sh.c, objc/objc-lang.c Update to match. * LANGUAGES: Add note about change. ada: * ada-tree.def: Use tree_code_class enumeration constants instead of code letters. * ada-tree.h, decl.c, misc.c, trans.c, utils.c, utils2.c: Update for new tree-class enumeration constants. cp: * cp-tree.def: Use tree_code_class enumeration constants instead of code letters. * call.c, class.c, cp-gimplify.c, cp-lang.c, cxx-pretty-print.c * mangle.c, pt.c, semantics.c, tree.c, typeck.c: Update for new tree-class enumeration constants. fortran: * f95-lang.c, trans-expr.c, trans.c: Update for new tree-class enumeration constants. java: * java-tree.def: Use tree_code_class enumeration constants instead of code letters. * java-gimplify.c, jcf-write.c, lang.c, parse.y: Update for new tree-class enumeration constants. treelang: * treetree.c: Update for new tree-class enumeration constants. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87675 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree-outof-ssa.c (free_temp_expr_table): Add missed assert.nathan2004-09-091-2/+2
| | | | | | | | * tree-ssa-ccp.c (set_lattice_value): Correct missapplied de Morgan's theorem in last checkin. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87226 138bc75d-0d04-0410-961f-82ee72b054a4
* * targhooks.c (default_unwind_emit, default_scalar_mode_supported_p):nathan2004-09-091-42/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use gcc_assert, gcc_unreachable & internal_error instead of abort. * timevar.c (timevar_push, timevar_pop, timevar_start, timevar_stop): Likewise. * toplev.c (default_pch_valid_p): Likewise. * tracer.c (tail_duplicate): Likewise. * tree-alias-common.c (get_alias_var_decl, get_values_from_constructor, create_alias_var, delete_alias_vars, empty_points_to_set, same_points_to_set, ptr_may_alias_var): Likewise. * tree.c (tree_size, make_node_stat, copy_node_stat, build_int_cst_wide, integer_all_onesp, list_length, chainon, tree_node_structure, type_contains_placeholder_p, substitute_in_expr, substitute_placeholder_in_expr, tabilize_reference_1, build0_stat, build1_stat, build2_stat, build3_stat, build4_stat, is_attribute_p, lookup_attribute, type_hash_canon, host_integerp, iterative_hash_expr, build_method_type_directly, decl_type_context, get_callee_fndecl, get_set_constructor_bits, build_vector_type_for_mode, int_cst_value, tree_fold_gcd): Likewise. * tree-cfg.c (create_bb, make_ctrl_stmt_edges, make_exit_edges, make_cond_expr_edges, group_case_labels, tree_merge_blocks, cleanup_control_expr_graph, find_taken_edge, find_taken_edge_switch_expr, phi_alternatives_equal, is_ctrl_altering_stmt, disband_implicit_edges, set_bb_for_stmt, stmt_for_bsi, tree_find_edge_insert_loc, bsi_insert_on_edge_immediate, tree_split_edge, tree_verify_flow_info, thread_jumps, tree_redirect_edge_and_branch, tree_flow_call_edges_add): Likewise. * tree-chrec.c (chrec_fold_poly_cst, chrec_fold_plus_poly_poly, chrec_fold_multiply_poly_poly): Likewise. * tree-complex.c (extract_component, expand_complex_division, expand_complex_comparison, expand_complex_operations_1, build_replicated_const, expand_vector_operations_1): Likewise. * tree-data-ref.c (tree_fold_bezout, build_classic_dist_vector, build_classic_dir_vector): Likewise. * tree-dfa.c (compute_immediate_uses_for_phi, compute_immediate_uses_for_stmt, create_var_ann, create_stmt_ann, create_tree_ann, collect_dfa_stats, get_virtual_var): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * tree-eh.c (record_stmt_eh_region, add_stmt_to_eh_region, record_in_finally_tree, replace_goto_queue_1, maybe_record_in_goto_queue, verify_norecord_switch_expr, do_return_redirection): Likewise. * tree-if-conv.c (tree_if_convert_stmt, tree_if_convert_cond_expr, add_to_dst_predicate_list, find_phi_replacement_condition, replace_phi_with_cond_modify_expr, get_loop_body_in_if_conv_order): Likewise. * tree-inline.c (remap_decl, remap_type, remap_decls, copy_body_r, initialize_inlined_parameters, declare_return_variable, estimate_num_insns_1, expand_call_inline, expand_calls_inline, optimize_inline_calls, copy_tree_r): Likewise. * tree-into-ssa.c (rewrite_initialize_block_local_data, rewrite_stmt, ssa_rewrite_stmt, rewrite_into_ssa): Likewise. * tree-iterator.c (alloc_stmt_list, tsi_link_before, tsi_link_after, tsi_split_statement_list_after, tsi_split_statement_list_before): Likewise. * tree-mudflap.c (mf_varname_tree): Likewise. * tree-nested.c (create_tmp_var_for, lookup_field_for_decl, lookup_tramp_for_decl, convert_all_function_calls): Likewise. * tree-optimize.c (tree_rest_of_compilation): Likewise. * tree-outof-ssa.c (create_temp, eliminate_build, eliminate_phi, coalesce_abnormal_edges, coalesce_ssa_name, eliminate_virtual_phis, free_temp_expr_table, add_dependance, finish_expr, rewrite_trees): Likewise. * tree-phinodes.c (resize_phi_node, add_phi_arg, remove_all_phi_nodes_for): Likewise. * tree-pretty-print.c (op_prio, print_call_name): Likewise. * tree-profile.c (tree_gen_interval_profiler, tree_gen_pow2_profiler, tree_gen_one_value_profiler, tree_gen_const_delta_profiler): Likewise. * tree-sra.c (type_can_instantiate_all_elements, sra_hash_tree, sra_elt_eq, sra_walk_expr, instantiate_missing_elements, generate_one_element_ref, generate_element_copy, generate_element_zero, scalarize_copy, scalarize_init, scalarize_ldst): Likewise. * tree-ssa-alias.c (delete_alias_info, group_aliases, may_alias_p, add_may_alias, add_pointed_to_expr, add_pointed_to_var, collect_points_to_info_r, get_tmt_for, get_ptr_info): Likewise. * tree-ssa.c (walk_use_def_chains, check_phi_redundancy): Likewise. * tree-ssa-ccp.c (dump_lattice_value, get_default_value, get_value, set_lattice_value, likely_value, ccp_visit_phi_node, visit_assignment, widen_bitfield, ccp_fold_builtin): Likewise. * tree-ssa-copy.c (may_propagate_copy, merge_alias_info, replace_exp_1, propagate_tree_value): Likewise. * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise. * tree-ssa-dce.c (set_control_dependence_map_bit, find_control_dependence, find_pdom, mark_operand_necessary, mark_stmt_if_obviously_necessary, mark_control_dependent_edges_necessary, remove_dead_stmt): Likewise. * tree-ssa-dom.c (dom_opt_initialize_block_local_data, simplify_switch_and_lookup_avail_expr, cprop_into_successor_phis, eliminate_redundant_computations, avail_expr_eq): Likewise. * tree-ssa-dse.c (fix_stmt_v_may_defs): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p, duplicate_blocks): Likewise. * tree-ssa-loop-im.c (for_each_index, set_level, is_call_clobbered_ref): Likewise. * tree-ssa-loop-ivopts.c (dump_use, divide, stmt_after_ip_normal_pos, stmt_after_increment, set_iv, contains_abnormal_ssa_name_p, find_interesting_uses_outer_or_nonlin, add_derived_ivs_candidates, peel_address, ptr_difference_cost, may_replace_final_value, determine_use_iv_cost, rewrite_use_nonlinear_expr, rewrite_use_outer, rewrite_use, rewrite_uses): Likewise. * tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa, check_loop_closed_ssa_use): Likewise. * tree-ssanames.c (make_ssa_name): Likewise. * tree-ssa-operands.c (finalize_ssa_defs, finalize_ssa_uses, finalize_ssa_v_must_defs, finalize_ssa_stmt_operands, get_stmt_operands, get_expr_operands, get_asm_expr_operands, get_indirect_ref_operands, add_stmt_operand): Likewise. * tree-ssa-pre.c (value_exists_in_set_bitmap, value_remove_from_set_bitmap, bitmap_insert_into_set, insert_into_set, phi_translate, valid_in_set, compute_antic, find_or_generate_expression, create_expression_by_pieces, insert_aux, create_value_expr_from, eliminate): Likewise. * tree-ssa-propagate.c (cfg_blocks_get): Likewise. * tree-ssa-threadupdate.c (remove_last_stmt_and_useless_edges): Likewise. * tree-tailcall.c (independent_of_stmt_p, adjust_return_value, eliminate_tail_call): Likewise. * tree-vectorizer.c (vect_create_index_for_array_ref, vect_align_data_ref, vect_create_data_ref, vect_create_destination_var, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vect_transform_stmt, vect_transform_loop_bound, vect_transform_loop, vect_analyze_operations): Likewise. * tree-vn.c (vn_compute, set_value_handle, get_value_handle): Likewise. * tree-flow-inline.h (var_ann, get_var_ann, get_def_from_ptr, get_use_op_ptr, immediate_use, phi_ssa_name_p, bsi_start, bsi_after_labels, bsi_last): Likewise. * tree-ssa-live.c (var_union, change_partition_var, create_ssa_var_map, calculate_live_on_entry, root_var_init, type_var_init, add_coalesce, sort_coalesce_list, pop_best_coalesce): Likewise. * tree-ssa-live.h (partition_is_global, live_entry_blocks, tpa_find_tree): Likewise. (register_ssa_partition_check): Declare. (register_ssa_partition): use it. * tree-ssa-live.c: Include errors.h. (register_ssa_partition_check): New. * tree-ssa-operands.c: Include errors.h. * Makefile.in (tree-ssa-operands.o): Depend on errors.h. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87223 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-09-06 Paolo Bonzini <bonzini@gnu.org>bonzini2004-09-061-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unify the management of RTL and tree-level dump files. * cfgexpand.c (tree_expand_cfg): Fix incorrect comment. Don't print function name to the dump file, the pass manager would do this for us. Add code from the top of rest_of_compilation, up to the initial RTL dump. * passes.c (rest_of_handle_jump): Call fixup_tail_calls and close the DFI_sibling dump file. (rest_of_compilation): Don't do that here. Remove code up to the initial RTL dump. (init_optimization_passes): Remove. (pass_rest_of_compilation): Change pass name to NULL. * toplev.c (lang_dependent_init): Do not use an empty dump file prefix. Do not call init_optimization_passes. * toplev.h (init_optimization_passes): Remove. * graph.c (print_rtl_graph_with_bb, clean_graph_dump_file, finish_graph_dump_file): Remove SUFFIX parameter. * graph.h (print_rtl_graph_with_bb, clean_graph_dump_file, finish_graph_dump_file): Likewise. * tree-pass.h (struct tree_opt_pass): Add `letter' field. * cfgexpand.c (pass_expand): Adjust. * gimple-low.c (pass_lower_cf, pass_remove_useless_vars): Adjust. * passes.c (pass_rest_of_compilation): Adjust. * predict.c (pass_profile): Adjust. * tree-alias-common.c (pass_build_pta, pass_del_pta): Adjust. * tree-cfg.c (pass_build_cfg, pass_remove_useless_stmts, pass_split_crit_edges, pass_warn_function_return): Adjust. * tree-complex.c (pass_lower_vector_ssa, pass_pre_expand): Adjust. * tree-dfa.c (pass_referenced_vars): Adjust. * tree-eh.c (pass_lower_eh): Adjust. * tree-if-conv.c (pass_build_ssa): Adjust. * tree-into-ssa.c (pass_build_ssa): Adjust. * tree-mudflap.c (pass_mudflap_1, pass_mudflap_2): Adjust. * tree-nomudflap.c (pass_mudflap_1, pass_mudflap_2): Adjust. * tree-nrv.c (pass_nrv): Adjust. * tree-optimize.c (pass_gimple, pass_all_optimizations, pass_cleanup_cfg_post_optimizing, pass_free_datastructures, pass_init_datastructures): Adjust. * tree-outof-ssa.c (pass_del_ssa): Adjust. * tree-profile.c (pass_tree_profile): Adjust. * tree-sra.c (pass_sra): Adjust. * tree-ssa-alias.c (pass_may_alias): Adjust. * tree-ssa-ccp.c (pass_ccp, pass_fold_builtins): Adjust. * tree-ssa-copyrename.c (pass_rename_ssa_copies): Adjust. * tree-ssa-dce.c (pass_dce, pass_cd_dce): Adjust. * tree-ssa-dom.c (pass_dominator): Adjust. * tree-ssa-dse.c (pass_dse): Adjust. * tree-ssa-forwprop.c (pass_forwprop): Adjust. * tree-ssa-if-conv.c (pass_if_conversion): Adjust. * tree-ssa-loop-ch.c (pass_ch): Adjust. * tree-ssa-loop.c (pass_loop, pass_loop_init, pass_lim, pass_loop_done, pass_complete_unroll, pass_iv_canon, pass_iv_optimize, pass_vectorize): Adjust. * tree-ssa-phiopt.c (pass_phiopt): Adjust. * tree-ssa-pre.c (pass_pre, pass_fre): Adjust. * tree-ssa.c (pass_redundant_phi, pass_early_warn_uninitialized, pass_late_warn_uninnitialized): Adjust. * tree-tailcall.c (pass_tail_recursion, pass_tail_calls): Adjust. * Makefile.in (tree-dump.o): Add new dependencies. * cgraph.c (cgraph_remove_node): TDF_all -> TDF_tree_all. * cgraphunit.c (cgraph_preserve_function_body_p, cgraph_optimize): Likewise. * toplev.c (dump_file_name): New. * tree-dump.c (dump_enable_all): Add LETTER parameter. (struct dump_file_info): Add NUM and LETTER fields. (dump_files): Adjust and add RTL dump files. (dump_register): Add NUM and LETTER fields. (get_dump_file_name, dump_initialized_p, enable_rtl_dump_file): New. (dump_begin): Use get_dump_file_name. (dump_switch_p_1): Adjust call to dump_enable_all. * tree-dump.h (dump_register): Adjust prototype. * tree-optimize.c (register_one_dump_file): Take dump file index. Support flags for RTL dumps. (register_dump_files): Fill in NUM field of struct dump_file_info. Track properties both when the gate is executed and when it is not. (execute_todo): Dump RTL. Add PROPERTIES parameter. (execute_one_pass): Pass properties to execute_todo. Handle VCG dumps of RTL. * tree-pass.h (dump_file_name): New. * tree.h (TDF_TREE, TDF_RTL, get_dump_file_name, dump_initialized_p): New. * Makefile.in (passes.o): Add new dependencies. * passes.c (struct dump_file_info, enum dump_file_index, dump_file_tbl, init_optimization_passes): Remove. (open_dump_file, close_dump_file): Use tree-dumping infrastructure. (rest_of_handle_new_regalloc, rest_of_handle_old_regalloc): Use dump_enabled_p. (finish_optimization_passes): Update finish_graph_dump_file loop. (enable_rtl_dump_file): Remove. * tree-dump.c (dump_files): Adjust and add RTL dump files. (enable_rtl_dump_file): Add here. * tree.h (enum tree_dump_index): Add RTL dump file indices. * doc/invoke.texi (Debugging options): Document new RTL debugging options. Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87113 138bc75d-0d04-0410-961f-82ee72b054a4
* * c-common.c, c-decl.c, combine.c, defaults.h, fold-const.c,kazu2004-09-051-3/+3
| | | | | | | | | | | | | gimplify.c, gthr-nks.h, hooks.c, lambda-code.c, lambda-mat.c, stor-layout.c, target.h, tree-cfg.c, tree-chrec.c, tree-if-conv.c, tree-inline.c, tree-into-ssa.c, tree-mudflap.c, tree-optimize.c, tree-scalar-evolution.c, tree-ssa-alias.c, tree-ssa-ccp.c, tree-ssa-dce.c, tree-ssa-pre.c, tree-vectorizer.c, tree-vectorizer.h, tree.h, vec.h: Fix comment formatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87105 138bc75d-0d04-0410-961f-82ee72b054a4
* * c-common.c (c_alignof_expr): Use DECL_ALIGN_UNIT and TYPE_ALIGN_UNIT.kenner2004-08-311-1/+1
| | | | | | | | | | | | | | | (c_sizeof_of_alignof_type): Likewise. * expr.c (array_ref_element_size): Likewise. (highest_pow2_factor_for_target): Likewise. * gimplify.c (canonicalize_addr_expr): Likewise. (gimplify_compound_lval): Likewise. * stor-layout.c (finalize_record_size, finalize_type_size): Likewise. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Likewise. * varasm.c (assemble_variable): Likewise. (output_constant_def_contents): Alignments are unsigned. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86848 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree-ssa-ccp.c (ccp_visit_stmt): Remove #if 0 guards.dnovillo2004-08-291-2/+0
| | | | | | | * tree-ssa-propagate.c: Fix documentation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86726 138bc75d-0d04-0410-961f-82ee72b054a4
* * Makefile.in (OBJS-common): Add tree-ssa-propagate.odnovillo2004-08-291-1342/+830
| | | | | | | | | | | | | | (tree-ssa-propagate.o): New rule. (GTFILES): Add tree-ssa-propagate.c. * tree-flow.h (struct stmt_ann_d): Remove field in_ccp_worklist. * tree-ssa-propagate.c: New file. * tree-ssa-propagate.h: New file. * tree-ssa-ccp.c: Re-write to use the routines from tree-ssa-propagate.c. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86711 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-08-25 Andrew MacLeod <amacleod@redhat.com>amacleod2004-08-251-66/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tree-ssa-operands.h (struct ssa_operand_iterator_d): New. SSA operand iterator controlling structure. (SSA_OP_USE, SSA_OP_DEF, SSA_OP_VUSE, SSA_OP_VMAYUSE, SSA_OP_VMAYDEF, SSA_OP_VMUSTDEF, SSA_OP_VIRTUAL_USES, SSA_OP_VIRTUAL_DEFS, SSA_OP_ALL_USES, SSA_OP_ALL_DEFS, SSA_OP_ALL_OPERANDS): New. Operand iterator flags. (FOR_EACH_SSA_TREE_OPERAND): New. Iterate over operands as trees. (FOR_EACH_SSA_USE_OPERAND): New. Iterate over operands as uses. (FOR_EACH_SSA_DEF_OPERAND): New. Iterate over operands as defs. (FOR_EACH_SSA_MAYDEF_OPERAND): New. Iterate over V_MAY_DEFs. * tree-ssa-operands.c (NULL_DEF_OPERAND_P, NULL_USE_OPERAND_P): New. Empty operand pointers. * tree-flow-inline.h (op_iter_done): New. Return true if finished. (op_iter_next_use): New. Return next use_operand_p. (op_iter_next_def): New. Return next def_operand_p. (op_iter_next_tree): New. Return next operands as a tree. (op_iter_init): New. Initialize an iterator structure. (op_iter_init_use): New. Initialize structure and get the first use. (op_iter_init_def): New. Initialize structure and get the first def. (op_iter_init_tree): New. Initialize structure and get the first tree. (op_iter_next_maydef): New. Return next V_MAY_DEF operands. (op_iter_init_maydef): New. Initialize structure and get the first V_MAY_DEF operands. * tree-cfg.c (tree_duplicate_bb): Use new operand iterator. * tree-dfa.c (compute_immediate_uses_for_stmt, redirect_immediate_uses): Use new operand iterator. (v_may_defs_disappeared_p, v_must_defs_disappeared_p): Delete. (mark_new_vars_to_rename): Use new operand iterator. Count virtual operands instead of using *_disappeared_p routines. * tree-into-ssa.c (mark_def_sites, ssa_mark_def_sites, rewrite_stmt, ssa_rewrite_stmt): Use new operand iterator. * tree-outof-ssa.c (check_replaceable, find_replaceable_in_bb, rewrite_trees): Use new operand iterator. * tree-pretty-print.c (dump_vops): Use new operand iterator. * tree-sra.c (mark_all_v_defs): Use new operand iterator. * tree-ssa-alias.c (compute_points_to_and_addr_escape, dump_points_to_info): Use new operand iterator. * tree-ssa-ccp.c (cp_lattice_meet, visit_stmt, initialize, replace_uses_in, replace_vuse_in, likely_value, set_rhs): Use new operand iterator. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary, propagate_necessity): Use new operand iterator. * tree-ssa-dom.c (cprop_into_stmt, optimize_stmt): Use operand iterator. (register_definitions_for_stmt): Use new operand iterator. Take stmt as a parameter instead of a stmt_ann_t. * tree-ssa-live.c (create_ssa_var_map, calculate_live_on_entry, build_tree_conflict_graph): Use new operand iterator. * tree-ssa-loop-im.c (determine_max_movement, single_reachable_address, rewrite_mem_refs): Use new operand iterator. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt, check_loop_closed_ssa_use): Use new operand iterator. * tree-ssa.c (verify_ssa, replace_immediate_uses): Use operand iterator. * tree-ssanames.c (release_defs): Use new operand iterator. * tree-vectorizer.c (vect_create_data_ref): Use new operand iterator. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86583 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree.h (build_int_cst): New, sign extended constant.nathan2004-08-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (build_int_cstu): New, zero extended constant. (build_int_cst_wide): Renamed from build_int_cst. * tree.c (build_int_cst, build_int_cstu): New. (build_int_cst_wide): Renamed from build_int_cst. (make_vector_type, build_common_tree_nodes, build_common_tree_nodes_2): Adjust build_int_cst calls. * builtins.c (expand_builtin_prefetch, expand_builtin_strstr, expand_builtin_strpbrk, expand_builtin_fputs, build_string_literal, expand_builtin_printf, expand_builtin_sprintf, fold_builtin_classify_type, fold_builtin_lround, fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit, simplify_builtin_strstr, simplify_builtin_strpbrk, fold_builtin_fputs, simplify_builtin_sprintf): Likewise. * c-common.c (start_fname_decls, fix_string_type, shorten_compare, DEF_ATTR_INT): Likewise. * c-decl.c (complete_array_type, check_bitfield_type_and_width): Likewise. * c-lex.c (interpret_integer, lex_charconst): Likewise. * c-parse.in (primary) <TYPES_COMPATIBLE_P> Likewise. * c-pretty-print.c (pp_c_integer_constant): Likewise. * c-typeck.c (really_start_incremental_init, push_init_level, set_nonincremental_init_from_string): Likewise. * calls.c (load_register_parameters): Likewise. convert.c (convert_to_pointer): Likewise. coverage.c (coverage_counter_alloc, tree_coverage_counter_ref, build_fn_info_type, build_fn_info_value, build_ctr_info_value, build_gcov_info): Likewise. * except.c (init_eh, assign_filter_values): Likewise. * expmed.c (store_fixed_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_shift, expand_mult_const, expand_mult_highpart_adjust, extract_high_half, expand_sdiv_pow2, expand_divmod, make_tree): Likewise. * expr.c (convert_move, emit_group_load, emit_group_store, expand_assignment, store_constructor, store_field, expand_expr_real_1, reduce_to_bit_field_precision): Likewise. fold-const.c (force_fit_type, int_const_binop, fold_convert_const, invert_truthvalue, optimize_bit_field_compare, decode_field_reference, all_ones_mask_p, constant_boolean_node, fold_div_compare, fold, fold_read_from_constant_string, fold_negate_const, fold_abs_const, fold_not_const, round_up, round_down): Likewise. * function.c (assign_parm_setup_block): Likewise. * stmt.c (shift_return_value, expand_case, estimate_case_costs): Likewise. * stor-layout.c (layout_type, initialize_sizetypes, set_min_and_max_values_for_integral_type): Likewise. * tree-chrec.c (chrec_fold_multiply_poly_poly, reset_evolution_in_loop): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. * tree-complex.c (build_replicated_const): Likewise. * tree-eh.c (honor_protect_cleanup_actions, lower_try_finally_onedest, lower_try_finally_copy, lower_try_finally_switch): Likewise. * tree-mudflap.c (mf_build_string, mx_register_decls, mudflap_register_call, mudflap_enqueue_constant): Likewise. * tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref): Likewise. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_cond, loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv, canonicalize_loop_induction_variables): Likewise. * tree-vectorizer.c (vect_create_index_for_array_ref, vect_transform_loop_bound, vect_compute_data_ref_alignment): Likewise. * config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start, alpha_gimplify_va_arg_1): Likewise. * config/arm/arm.c (arm_get_cookie_size): Likewise. * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mips/mips.c (mips_build_builtin_va_list, mips_va_start, mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg, add_compiler_branch_island): Likewise. * config/s390/s390.c (s390_va_start): Likewise. * config/sh/sh.c (sh_va_start): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. * config/xtensa/xtensa.c (xtensa_va_start, xtensa_gimplify_va_arg_expr): Likewise. * objc/objc-act.c (build_objc_string_object, build_objc_symtab_template, init_def_list, init_objc_symtab, init_module_descriptor, generate_static_references, build_selector_translation_table, get_proto_encoding, build_typed_selector_reference, build_selector_reference, build_next_objc_exception_stuff, build_method_prototype_list_template, generate_descriptor_table, generate_protocols, build_protocol_initializer, build_ivar_list_template, build_method_list_template, build_ivar_list_initializer, generate_ivars_list, generate_dispatch_table, generate_protocol_list, build_category_initializer, build_shared_structure_initializer, generate_shared_structures, handle_impent, generate_objc_image_info): Likewise. 2004-04-25 Paolo Bonzini <bonzini@gnu.org> * cfglayout.c (duplicate_insn_chain): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * cfgloop.h (struct loop): Remove fields vtop, cont and cont_dominator. * cfgrtl.c (rtl_delete_block): Remove handling of NOTE_INSN_LOOP_CONT. * final.c (final_scan_insn): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * insn-notes.def (NOTE_INSN_LOOP_VTOP, NOTE_INSN_LOOP_CONT): Remove. * jump.c (squeeze_notes): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * loop.c (scan_loops, find_and_verify_loops, for_each_insn_in_loop, check_dbra_loop, loop_dump_aux): Remove references to removed notes and fields. * reorg.c (mostly_true_jump): Do not rely on NOTE_INSN_LOOP_VTOPs. * unroll.c (unroll_loop, copy_loop_body, loop_iterations): Remove references to removed notes and fields. (subtract_reg_term, ujump_to_loop_cont): Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86544 138bc75d-0d04-0410-961f-82ee72b054a4
* .:nathan2004-08-151-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tree.h (build_int_cst): New. (build_int_2): Remove. * tree.c (build_int_2): Remove. (build_int_cst): New. (make_vector_type, build_common_tree_nodes, build_common_tree_nodes_2): Use build_int_cst. * builtins.c (expand_builtin_prefetch, expand_builtin_strstr, expand_builtin_strpbrk, expand_builtin_fputs, build_string_literal, expand_builtin_printf, expand_builtin_sprintf, fold_builtin_lround, fold_builtin_bitop, fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit, simplify_builtin_strstr, simplify_builtin_strpbrk, fold_builtin_fputs, simplify_builtin_sprintf): Use build_int_cst. * c-common.c (start_fname_decls, fix_string_type, c_common_nodes_and_builtins, c_init_attributes, shorten_compare): Likewise. * c-decl.c (complete_array_type, check_bitfield_type_and_width): Likewise. * c-lex.c (interpret_integer, lex_charconst): Likewise. * c-parse.in (primary): <TYPES_COMPATIBLE_P> Likewise. * c-pretty-print.c (pp_c_integer_constant): Likewise. * c-typeck.c (really_start_incremental_init, push_init_level, set_nonincremental_init_from_string): Likewise. * calls.c (load_register_parameters): Likewise. * convert.c (convert_to_pointer): Likewise. * coverage.c (coverage_counter_alloc, tree_coverage_counter_ref, build_fn_info_type, build_ctr_info_value, build_gcov_info): Likewise. * except.c (init_eh, assign_filter_values, assign_filter_values): Likewise. * expmed.c (store_fixed_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_shift, expand_mult_const, expand_mult_highpart_adjust, extract_high_half, expand_sdiv_pow2, expand_divmod, make_tree): Likewise. * expr.c (convert_move, emit_group_load, emit_group_store, expand_assignment, store_constructor, store_field, expand_expr_real_1, reduce_to_bit_field_precision): Likewise. * fold-const.c (force_fit_type, int_const_binop, fold_convert_const, invert_truthvalue, optimize_bit_field_compare, decode_field_reference, all_ones_mask_p, constant_boolean_node, fold_div_compare, fold, fold_read_from_constant_string, fold_negate_const, fold_abs_const, fold_not_const): Likewise. * function.c (assign_parm_setup_block): Likewise. * stmt.c (shift_return_value, expand_end_case_type, estimate_case_costs): Likewise. * stor-layout.c (layout_type, initialize_sizetypes, set_min_and_max_values_for_integral_type): Likewise. * tree-chrec.c (chrec_fold_multiply_poly_poly, reset_evolution_in_loop): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. * tree-complex.c (build_replicated_const): Likewise. * tree-eh.c (honor_protect_cleanup_actions, lower_try_finally_onedest, lower_try_finally_copy, lower_try_finally_switch): Likewise. * tree-mudflap.c (mf_build_string, mx_register_decls, mudflap_register_call, mudflap_enqueue_constant): Likewise. * tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref): Likewise. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_cond, loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type): Likewise. * config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start, alpha_gimplify_va_arg_1): Use build_int_cst. * config/arm/arm.c (arm_get_cookie_size): Likewise. * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. * config/i860/i860.c (i860_va_start): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mips/mips.c (mips_build_builtin_va_list, mips_va_start, mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg, add_compiler_branch_island): Likewise. * config/s390/s390.c (s390_va_start): Likewise. * config/sh/sh.c (sh_va_start): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. * config/xtensa/xtensa.c (xtensa_va_start, xtensa_gimplify_va_arg_expr): Likewise. * objc/objc-act.c (build_objc_string_object, build_objc_symtab_template, init_def_list, init_objc_symtab, init_module_descriptor, generate_static_references, build_selector_translation_table, get_proto_encoding, build_typed_selector_reference, build_selector_reference, build_next_objc_exception_stuff, build_method_prototype_list_template, generate_descriptor_table, generate_protocols, build_protocol_initializer, build_ivar_list_template, build_method_list_template, build_ivar_list_initializer, generate_ivars_list, generate_dispatch_table, generate_protocol_list, build_category_initializer, build_shared_structure_initializer, generate_shared_structures, handle_impent, generate_objc_image_info): Use build_int_cst. ada: * cuintp.c (UI_To_gnu): Use build_int_cst.. * trans.c (Exception_Handler_to_gnu_sjlj, gnat_to_gnu): Likewise. * utils.c (init_gigi_decls): Likewise. * utils2.c (build_call_raise): Likewise. cp: * call.c (convert_class_to_reference, build_user_type_conversion_1, convert_like_real, build_java_interface_fn_ref, build_special_member_call): Use build_int_cst. * class.c (build_vtbl_initializer): Likewise. * cp-gimplify.c (cp_gimplify_expr): Likewise. * cvt.c (cp_convert_to_pointer): Likewise. * decl.c (cxx_init_decl_processing, complete_array_type): Likewise. * decl2.c (start_static_initialization_or_destruction, generate_ctor_or_dtor_function): Likewise. * except.c (build_throw): Likewise. * lex.c (cxx_init): Likewise. * mangle.c (write_integer_cst): Likewise. * rtti.c (build_headof, get_tinfo_decl_dynamic, build_dynamic_cast_1, ptr_initializer, ptm_initializer, get_pseudo_ti_init): Likewise. * search.c (get_dynamic_cast_base_type): Likewise. * tree.c (build_shared_int_cst): Likewise. fortran: * trans-array.c (gfc_trans_array_constructor_value): Use build_int_cst. * trans-const.c (gfc_build_string_const, gfc_init_constants, gfc_conv_mpz_to_tree, gfc_conv_constant_to_tree): Likewise. * trans-decl.c (gfc_get_symbol_decl): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_ibits, gfc_conv_intrinsic_len, prepare_arg_info): Likewise. * trans-io.c (add_case, set_error_locus, build_dt, transfer_expr): Likewise. * trans-stmt.c (gfc_trans_label_assign, gfc_trans_pause, gfc_trans_stop, gfc_trans_character_select): Likewise. * trans-types.c (gfc_init_types, gfc_get_dtype): Likewise. * trans.c (gfc_trans_runtime_check): Likewise. java: * boehm.c (get_boehm_type_descriptor): Use build_int_cst. * class.c (build_utf8_ref, build_static_field_ref, make_field_value, make_method_value, get_dispatch_table, make_class_data, emit_symbol_table, emit_catch_table): Likewise. * constants.c (get_tag_node, build_ref_from_constant_pool, build_constants_constructor): Likewise. * decl.c (java_init_decl_processing): Likewise. * expr.c (build_java_array_length_access, build_newarray, expand_java_multianewarray, expand_java_pushc, expand_iinc, build_java_binop, build_field_ref, expand_java_add_case, expand_java_call, build_known_method_ref, build_invokevirtual, build_invokeinterface, build_jni_stub): Likewise. * java-gimplify.c (java_gimplify_new_array_init): Likewise. * jcf-parse.c (get_constant): Likewise. * lex.c (do_java_lex): Likewise. * parse.y (patch_binop, patch_unaryop, patch_cast, build_null_of_type, patch_newarray): Likewise. * resource.c (compile_resource_data): Likewise. * typeck.c (build_prim_array_type): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86022 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-08-10 Andrew MacLeod <amacleod@redhat.com>amacleod2004-08-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tree-cfg.c (bsi_insert_before, bsi_insert_after): Call modify_stmt after linking stmt into the program. (bsi_remove): Don't call modify_stmt. * tree-complex.c (update_complex_assignment, expand_complex_comparison): Call modify_stmt after changing the stmt. * tree-outof-ssa.c (rewrite_trees): Call modify_stmt only if not removing the stmt. * tree-ssa-ccp.c (substitute_and_fold): Call modify_stmt after changing the stmt, and only if needed. * tree-ssa-dom.c (thread_across_edge): Pass no annotation for a dummy expression. (simplify_rhs_and_lookup_avail_expr): Don't take an annotation param. (simplify_cond_and_lookup_avail_expr): Use modify_stmt. (simplify_switch_and_lookup_avail_expr): Don't take an annotation param. (eliminate_redundant_computations): Don't pass an annotation. Call modify_stmt rather than setting the annotation directly. (record_equivalences_from_stmt): Remove unused local 'j'. (cprop_operand): Take a stmt rather than an annotation as a parameter. Call modify_stmt. (cprop_into_stmt): Pass stmt rather than annotation. (update_rhs_and_lookup_avail_expr): Call modify_stmt. * tree-ssa-loop-im.c (schedule_sm): Call get_stmt_ann rather than modify_stmt. * tree-ssa.c (propagate_into_addr): Dont call modify_stmt. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85765 138bc75d-0d04-0410-961f-82ee72b054a4
* * gimplify.c (gimplify_expr) <case CONST_DECL>: Don't replacerth2004-07-301-0/+5
| | | | | | | | | | | | | | | | | | with DECL_INITIAL if fb_lvalue. * tree-gimple.c (is_gimple_id): Add CONST_DECL. * tree-pretty-print.c (dump_decl_name): Dump unnamed CONST_DECL with <Cxxx>. * tree-ssa-ccp.c (maybe_fold_stmt_indirect): Fold CONST_DECL. fortran/ * trans-expr.c (gfc_conv_expr_reference): Create a CONST_DECL for TREE_CONSTANTs. testsuite/ * gfortran.fortran-torture/execute/intrinsic_rrspacing.f90: Fix write to constant argument. * gfortran.fortran-torture/execute/intrinsic_scale.f90: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85365 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree-ssa-ccp.c (visit_assignment): Move code to preventdnovillo2004-07-301-6/+6
| | | | | | | | setting a non-register to UNDEFINED right before the call to set_lattice_value. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85318 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree-optimize.c (init_tree_optimization_passes): Schedulednovillo2004-07-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pass_may_alias right after the program is renamed into SSA. * tree-pass.h (PROP_alias): Define. * tree-outof-ssa.c (pass_del_ssa): Require PROP_alias. * tree-sra.c (pass_sra): Likewise. * tree-ssa-ccp.c (pass_ccp): Likewise. * tree-ssa-copyrename.c (pass_rename_ssa_ccp): Likewise. * tree-ssa-dce.c (pass_dce): Likewise. * tree-ssa-dom.c (pass_dominator): Likewise. * tree-ssa-dse.c (pass_dse): Likewise. * tree-ssa-forwprop.c (pass_forwprop): Likewise. * tree-ssa-loop-ch.c (pass_ch): Likewise. * tree-ssa-phiopt.c (pass_phiopt): Likewise. * tree-ssa-pre.c (pass_pre): Likewise. * tree-tailcall.c (pass_tail_recursion): Likewise. * tree-ssa.c (pass_redundant_phi): Likewise. * tree-ssa-alias.c (aliases_computed_p): Remove. Update all users. (init_alias_info): Do not mark all type tags for renaming unconditionally. Clear may_aliases from every symbol. (setup_pointers_and_addressables): If a pointer has not been dereferenced and it had a type tag, clear it and mark the old tag for renaming. testsuite/ChangeLog * gcc.dg/tree-ssa/20030714-2.c: Adjust number of expected conditionals. * gcc.dg/tree-ssa/20031022-1.c: Adjust number of expected loads. * gcc.dg/tree-ssa/ssa-dom-cse-1.c: Expect optimization in DOM1. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85255 138bc75d-0d04-0410-961f-82ee72b054a4
* * expr.c (expand_expr_real_1): Don't handle non-local variables.rth2004-07-231-2/+1
| | | | | | | | | | | | | | | | | | | | | * expr.h (fix_lexical_addr): Remove. * function.c (NEED_SEPARATE_AP): Remove. (fix_lexical_addr): Remove. * tree-alias-common.c (get_alias_var_decl): Check TREE_STATIC, not null decl_function_context. (create_alias_vars): Likewise. * tree-cfg.c (make_ctrl_stmt_edges): Don't check for non-local labels. (simple_goto_p): Likewise. * tree-dfa.c (add_referenced_var): Don't check for non-local variables. * tree-ssa-ccp.c (get_default_value): Likewise. * tree-tailcall.c (suitable_for_tail_opt_p): Likewise. * tree.c (needs_to_live_in_memory): Likewise. * tree-flow-inline.h (may_be_aliased): Move... * tree-ssa-alias.c (may_be_aliased): ... here. Enhance check for when TREE_STATIC variables may be addressable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85099 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree-ssa-ccp.c (latticevalue): Add UNKNOWN_VAL.bbooth2004-07-221-41/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (substitute_and_fold): Propigate into VUSE operands when possible. (visit_phi_node): Handle UNKNOWN_VAL latticevalue. (cp_lattice_meet): Handle merging of latticevalues when UNKNOWN_VAL is present. (visit_stmt): Visit assignments with V_MUST_DEFs. (visit_assignment): Gather ccp information for V_MUST_DEF operands. (ccp_fold): Deal with RHS' that are constant and virtual. (evaluate_stmt): Handle UNKNOWN_VAL likely values. (dump_lattice_value): Dump UNKNOWN_VAL latticevalues. (initialize): Mark statements with V_MUST_DEFs as VARYING only if the V_MUST_DEF operand is VARYING. Fix comment and include VOPS when computing immediate uses. (set_lattice_value): Disallow a UNKNOWN_VAL->UNDEFINED state transition. (replace_vuse_in): New function. (likely_value): Add check of vuse operands. (get_default_value): Set the default value of virtually defined variables to UKNOWN_VAL instead of VARYING. testsuite: * gcc.dg/tree-ssa/20040721-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85055 138bc75d-0d04-0410-961f-82ee72b054a4
* * rtl.h (plus_constant): Delete.zack2004-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | (plus_constant_wide): Rename to plus_constant. (plus_constant_for_output_wide): Delete vestigial prototype. (GEN_INT): Remove unnecessary cast. * tree.h (build_int_2, size_int_type): Delete. (build_int_2_wide): Rename to build_int_2. (size_int_wide): Rename to size_int_kind. (size_int_type_wide): Rename to size_int_type. (size_int, ssize_int, bitsize_int, sbitsize_int): Use size_int_kind. Remove unnecessary cast. * tree.c (build_int_2_wide): Rename build_int_2; update comment. * explow.c (plus_constant_wide): Rename plus_constant; update comment. * fold-const.c (size_int_wide): Rename size_int_kind. Use size_int_type. (size_int_type_wide): Rename size_int_type. (int_const_binop): Use size_int_type. * c-lex.c (interpret_integer): Use build_int_2. * final.c (split_double): Remove unnecessary casts. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Use build_int_2. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84976 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree-def (WITH_SIZE_EXPR): New.rth2004-07-161-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * explow.c (expr_size, int_expr_size): Handle WITH_SIZE_EXPR. * expr.c (expand_expr_real_1): Likewise. * gimplify.c (maybe_with_size_expr): New. (gimplify_arg, gimplify_modify_expr): Use it. (gimplify_modify_expr_to_memcpy): Take size parameter. (gimplify_modify_expr_to_memset): Likewise. (gimplify_expr): Handle WITH_SIZE_EXPR. * tree-alias-common.c (find_func_aliases): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. (tree_could_throw_p): Likewise. * tree-gimple.c (is_gimple_lvalue): Likewise. (get_call_expr_in): Likewise. * tree-inline.c (estimate_num_insns_1): Likewise. (expand_calls_inline): Likewise. * tree-nested.c (convert_call_expr): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-sra.c (sra_walk_expr): Likewise. * tree-ssa-alias.c (add_pointed_to_expr): Likewise. * tree-ssa-ccp.c (get_rhs, set_rhs): Likewise. * tree-ssa-operands.c (get_expr_operands): Likewise. * tree-tailcall.c (find_tail_calls): Likewise. * calls.c (expand_call): Reset old_stack_allocated after calling emit_stack_restore. * gcc.c-torture/compile/20020210-1.c: Remove XFAIL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84833 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.c (fold_builtin_fputs): Don't bother converting thesayle2004-07-111-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | return type to integer_type_node, as we've already checked that the result will be ignored. * tree-eh.c (tree_could_trap_p): Add support for -ftrapv such that signed addition, subtraction, multiplication, division, remainder, negation and absolute value may potentially trap. * fold-const.c (fold_ignored_result): New function to strip non-side-effecting tree nodes from an expression whose result is ignored. (fold_convert): Call fold_ignored_result when casting a value to VOID_TYPE. (omit_one_operand): Call fold_ignored_result on the "omitted" operand when building a COMPOUND_EXPR. (pedantic_omit_one_operand): Likewise. * tree.h (fold_ignored_result): Prototype here. * tree-ssa-ccp.c (ccp_fold_builtin): Call fold_ignored_result when we're going to ignore the result. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84525 138bc75d-0d04-0410-961f-82ee72b054a4
* PR tree-opt/16383rth2004-07-111-32/+13
| | | | | | | | | | | | * tree-ssa-ccp.c (fold_stmt_r): Split out... * tree.c (fields_compatible_p, find_compatible_field): ... new. * tree.h (fields_compatible_p, find_compatible_field): Declare. * tree-sra.c (sra_hash_tree): Hash fields by offset. (sra_elt_eq): Use fields_compatible_p. (generate_one_element_ref): Use find_compatible_field. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84524 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree-ssa-ccp.c (ccp_fold_builtin): Strip conversion exprsrth2004-07-101-1/+10
| | | | | | | with prejudice. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84436 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.c (fold_builtin_strcpy): Merge functionality fromsayle2004-07-081-37/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | simplify_builtin_strcpy. Add additional len argument. No longer static. Remove function prototype. (fold_builtin_strncpy): Likewise integrate functionality from simplify_builtin_strncpy. Add additional slen argument. No longer static. Remove function prototype. (simplify_builtin_strcy, simplify_builtin_strncpy): Delete. (simplify_builtin_fputs): Rename to fold_builtin_fputs. Change types of "ignore" and "unlocked" parameters to bool. (fold_builtin_1): Add additional ignore argument. Call renamed fold_builtin_fputs to simplify GCC "fputs" and "fputs_unlocked" builtins. Update arguments to fold_builtin_strncpy and fold_builtin_strcpy. Add function prototype. (fold_builtin): Add additional Boolean ignore argument to pass to fold_builtin_1. (simplify_builtin): Call fold_builtin_fputs, fold_builtin_strcpy and fold_builtin_strncpy instead of simplify_builtin_fputs, simplify_builtin_strcpy and simplify_builtin_strncpy respectively. * expr.h (simplify_builtin_fputs, simplify_builtin_strcpy, simplify_builtin_strncpy): Delete function prototypes. * tree.h (fold_builtin_fputs, fold_builtin_strcpy, fold_builtin_strncpy): Add function prototypes here. (fold_builtin): Update function prototype with new "bool ignore". * tree-ssa-ccp.c (ccp_fold): Update call to fold_builtin. (ccp_fold_builtin): Update call to fold_builtin. Call fold_builtin_fputs, fold_builtin_strcpy and fold_builtin_strncpy instead of simplify_builtin_fputs, simplify_builtin_strcpy and simplify_builtin_strncpy respectively. * fold-const.c (fold): Update call to fold_builtin. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84302 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree-cfg.c (make_exit_edges): Use get_call_expr_in.rth2004-07-081-41/+55
| | | | | | | | | | | | | | | (remove_useless_stmts_1, is_ctrl_altering_stmt): Likewise. (tree_block_ends_with_call_p, need_fake_edge_p): Likewise. * tree-eh.c (lower_eh_constructs_1): Likewise. * tree-sra.c (sra_walk_modify_expr): Likewise. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. (eliminate_unnecessary_stmts): Likewise. * tree-ssa-dse.c (dse_optimize_stmt): Likewise. * tree-tailcall.c (optimize_tail_call): Likewise. * tree-ssa-ccp.c (get_rhs, set_rhs): Reorg to use switch. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84298 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree-ssa-ccp.c (fold_stmt): Get type directly fromnathan2004-07-081-1/+6
| | | | | | | OBJ_TYPE_REF_OBJECT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84280 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree-ssa-ccp.c (set_rhs): Change function to return a bool.sayle2004-07-041-10/+23
| | | | | | | | | | | Ensure the replacement rhs is valid gimple before performing the substitution. Return false if these sanity checks fail. (fold_stmt): Only set changed to true, if set_rhs returns true. (execute_fold_all_builtins): Only call modify_stmt if set_rhs succeeds. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84091 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree-ssa.c (tree_ssa_useless_type_conversion): Also look atkenner2004-07-031-1/+0
| | | | | | | | | VIEW_CONVERT_EXPR and NON_LVALUE_EXPR. * tree-ssa-ccp.c (fold_stmt): Call just STRIP_USELESS_TYPE_CONVERSION. * tree-ssa-dom.c (local_fold): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84054 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree-cfg.c (verify_stmt): Add last_in_block parameter. Verifyrth2004-06-291-2/+7
| | | | | | | | | | | | | | | | | | | | | that eh stmts can throw. (verify_stmts): Update verify_stmt call. (tree_purge_dead_eh_edges, tree_purge_all_dead_eh_edges): New. * tree-eh.c (remove_stmt_from_eh_region): New. (lower_eh_constructs): Fix throw_stmt_table delete routine. (tree_could_trap_p): Match may_trap_p. (maybe_clean_eh_stmt): New. * tree-flow.h: Update decls. * tree-ssa-ccp.c (pass_ccp): Add TODO_verify_stmts. (substitute_and_fold): Clean eh edges. * tree-ssa-dce.c (mark_control_dependent_edges_necessary): Handle empty basic blocks. * tree-ssa-dom.c (need_eh_cleanup): New. (tree_ssa_dominator_optimize): Allocate it. Cleanup eh edges. (optimize_stmt): Cleanup eh stmts; set need_eh_cleanup. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83843 138bc75d-0d04-0410-961f-82ee72b054a4