aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
AgeCommit message (Collapse)AuthorFilesLines
2008-04-05tree-cfg.c (need_fake_edge_p): Return false for calls to builtins that ↵Ben Elliston1-3/+15
return exactly once and do not throw. * tree-cfg.c (need_fake_edge_p): Return false for calls to builtins that return exactly once and do not throw. Cache call to call_expr_flags. From-SVN: r133929
2008-04-04re PR target/35364 (ICE on ia64 with vector declaration inside #pragma omp ↵Jakub Jelinek1-0/+27
parallel) PR target/35364 * tree-cfg.c (remove_useless_stmts_1): Handle OMP_* containers. * g++.dg/gomp/pr35364.C: New test. From-SVN: r133905
2008-04-04function.c (free_after_parsing): Replace with cxx_push_function_context from ↵Paolo Bonzini1-1/+1
C++ front-end. 2008-04-03 Paolo Bonzini <bonzini@gnu.org> * function.c (free_after_parsing): Replace with cxx_push_function_context from C++ front-end. (allocate_struct_function): Don't call langhook. * langhooks.h (struct lang_hooks_for_functions): Delete. (struct lang_hooks): Add back missing_noreturn_ok_p here, delete member "function". * langhooks-def.h (LANG_HOOKS_MISSING_NORETURN_OK_P): Add. (LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL, LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P, LANG_HOOKS_FUNCTION_INITIALIZER): Delete. (LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_MISSING_NORETURN_OK_P, remove LANG_HOOKS_FUNCTION_INITIALIZER. * tree-cfg.c: Adjust call to missing_noreturn_ok_p langhook. * c-objc-common.h (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): Rename to LANG_HOOKS_MISSING_NORETURN_OK_P. cp: 2008-04-03 Paolo Bonzini <bonzini@gnu.org> * decl.c (cxx_push_function_context): Delete. (cxx_pop_function_context): Delete. (start_preparsed_function): Merge cxx_push_function_context (!f->decl code only). * cp-objcp-common.h (LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL): Delete. (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): Rename to LANG_HOOKS_MISSING_NORETURN_OK_P. * cp-tree.h (cxx_push_function_context, cxx_pop_function_context): Delete prototype. * semantics.c (current_stmt_tree): Fix comment. From-SVN: r133900
2008-04-02re PR tree-optimization/14495 ([tree-ssa] Propagate range info into a switch ↵Richard Guenther1-17/+23
statement) 2008-04-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/14495 PR tree-optimization/34793 * tree-vrp.c (struct switch_update): New structure. (to_remove_edges, to_update_switch_stmts): New VECs. (simplify_switch_using_ranges): New function. Remove not taken case labels and edges. (simplify_stmt_using_ranges): Call it. (identify_jump_threads): Mark edges we have queued for removal so we don't thread them. (execute_vrp): Remove edges queued for removal, update SWITCH_STMT case label vector. * tree-cfg.c (group_case_labels): Deal with missing default label. (tree_verify_flow_info): Allow missing default label. * stmt.c (emit_case_bit_tests): Deal with NULL default_label. (emit_case_nodes): Likewise. (expand_case): Do not rely on the default label to be present. * expr.c (try_casesi): Deal with NULL default_label. (do_tablejump): Likewise. * gcc.dg/tree-ssa/vrp41.c: New testcase. * gcc.dg/tree-ssa/vrp42.c: Likewise. From-SVN: r133835
2008-04-01tree-cfg.c (verify_expr): remove in_phi.Rafael Avila de Espindola1-26/+1
2008-04-01 Rafael Espindola <espindola@google.com> * tree-cfg.c (verify_expr): remove in_phi. (verify_stmt): Don't call walk_tree with verify_expr. Use is_gimple_min_invariant instead of is_gimple_val. From-SVN: r133795
2008-03-22tree-cfg.c (verify_expr): Recurse again for invariant addresses.Richard Guenther1-5/+8
2008-03-22 Richard Guenther <rguenther@suse.de> * tree-cfg.c (verify_expr): Recurse again for invariant addresses. For PHI nodes verify the address is invariant. * tree-ssa-ccp.c (ccp_decl_initial_min_invariant): Remove. (get_symbol_constant_value): Use is_gimple_min_invariant. (maybe_fold_stmt_indirect): Likewise. From-SVN: r133453
2008-03-19re PR other/35094 (RTL dump file letters hosed and partly undocumented)Jan Hubicka1-15/+25
* gcc.dg/20050811-2.c: Update dumping flags. * gcc.dg/sms-2.c: Update dumping flags. * gcc.dg/var-expand1.c: Update dumping flags. * gcc.dg/var-expand3.c: Update dumping flags. * gcc.dg/pr30957-1.c: Update dumping flags. * gcc.dg/20050811-1.c: Update dumping flags. * gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail. * gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail. PR other/35094 * toplev.c (decode_d_option): Handle all CPP flags. * tree-vrp.c: Update tree_pass descriptors. * regrename.c: Update tree_pass descriptors. * fwprop.c: Update tree_pass descriptors. * doc/invoke.texi: Remove documentation of dropped -d? flags. * tree-into-ssa.c: Update tree_pass descriptors. * tree-dump.c: Update tree_pass descriptors. * tree-complex.c: Update tree_pass descriptors. * tree-dump.h: Update tree_pass descriptors. * see.c: Update tree_pass descriptors. * cgraphbuild.c: Update tree_pass descriptors. * tracer.c: Update tree_pass descriptors. * tree-loop-distribution.c: Update tree_pass descriptors. * cgraph.c: Update tree_pass descriptors. * postreload-gcse.c: Update tree_pass descriptors. * postreload.c: Update tree_pass descriptors. * tree-ssa-loop-ch.c: Update tree_pass descriptors. * tree-tailcall.c: Update tree_pass descriptors. * tree-pass.h (tree_opt_pass): Rename to ... (opt_pass) ... this one; add "type" field and remove letter field. (gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New. (execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes, all_lowering_passes): Update declaration. * ipa-cp.c: Update tree_pass descriptors. * final.c: Update tree_pass descriptors. * omp-low.c: Update tree_pass descriptors. * tree-ssa-dse.c: Update tree_pass descriptors. * ipa-reference.c: Update tree_pass descriptors. * tree-ssa-uncprop.c: Update tree_pass descriptors. * auto-inc-dec.c: Update tree_pass descriptors. * reorg.c: Update tree_pass descriptors. * cgraphunit.c: Update tree_pass descriptors. * tree-ssa-copyrename.c: Update tree_pass descriptors. * tree-ssa-ccp.c: Update tree_pass descriptors. * df-core.c: Update tree_pass descriptors. * mode-switching.c: Update tree_pass descriptors. * tree-nomudflap.c: Update tree_pass descriptors. * modulo-sched.c: Update tree_pass descriptors. * ipa-pure-const.c: Update tree_pass descriptors. * cse.c: Update tree_pass descriptors. * web.c: Update tree_pass descriptors. * tree-stdarg.c: Update tree_pass descriptors. * tree-ssa-math-opts.c: Update tree_pass descriptors. * tree-ssa-dom.c: Update tree_pass descriptors. * tree-nrv.c: Update tree_pass descriptors. * tree-ssa-alias.c: Update tree_pass descriptors. * loop-init.c: Update tree_pass descriptors. * gimple-low.c: Update tree_pass descriptors. * ipa-inline.c: Update tree_pass descriptors. * tree-ssa-sink.c: Update tree_pass descriptors. * global.c: Update tree_pass descriptors. * ifcvt.c: Update tree_pass descriptors. * jump.c: Update tree_pass descriptors. * predict.c: Update tree_pass descriptors. * tree-ssa-loop.c: Update tree_pass descriptors. * recog.c: Update tree_pass descriptors. * dse.c: Update tree_pass descriptors. * tree-ssa-ifcombine.c: Update tree_pass descriptors. * tree-eh.c: Update tree_pass descriptors. * regmove.c: Update tree_pass descriptors. * local-alloc.c * function.c: Update tree_pass descriptors. * tree-vectorizer.c: Update tree_pass descriptors. * gcse.c: Update tree_pass descriptors. * ipa-type-escape.c: Update tree_pass descriptors. * tree-if-conv.c: Update tree_pass descriptors. * init-regs.c: Update tree_pass descriptors. * ipa.c: Update tree_pass descriptors. * tree-ssa-phiopt.c: Update tree_pass descriptors. * rtl-factoring.c: Update tree_pass descriptors. * lower-subreg.c: Update tree_pass descriptors. * bt-load.c: Update tree_pass descriptors. * tree-dfa.c: Update tree_pass descriptors. * except.c: Update tree_pass descriptors. * emit-rtl.c: Update tree_pass descriptors. * cfgexpand.c: Update tree_pass descriptors. * tree-cfgcleanup.c: Update tree_pass descriptors. * cfgcleanup.c: Update tree_pass descriptors. * tree-ssa-pre.c: Update tree_pass descriptors. * tree-sra.c: Update tree_pass descriptors. * tree-mudflap.c: Update tree_pass descriptors. * tree-ssa-copy.c: Update tree_pass descriptors. * cfglayout.c: Update tree_pass descriptors. * tree-ssa-forwprop.c: Update tree_pass descriptors. * tree-ssa-dce.c: Update tree_pass descriptors. * tree-ssa.c: Update tree_pass descriptors. * regclass.c: Update tree_pass descriptors. * integrate.c: Update tree_pass descriptors. * tree-optimize.c: Update tree_pass descriptors. * tree-ssa-phiprop.c: Update tree_pass descriptors. * tree-object-size.c: Update tree_pass descriptors. * combine.c: Update tree_pass descriptors. * tree-outof-ssa.c: Update tree_pass descriptors. * bb-reorder.c: Update tree_pass descriptors. * stack-ptr-mod.c: Update tree_pass descriptors. * var-tracking.c: Update tree_pass descriptors. * tree-profile.c: Update tree_pass descriptors. * tree-vect-generic.c: Update tree_pass descriptors. * reg-stack.c: Update tree_pass descriptors. * sched-rgn.c: Update tree_pass descriptors. * tree-ssa-structalias.c: Update tree_pass descriptors. * tree-cfg.c: Update tree_pass descriptors. * passes.c (current_pass): Update declaration. (finish_optimization_passes): Update. (all_passes, all_ipa_passes, all_lowering_passes): Update declaration. (register_one_dump_file, register_dump_files_1, next_pass_1): Update arguments. (init_optimization_passes): Update handling of new types. (execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update. * ipa-struct-reorg.c: Update tree_pass descriptors. * tree-ssa-reassoc.c: Update tree_pass descriptors. * combine-stack-adj.c: Update tree_pass descriptors. * cfgrtl.c: Update tree_pass descriptors. * dce.c: Update tree_pass descriptors. * tree-ssanames.c: Update tree_pass descriptors. From-SVN: r133342
2008-03-18tree-pretty-print.c: Include predict.h.Jan Hubicka1-0/+1
* tree-pretty-print.c: Include predict.h. (dump_generic_node): Dump predictor. * tree.h (PREDICT_EXPR_OUTCOME, PREDICT_EXPR_PREDICTION): Update. * tree-gimple.c (is_gimple_stmt): Add PREDICT_EXPR. * gimple-low.c (lower_stmt): Likewise. * expr.c (expand_expr_real): Likewise. * predict.c (tree_bb_level_predictions): Use PREDICT_EXPRs and remove them. (build_predict_expr, build_predict_expr): New. * predict.h (predictor_name, build_predict_expr): Update. * c-typeck.c (c_finish_bc_stmt): Add prediction. * gimplify.c (gimplify_expr): Add PREDICT_EXPR. * predict.def (PRED_CONTINUE): Update hitrate. * tree.def (PREDICT_EXPR): Define. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Mark PREDICT_EXPR; do not handle BIND_EXPR. * tree-inline.c (estimate_num_insns_1): PREDICT_EXPR is free. * tree-cfg.c (verify_gimple_stmt): PREDICT_EXPR is valid. * tree-ssa-operands.c (get_expr_operands): PREDICT_EXPR takes no operands. From-SVN: r133313
2008-03-10re PR middle-end/35099 (ICE in remove_unreachable_regions with -O -fopenmp)Jakub Jelinek1-0/+2
PR middle-end/35099 * tree-cfg.c (new_label_mapper): Update cfun->last_label_uid. * g++.dg/gomp/pr35099.C: New test. From-SVN: r133084
2008-03-06tree.def (BIT_FIELD_REF): Constrain result type and its precision.Richard Guenther1-0/+16
2008-03-06 Richard Guenther <rguenther@suse.de> * tree.def (BIT_FIELD_REF): Constrain result type and its precision. * tree-cfg.c (verify_expr): Verify BIT_FIELD_REF constraints on result type and precision. * expr.c (get_inner_reference): Set unsignedp based on the result type of BIT_FIELD_REF. * tree.h (BIT_FIELD_REF_UNSIGNED): Remove. * tree-sra.c (instantiate_element): Do not set BIT_FIELD_REF_UNSIGNED. (try_instantiate_multiple_fields): Likewise. Use the correct type for BIT_FIELD_REF. (sra_build_assignment): Likewise. (sra_build_elt_assignment): Likewise. (sra_explode_bitfield_assignment): Likewise. * print-tree.c (print_node): Do not check BIT_FIELD_REF_UNSIGNED. * tree-vect-transform.c (vect_create_epilog_for_reduction): Do not set BIT_FIELD_REF_UNSIGNED. (vectorizable_load): Likewise. From-SVN: r132969
2008-03-05cfg.c: Include tree-flow.h.Aldy Hernandez1-8/+12
* cfg.c: Include tree-flow.h. (remove_edge_raw): Call redirect_edge_var_map_clear. (redirect_edge_succ_nodup): Call redirect_edge_var_map_dup. * tree-flow-inline.h (redirect_edge_var_map_def): New. (redirect_edge_var_map_result): New. * tree-cfgcleanup.c (remove_forwarder_block_with_phi): Replace PENDING_STMT use with redirect_edge_var_map_*. * tree-ssa.c (edge_var_maps): New definition. (redirect_edge_var_map_add): New. (redirect_edge_var_map_clear): New. (redirect_edge_var_map_dup): New. (redirect_edge_var_map_vector): New. (redirect_edge_var_map_destroy): New. (ssa_redirect_edge): Replace PENDING_STMT use with redirect_edge_var_map_*. (flush_pending_stmts): Same. (delete_tree_ssa): Destroy edge var map. * tree-flow.h (struct _edge_var_map): New. Define edge_var_map vector type. Declare redirect_edge_var_map_* prototypes. * Makefile.in (cfg.o): Depend on TREE_FLOW_H. * tree-cfg.c (reinstall_phi_args): Replace PENDING_STMT use with redirect_edge_var_map_*. From-SVN: r132903
2008-03-05re PR c++/35336 (Broken diagnostic: 'bit_field_ref' not supported by dump_expr)Richard Guenther1-2/+6
2008-03-05 Richard Guenther <rguenther@suse.de> PR c++/35336 * tree.def (BIT_FIELD_REF): Document that operands 1 and 2 should be constants. * tree-cfg.c (verify_expr): Verify it. * fold-const.c (fold_truthop): Remove code generating BIT_FIELD_REFs of structure bases. (fold_binary): Likewise. (fold_ternary): Position and size of BIT_FIELD_REFs are always host integers. (make_bit_field_ref): Remove. (optimize_bit_field_compare): Remove. (all_ones_mask_p): Remove. From-SVN: r132894
2008-02-28invoke.texi: Document -ftree-loop-distribution.Sebastian Pop1-9/+17
* doc/invoke.texi: Document -ftree-loop-distribution. * tree-loop-distribution.c: New. * tree-pass.h (pass_loop_distribution): New. * graphds.h (struct graph): Add htab_t indices. * timevar.def (TV_TREE_LOOP_DISTRIBUTION): New. * tree-vectorizer.c (rename_variables_in_loop): Extern. (slpeel_tree_duplicate_loop_to_edge_cfg): Init PENDING_STMT to NULL. * tree-vectorizer.h (tree_duplicate_loop_on_edge): Declared. * tree-data-ref.c (debug_data_dependence_relations): New. (dump_data_dependence_relation): Also print data references. (free_data_ref): Extern. (same_access_functions): Moved... (find_vertex_for_stmt): Renamed rdg_vertex_for_stmt. (dump_rdg_vertex, debug_rdg_vertex, dump_rdg_component, debug_rdg_component, dump_rdg, debug_rdg, dot_rdg_1, dot_rdg, struct rdg_vertex_info, rdg_vertex_for_stmt): New. (create_rdg_edge_for_ddr, create_rdg_vertices): Cleaned up. (stmts_from_loop): Skip LABEL_EXPR. (hash_stmt_vertex_info, eq_stmt_vertex_info, hash_stmt_vertex_del): New. (build_rdg): Initialize rdg->indices htab. (free_rdg, stores_from_loop, ref_base_address, rdg_defs_used_in_other_loops_p, have_similar_memory_accesses, have_similar_memory_accesses_1, ref_base_address_1, remove_similar_memory_refs): New. * tree-data-ref.h: Depend on tree-chrec.h. (debug_data_dependence_relations, free_data_ref): Declared. (same_access_functions): ... here. (ddr_is_anti_dependent, ddrs_have_anti_deps, ddr_dependence_level): New. (struct rdg_vertex): Add has_mem_write and has_mem_reads. (RDGV_HAS_MEM_WRITE, RDGV_HAS_MEM_READS, RDG_STMT, RDG_MEM_WRITE_STMT, RDG_MEM_READS_STMT): New. (dump_rdg_vertex, debug_rdg_vertex, dump_rdg_component, debug_rdg_component, dump_rdg, debug_rdg, dot_rdg, rdg_vertex_for_stmt): Declared. (struct rdg_edge): Add level. (RDGE_LEVEL): New. (free_rdg, stores_from_loop, remove_similar_memory_refs, rdg_defs_used_in_other_loops_p, have_similar_memory_accesses): Declared. (rdg_has_similar_memory_accesses): New. * tree-vect-analyze.c: Remove unused static decls. * lambda.h (dependence_level): New. * common.opt (ftree-loop-distribution): New. * tree-flow.h (mark_virtual_ops_in_bb, slpeel_tree_duplicate_loop_to_edge_cfg, rename_variables_in_loop): Declared. * Makefile.in (TREE_DATA_REF_H): Depend on tree-chrec.h. (OBJS-common): Add tree-loop-distribution.o. (tree-loop-distribution.o): New rule. * tree-cfg.c (mark_virtual_ops_in_bb): New. (mark_virtual_ops_in_region): Use mark_virtual_ops_in_bb. * passes.c (init_optimization_passes): Schedule pass_loop_distribution. * testsuite/gcc.dg/tree-ssa/ldist-{1..12}.c: New. From-SVN: r132745
2008-02-26system.h (USE_MAPPED_LOCATION): Poison.Tom Tromey1-56/+1
gcc * system.h (USE_MAPPED_LOCATION): Poison. * Makefile.in (GTFILES): Put CPP_ID_DATA_H first. * tree-cfg.c (make_cond_expr_edges): Remove old location code. (make_goto_expr_edges): Likewise. (remove_bb): Likewise. (execute_warn_function_return): Likewise. * basic-block.h (struct edge_def) <goto_locus>: Change type to location_t. * c-common.c (fname_decl): Remove old location code. * tree-vect-transform.c (vect_finish_stmt_generation): Remove old location code. * rtl.h (ASM_OPERANDS_SOURCE_LOCATION): Remove old-location variant. (ASM_INPUT_SOURCE_LOCATION): Likewise. (gen_rtx_ASM_INPUT): Likewise. (gen_rtx_ASM_INPUT_loc): Likewise. (get_rtx_asm_OPERANDS): Remove. * cfglayout.c (insn_locators_alloc): Remove old location code. (set_curr_insn_source_location): Likewise. (curr_insn_locator): Likewise. * print-tree.c (print_node): Remove old location code. * tree-mudflap.c (mf_varname_tree): Remove old location code. (mf_file_function_line_tree): Remove test of USE_MAPPED_LOCATION. * cfgexpand.c (expand_gimple_cond_expr): Don't use location_from_locus. (construct_exit_block): Remove old location code. * emit-rtl.c (force_next_line_note): Remove old location code. * profile.c (branch_prob): Remove old location code. * tree-vectorizer.h (LOC, UNKNOWN_LOC, EXPR_LOC, LOC_FILE, LOC_LINE): Remove old-location variants. * langhooks.c (lhd_print_error_function): Remove old location code. * configure, config.in: Rebuilt. * configure.ac (--enable-mapped-location): Remove. * c-decl.c (c_init_decl_processing): Remove old location code. (finish_function): Likewise. * recog.c (decode_asm_operands): Remove old location code. * c-pch.c (c_common_read_pch): Remove old location code. * rtl.def (ASM_INPUT, ASM_OPERANDS): Remove old location variants. * gimple-low.c (lower_function_body): Remove old location code. * toplev.c (unknown_location): Remove. (push_srcloc): Remove old-location variant. (process_options): Remove old location code. (lang_dependent_init): Likewise. * input.h (UNKNOWN_LOCATION): Move definition. (location_t): Undeprecate. (source_locus): Remove. (location_from_locus): Remove. (struct location_s): Remove. Remove all old-location code. (input_line, input_filename): Remove. * final.c (final_scan_insn): Remove old location code. * diagnostic.c (diagnostic_build_prefix): Remove USE_MAPPED_LOCATION test. * tree.h (gimple_stmt) <locus>: Now a location_t. (tree_exp) <locus>: Likewise. (DECL_IS_BUILTIN): Remove old-location variant. (annotate_with_file_line, annotate_with_locus): Likewise. (expr_locus, set_expr_locus): Update. * tree.c (build1_stat): Remove old location code. (last_annotated_node): Remove. (annotate_with_file_line): Remove old-location variant. (annotate_with_locus): Likewise. (expr_location): Remove old location code. (set_expr_location): Likewise. (expr_has_location): Likewise. (expr_locus): Likewise. (set_expr_locus): Likewise. (expr_filename): Don't use location_from_locus. (expr_lineno): Likewise. * rtl-error.c (location_for_asm): Remove old location code. * c-lex.c (cb_line_change): Remove old location code. (fe_file_change): Likewise. (cb_def_pragma): Likewise. (c_lex_with_flags): Likewise. * gengtype.c (do_typedef): Don't special-case location types. (define_location_structures): Remove. (main): Don't call define_location_structures. * tree-pretty-print.c (dump_implicit_edges): Remove old location code. gcc/ada * misc.c (internal_error_function): Remove test of USE_MAPPED_LOCATION. * trans.c (gigi): Remove test of USE_MAPPED_LOCATION. (Sloc_to_locus): Remove old location code. gcc/cp * parser.c (eof_token): Remove old location code. (check_empty_body): Remove test of USE_MAPPED_LOCATION. * decl2.c (generate_ctor_or_dtor_function): Remove old location code. (cp_write_global_declarations): Likewise. * lex.c (cxx_init): Remove old location code. (handle_pragma_implementation): Remove test of USE_MAPPED_LOCATION. * pt.c (tsubst): Remove old location code. * error.c (cp_print_error_function): Remove test of USE_MAPPED_LOCATION. * decl.c (pop_label): Remove old location code. (finish_function): Likewise. gcc/fortran * trans-io.c (set_error_locus): Remove old location code. * trans-decl.c (gfc_set_decl_location): Remove old location code. * f95-lang.c (gfc_init): Remove test of USE_MAPPED_LOCATION. * scanner.c (gfc_gobble_whitespace): Remove old location code. (get_file): Likewise. (preprocessor_line): Likewise. (load_file): Likewise. (gfc_new_file): Likewise. * trans.c (gfc_trans_runtime_check): Remove old location code. (gfc_get_backend_locus): Likewise. (gfc_set_backend_locus): Likewise. * data.c (gfc_assign_data_value): Remove old location code. * error.c (show_locus): Remove old location code. * gfortran.h (gfc_linebuf): Remove old location code. (gfc_linebuf_linenum): Remove old-location variant. gcc/java * lang.c (java_post_options): Remove conditional. * expr.c (expand_byte_code): Remove old location code. * jcf-parse.c (set_source_filename): Remove old location code. (give_name_to_class): Likewise. (jcf_parse): Likewise. (duplicate_class_warning): Likewise. (parse_class_file): Likewise. (java_parse_file): Likewise. * decl.c (finish_method): Remove old location code. * class.c (push_class): Remove old location code. gcc/objc * objc-act.c (objc_init): Remove old location code. gcc/treelang * tree1.c (treelang_init): Remove old location code. (treelang_parse_file): Likewise. * lex.l (LINEMAP_POSITION_FOR_COLUMN): Remove. (update_lineno_charno): Remove old location code. From-SVN: r132679
2008-01-21re PR target/34856 (ICE with some constant vectors)Richard Guenther1-1/+1
2008-01-21 Richard Guenther <rguenther@suse.de> PR middle-end/34856 * tree-cfg.c (verify_expr): Allow all invariant expressions instead of just constant class ones as reference argument. * tree-ssa-loop-im.c (for_each_index): Handle CONSTRUCTOR like any other constant. * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Likewise. * gcc.c-torture/compile/pr34856.c: New testcase. From-SVN: r131696
2008-01-19re PR gcov-profile/34610 (ICE with "-fprofile-arcs -fopenmp")Jakub Jelinek1-5/+10
PR gcov-profile/34610 * tree-cfg.c (make_edges): Mark both outgoing edges from OMP_CONTINUE and from OMP_FOR as EDGE_ABNORMAL. * omp-low.c (expand_omp_for): Clear EDGE_ABNORMAL bits from OMP_FOR and OMP_CONTINUE outgoing edges. * tree-profile.c (tree_profiling): Return early if cfun->after_tree_profile != 0. Set cfun->after_tree_profile at the end. * omp-low.c (expand_omp_parallel): Copy after_tree_profile from cfun to child_cfun. * function.h (struct function): Add after_tree_profile bit. * gcc.dg/gomp/pr34610.c: New test. From-SVN: r131653
2008-01-10re PR tree-optimization/34683 (SSA rewriting in the loop unroller causes ↵Richard Guenther1-1/+15
quadratic behavior) 2008-01-10 Richard Guenther <rguenther@suse.de> PR middle-end/34683 * tree-cfg.c (tree_merge_blocks): Do not go through the full-blown folding and stmt updating path if we just deal with virtual operands. * tree-ssa-copy.c (may_propagate_copy): Do not short-cut test for abnormal SSA_NAMEs. From-SVN: r131446
2008-01-04re PR tree-optimization/34029 (internal compiler error: verify_stmts failed)Richard Guenther1-0/+5
2008-01-04 Richard Guenther <rguenther@suse.de> PR middle-end/34029 * tree-cfg.c (verify_expr): Do not look inside ADDR_EXPRs for verifying purposes if they are is_gimple_min_invariant. * gcc.c-torture/compile/pr34029-1.c: New testcase. * gcc.c-torture/compile/pr34029-2.c: Likewise. From-SVN: r131325
2007-12-15tree-scalar-evolution.c (number_of_iterations_for_all_loops): Replace ↵Sebastian Pop1-35/+95
print_loop_ir with print_loops. 2007-12-15 Sebastian Pop <sebastian.pop@amd.com> * tree-scalar-evolution.c (number_of_iterations_for_all_loops): Replace print_loop_ir with print_loops. * tree-flow.h (dot_cfg, debug_loops, debug_loop, debug_loop_num, print_loops, print_loops_bb): Declare. * tree-cfg.c (print_loops_bb): New. (print_loop): Print header, latch, bounds, estimation of iterations. (print_loop_and_siblings): New. (print_loop_ir): Renamed print_loops. (debug_loop_ir): Renamed debug_loops. (debug_loop, debug_loop_num): New. From-SVN: r130957
2007-10-292007-09-23 Razya LadelskyRazya Ladelsky1-0/+7
Zdenek Dvorak OMP_ATOMIC Changes, Reduction support for automatic parallelization. * expr.c (expand_expr_real_1): Add cases for OMP_ATOMIC_LOAD, OMP_ATOMIC_STORE. * Makefile.in: Add dependencies to expr.o, tree-parloops.o, omp-low.o * tree-pretty-print.c (dump_generic_node): Add OMP_ATOMIC_LOAD and OMP_ATOMIC_STORE. * tree.h (OMP_DIRECTIVE_P): Add OMP_ATOMIC_LOAD, OMP_ATOMIC_STORE. * gimple-low.c (lower_stmt): Same. * gimplify.c (gimplify_expr): Same. (gimplify_omp_atomic_fetch_op, gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex): Remove. (gimplify_omp_atomic): Change it to simply gimplify the statement instead of expanding it. * omp-low.c: Add includes to optabs.h, cfgloop.h. (expand_omp_atomic, expand_omp_atomic_pipeline, goa_stabilize_expr, expand_omp_atomic_mutex, expand_omp_atomic_fetch_op): New functions to implement expansion of OMP_ATOMIC. (expand_omp, build_omp_regions_1): Add support for OMP_ATOMIC_LOAD/OMP_ATOMIC_STORE. * tree-cfg.c (make_edges): add case for OMP_ATOMIC_LOAD, OMP_ATOMIC_STORE. * tree-gimple.c (is_gimple_stmt): Add OMP_ATOMIC_LOAD, OMP_ATOMIC_STORE. * tree-parloops.c: add include to tree-vectorizer.h. (reduction_info): New structure for reduction. (reduction_list): New list to represent list of reductions per loop. (struct data_arg): New helper structure for reduction. (reduction_info_hash, reduction_info_eq, reduction_phi, initialize_reductions, create_call_for_reduction, create_phi_for_local_result, create_call_for_reduction_1, create_loads_for_reductions, create_final_loads_for_reduction): New functions. (loop_parallel_p): Identify reductions, add reduction_list parameter. (separate_decls_in_loop_name): Support reduction variables. (separate_decls_in_loop): Add reduction_list and ld_st_data arguments, call create_loads_for_reduction for each reduction. (canonicalize_loop_ivs): Identify reductions, add reduction_list parameter. (transform_to_exit_first_loop): Add reduction support, add reduction_list parameter. (gen_parallel_loop): Add reduction_list parameter. Add call separate_decls_in_loop with the new argument. Traverse reductions and call initialize_reductions, create_call_for_reduction. (parallelize_loops): Create and delete the reduction list. (add_field_for_name): Change use of data parameter. Add fields for reductions. * tree-vectorizer.h (vect_analyze_loop_form): Add declaration. * tree-vect-analyze.c (vect_analyze_loop_form): export it. * tree.def: Add definitions for OMP_ATOMIC_LOAD, OMP_ATOMIC_STORE. * tree-inline.c (estimate_num_insns_1): add cases for OMP_ATOMIC_LOAD, OMP_ATOMIC_STORE. * tree-cfg.c (make_edges): Add OMP_ATOMIC_LOAD, OMP_ATOMIC_STORE. * tree-ssa-operands.c (get_addr_dereference_operands): New function. Subroutine of get_indirect_ref_operands. (get_indirect_ref_operands): Call get_addr_dereference_operands. (get_expr_operands): Support OMP_ATOMIC_LOAD, OMP_ATOMIC_STORE. From-SVN: r129716
2007-10-17builtins.c (gimplify_va_arg_expr): Use inform for help message.Manuel López-Ibáñez1-3/+3
2007-10-17 Manuel Lopez-Ibanez <manu@gcc.gnu.org> * builtins.c (gimplify_va_arg_expr): Use inform for help message. * toplev.c (check_global_declaration_1): Use appropriate warning option instead of unnamed warning. * stor-layout.c (layout_decl): Likewise. * c-typeck.c (build_conditional_expr): Likewise. (build_compound_expr): Fix wrong comment. (build_binary_op): Use appropriate warning option instead of unnamed warning. * cfgexpand.c (tree_expand_cfg): Likewise. * tree-optimize.c (tree_rest_of_compilation): Likewise. * tree-cfg.c (remove_useless_stmts_warn_notreached): Likewise. (execute_warn_function_return): Likewise. * stmt.c (warn_if_unused_value): Likewise. cp/ * typeck.c (build_binary_op) : Use appropriate warning option instead of unnamed warning. From-SVN: r129393
2007-10-11re PR middle-end/33724 (Type checking error with address-of and ref-all ↵Richard Guenther1-6/+21
pointer type) 2007-10-11 Richard Guenther <rguenther@suse.de> PR middle-end/33724 * tree-cfg.c (one_pointer_to_useless_type_conversion_p): New function. (verify_gimple_expr): Use it to verify pointer-to types for ADDR_EXPRs. * gcc.dg/pr33724.c: New testcase. From-SVN: r129228
2007-10-06re PR tree-optimization/33572 (wrong code with -O)Alexandre Oliva1-3/+10
gcc/ChangeLog: PR tree-optimization/33572 * tree-cfg.c (verify_stmts): Check for missing PHI defs. * tree-inline.c (update_ssa_across_eh_edges): Renamed to... (update_ssa_across_abnormal_edges): ... this. Set slots in the return PHI node. (copy_edges_for_bb): Handle nonlocal label edges. (make_nonlocal_label_edges): Deleted. (optimize_inline_calls): Don't call it. gcc/testsuite/ChangeLog: PR tree-optimization/33572 * g++.dg/torture/pr33572.C: New. From-SVN: r129051
2007-10-05tree-cfg.c (verify_gimple_expr): Accept OBJ_TYPE_REF.Richard Guenther1-0/+4
2007-10-05 Richard Guenther <rguenther@suse.de> * tree-cfg.c (verify_gimple_expr): Accept OBJ_TYPE_REF. * g++.dg/tree-ssa/obj-type-ref.C: New testcase. From-SVN: r129033
2007-10-04re PR middle-end/33641 (perlbmk gets type mismatch in pointer plus expression)Richard Guenther1-11/+28
2007-10-04 Richard Guenther <rguenther@suse.de> PR middle-end/33641 * tree-cfg.c (verify_gimple_expr): Operand one of POINTER_PLUS_EXPR does not need to be of INTEGER_TYPE. (verify_gimple_2): New function split out from ... (verify_gimple_1): ... here. ICE if there was an error during verification. * gcc.c-torture/compile/pr33641.c: New testcase. From-SVN: r129010
2007-09-27re PR tree-optimization/33565 (spurious warning: assuming signed overflow ↵Ian Lance Taylor1-2/+1
does not occur when assuming that (X + c) >= X is always true) ./: PR tree-optimization/33565 * tree-ssa-loop-ch.c (copy_loop_headers): Set TREE_NO_WARNING on assignments of comparisons. * tree-ssa-sccvn.c (simplify_binary_expression): Add stmt parameter. Change caller. Defer overflow warnings around call to fold_binary. * fold-const.c (fold_undefer_overflow_warnings): Don't warn if TREE_NO_WARNING is set on the statement. * tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars): Don't test TREE_NO_WARNING when calling fold_undefer_overflow_warnings. * tree-cfg.c (fold_cond_expr_cond): Likewise. testsuite/: PR tree-optimization/33565 * gcc.dg/Wstrict-overflow-20.c: New test. From-SVN: r128840
2007-09-18tree-cfg.c (is_ctrl_altering_stmt, [...]): Don't use const_get_call_expr_in.Kaveh R. Ghazi1-2/+2
* tree-cfg.c (is_ctrl_altering_stmt, tree_block_ends_with_call_p): Don't use const_get_call_expr_in. * tree-gimple.c (const_get_call_expr_in): Delete. * tree-gimple.h (const_get_call_expr_in): Likewise. From-SVN: r128569
2007-09-15tree-parloops.c: New file.Zdenek Dvorak1-42/+245
* tree-parloops.c: New file. * tree-ssa-operands.h (free_stmt_operands): Declare. * tree-ssa-loop-manip.c (split_loop_exit_edge): Return the new basic block. * tree-pass.h (pass_parallelize_loops): Declare. * omp-low.c (expand_omp_parallel, expand_omp_for): Update SSA form for virtual operands. (build_omp_regions_1): Allow analysing just a single OMP region and its subregions. ( build_omp_regions_root, omp_expand_local): New functions. (build_omp_regions): Add argument to build_omp_regions_1 call. * builtins.def (DEF_GOMP_BUILTIN): Initialize OMP builtins when autoparallelization is run. * timevar.def (TV_TREE_PARALLELIZE_LOOPS): New. * tree-ssa-loop.c (gate_tree_parallelize_loops, tree_parallelize_loops, pass_parallelize_loops): New. * common.opt (ftree-parallelize-loops): New. * tree-flow.h (omp_expand_local, tree_duplicate_sese_tail, parallelize_loops): Declare. (add_phi_args_after_copy, split_loop_exit_edge): Declaration changed. * Makefile.in (tree-parloops.o): Added. * tree-cfg.c (add_phi_args_after_copy_edge, tree_duplicate_sese_tail): New functions. (add_phi_args_after_copy_bb): Use add_phi_args_after_copy_edge. (add_phi_args_after_copy): Call add_phi_args_after_copy_edge for one extra edge as well. (tree_duplicate_sese_region): Add argument to add_phi_args_after_copy. Use VEC_free to free doms vector. (move_block_to_fn): Update loop info. Remove phi nodes for virtual operands. Recompute operand caches in the new function. (move_sese_region_to_fn): Update loop info. * passes.c (init_optimization_passes): Add pass_parallelize_loops. * tree-ssa-operands.c (free_stmt_operands): New function. * doc/passes.texi: Document autoparallelization. * doc/invoke.texi (-ftree-parallelize-loops): New option. * gcc.dg/tree-ssa/parallelization-1.c: New test. From-SVN: r128517
2007-09-08tree-cfg.c (verify_gimple_expr): Avoid building new pointer types, use ↵Richard Guenther1-6/+7
TYPE_POINTER_TO if available instead. 2007-09-08 Richard Guenther <rguenther@suse.de> * tree-cfg.c (verify_gimple_expr): Avoid building new pointer types, use TYPE_POINTER_TO if available instead. From-SVN: r128271
2007-09-07tree-flow.h (const_block_stmt_iterator): Remove.Diego Novillo1-9/+9
* tree-flow.h (const_block_stmt_iterator): Remove. Update all users to use block_stmt_iterator. * tree-iterator.h (const_tree_stmt_iterator): Remove. Update all users to use tree_stmt_iterator. From-SVN: r128246
2007-09-07cgraphbuild.c (rebuild_cgraph_edges): Export.Zdenek Dvorak1-63/+195
* cgraphbuild.c (rebuild_cgraph_edges): Export. * cgraph.h (rebuild_cgraph_edges): Declare. * tree-pass.h (pass_expand_omp_ssa): New. * omp-low.c (find_omp_clause): Export. (copy_var_decl): Split from omp_copy_decl_2. (build_omp_barrier): Return the call to emit instead of emitting it directly. (lower_rec_input_clauses, expand_omp_single): Gimplify the result of build_omp_barrier. (extract_omp_for_data, expand_parallel_call, expand_omp_parallel, expand_omp_for_generic, expand_omp_for_static_nochunk, expand_omp_for_static_chunk, expand_omp_for, expand_omp_sections): Adapted to work on SSA form. (execute_expand_omp): Do not invalidate dominance information. (gate_expand_omp): Do not run with -fopenmp-ssa flag. (gate_expand_omp_ssa, pass_expand_omp_ssa): New. * gimplify.c (gimplify_omp_for): Ensure that the control variable is a gimple_reg. (force_gimple_operand): Allow gimplifying code expressions without value. * tree-predcom.c (mark_virtual_ops_for_renaming): Handle phi nodes. * common.opt (fopenmp-ssa): New. * tree-flow.h (find_omp_clause, copy_var_decl): Declare. * Makefile.in (tree-cfg.o): Add TREE_INLINE_H dependency. * tree-cfg.c: Include tree-inline.h. (struct move_stmt_d): Replace vars_to_remove by vars_map field. (replace_by_duplicate_decl, replace_ssa_name, mark_virtual_ops_in_region): New functions. (move_stmt_r, move_block_to_fn, move_sese_region_to_fn): Adapted to work on SSA form. * passes.c (init_optimization_passes): Add pass_expand_omp_ssa pass. * tree-ssa-operands.c (get_expr_operands): Handle operands of OMP constructs. From-SVN: r128223
2007-09-06tree-cfg.c (remove_bb): Only warn if line is non-zero.Tom Tromey1-1/+1
gcc: * tree-cfg.c (remove_bb): Only warn if line is non-zero. * c-pch.c (c_common_read_pch): Restore current location after reading PCH file. * tree.c (expand_location): Update. (expr_filename): Changed return type. Unified the two cases. (expr_lineno): Likewise. (annotate_with_file_line): Don't use EXPR_LINENO and EXPR_FILENAME as lvalues. * toplev.c (line_table): Changed type. (general_init): Update. (realloc_for_line_map): New function. (general_init): Allocate line_table using GC. * fix-header.c (line_table): Changed type. (read_scan_file): Update. (read_scan_file): Update. * c-ppoutput.c (maybe_print_line): Update. (print_line): Update. (cb_line_change): Update. (cb_define): Update. (pp_file_change): Update. * c-opts.c (c_common_init_options): Update. (finish_options): Update. (push_command_line_include): Update. * c-lex.c (cb_line_change): Update. (cb_def_pragma): Update. (cb_define): Update. (cb_undef): Update. (c_lex_with_flags): Use cpp_get_token_with_location. * input.h (line_table): Changed type. (location_from_locus): New macro. * tree.h (EXPR_FILENAME): No longer an lvalue. (EXPR_LINENO): Likewise. (expr_locus, set_expr_locus): Declare separately for USE_MAPPED_LOCATION. (expr_filename, expr_lineno): Changed return type. * gimplify.c (tree_to_gimple_tuple): Use SET_EXPR_LOCUS. * cfgexpand.c (expand_gimple_cond_expr): Use location_from_locus. (expand_gimple_basic_block): Likewise. * final.c (final_scan_insn): Use expanded_location. gcc/cp: * decl.c (finish_function): Put return's location on line zero of file. gcc/fortran: * scanner.c (get_file): Update. (load_file): Update. (gfc_next_char_literal): Use gfc_linebuf_linenum. * f95-lang.c (gfc_init): Update. * gfortran.h (gfc_linebuf_linenum): New macro. gcc/java: * lang.c (java_post_options): Update. * jcf-parse.c (set_source_filename): Update. (give_name_to_class): Update. (jcf_parse): Update. (duplicate_class_warning): Update. (parse_class_file): Update. (java_parse_file): Update. * expr.c (expand_byte_code): Update. gcc/testsuite: * lib/g++.exp (g++_target_compile): Use -fno-show-column. gcc/treelang: * tree1.c (treelang_init): Update. (treelang_parse_file): Update. (treelang_parse_file): Update. (treelang_parse_file): Update. * lex.l: Update. (update_lineno_charno): Likewise. libcpp: * internal.h (struct cpp_reader) <invocation_location>: New field. (struct cpp_reader) <set_invocation_location>: Likewise. * init.c (cpp_set_line_map): New function. * line-map.c (linemap_add): Use linemap's allocator. * include/line-map.h (GTY): Define. (line_map_realloc): New typedef. (struct line_map): Mark with GTY. (struct line_maps): Likewise. (struct line_maps) <maps>: Likewise. (struct line_maps) <reallocator>: New field. * include/symtab.h (GTY): Conditionally define. * include/cpplib.h (cpp_set_line_map): Declare. (cpp_get_token_with_location): Declare. * macro.c (cpp_get_token): Set invocation_location on the reader. (cpp_get_token_with_location): New function. From-SVN: r128190
2007-09-05Add target hook invoked when cfun changes.Sandra Loosemore1-8/+6
2007-09-05 Sandra Loosemore <sandra@codesourcery.com> gcc/ Add target hook invoked when cfun changes. * doc/tm.texi (TARGET_SET_CURRENT_FUNCTION): Document. * target.h (struct gcc_target): Add set_current_function. * target-def.h (TARGET_SET_CURRENT_FUNCTION): Define. (TARGET_INITIALIZER): Add initializer for set_current_function. * tree.h (push_struct_function): New. * tree-inline.h (push_cfun, pop_cfun): Move declarations to... * function.h: Here. (set_cfun): Declare. * tree-inline.c (cfun_stack, push_cfun, pop_cfun): Moved to... * function.c: Here. (push_function_context_to): Use allocate_struct_function to create null context, not init_dummy_function_start. Use set_cfun. (pop_function_context_from): Use set_cfun. (in_dummy_function): New. (invoke_set_current_function_hook): New. (set_cfun): New. (push_cfun, pop_cfun): Use set_cfun. (push_struct_function): New. (allocate_struct_function): Call invoke_set_current_function_hook before returning. (prepare_function_start): Don't set cfun here. Remove unused argument; fix all callers. (init_dummy_function_start): Fiddle with in_dummy_function. Call push_struct_function. (init_function_start): Set cfun here. (expand_dummy_function_end): Fiddle with in_dummy_function. Pop cfun. * omp-low.c (create_omp_child_function): Use push_struct_function and pop_cfun to save/restore state. (expand_omp_parallel): Remove unused saved_cfun variable. * cgraphunit.c (ipa_passes): Use set_cfun. * gimple-low.c (record_vars_into): Use push_cfun/pop_cfun here. * dwarf2out.c (dwarf2out_abstract_function): Likewise. * matrix-reorg.c (transform_allocation_sites): Likewise. (matrix_reorg): Use set_cfun. * gimplify.c (gimplify_function_tree): Use push_cfun/pop_cfun here. * tree-optimize.c (tree_rest_of_compilation): Remove one redundant assignment to cfun; use set_cfun for the other. * tree-cfg.c (move_sese_region_to_fn): Use set_cfun. (dump_function_to_file): Use push_cfun/pop_cfun here. * c-decl.c (finish_function): Use set_cfun. gcc/ada/ * trans.c (Compilation_unit_to_gnu): Use set_cfun. * utils.c (end_subprog_body): Likewise. gcc/cp/ * decl.c (finish_function): Use set_cfun. * method.c (use_thunk): Likewise. gcc/fortran/ * trans-decl.c (build_entry_thunks): Use set_cfun. (gfc_generate_function_code): Likewise. gcc/java/ * decl.c (finish_method): Use set_cfun. gcc/treelang/ * treetree.c (tree_code_create_function_wrapup): Use set_cfun. From-SVN: r128132
2007-09-03system.h (CONST_CAST2, [...]): New macros for type-specific casts.Kaveh R. Ghazi1-2/+2
* system.h (CONST_CAST2, CONST_CAST_TREE, CONST_CAST_RTX, CONST_CAST_BB): New macros for type-specific casts. (CONST_CAST): Add a TYPE parameter and define it in terms of CONST_CAST2. * c-decl.c (c_make_fname_decl): Supply a TYPE for CONST_CAST. * c-lex.c (cb_ident, lex_string): Likewise, * c-typeck.c (free_all_tagged_tu_seen_up_to): Likewise, * config/i386/i386.c (ix86_function_regparm, ix86_function_sseregparm): Use CONST_CAST_TREE. * config/mmix/mmix.c (mmix_encode_section_info): Supply a TYPE for CONST_CAST. * gcc.c (set_spec, read_specs, for_each_path, execute, do_spec_1, give_switch, set_multilib_dir): Likewise, * gengtype-parse.c (string_seq, typedef_name): Likewise, * gimple-low.c (block_may_fallthru): Use CONST_CAST_TREE. * jump.c (reversed_comparison_code_parts): Use CONST_CAST_RTX. * passes.c (execute_one_pass): Supply a TYPE for CONST_CAST. * prefix.c (update_path): Likewise, * pretty-print.c (pp_base_destroy_prefix): Likewise, * rtlanal.c (keep_with_call_p): Use CONST_CAST_RTX. * tree-cfg.c (tree_can_merge_blocks_p, tree_block_ends_with_condjump_p): Use CONST_CAST_BB. * tree-eh.c (lookup_stmt_eh_region_fn): USe CONST_CAST_TREE. * tree.c (build_string): Supply a TYPE for CONST_CAST. (attribute_list_contained): Use CONST_CAST_TREE. cp: * call.c (name_as_c_string): Supply a TYPE for CONST_CAST. * decl.c (cp_make_fname_decl): Likewise, * parser.c (cp_parser_string_literal): Likewise, * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE. * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p): Likewise, fortran: * gfortranspec.c (lang_specific_driver): Use CONST_CAST2. * options.c (gfc_post_options): Supply a TYPE for CONST_CAST. * parse.c (parse_omp_structured_block): Likewise, * st.c (gfc_free_statement): Likewise, java: * jcf-parse.c (read_class, java_parse_file): Supply a TYPE for CONST_CAST. * jcf.h (JCF_FINISH): Likewise. From-SVN: r128051
2007-09-01c-common.c (const_strip_array_types): Delete.Kaveh R. Ghazi1-16/+6
* c-common.c (const_strip_array_types): Delete. * c-common.h (const_strip_array_types): Likewise. * emit-rtl.c (const_next_insn, const_previous_insn, const_next_nonnote_insn, const_prev_nonnote_insn, const_next_real_insn, const_prev_real_insn, const_next_active_insn, const_prev_active_insn, const_next_label, const_prev_label): Delete. * gimple-low.c (block_may_fallthru): Use expr_last. * jump.c (reversed_comparison_code_parts): Use prev_nonnote_insn. * rtl.h (const_previous_insn, const_next_insn, const_prev_nonnote_insn, const_next_nonnote_insn, const_prev_real_insn, const_next_real_insn, const_prev_active_insn, const_next_active_insn, const_prev_label, const_next_label): Delete. * rtlanal.c (keep_with_call_p): Use next_nonnote_insn. * system.h (CONST_CAST): Update comment. * tree-cfg.c (tree_can_merge_blocks_p): Use last_stmt. (const_first_stmt, const_last_stmt): Delete. (tree_block_ends_with_condjump_p): Use last_stmt. * tree-flow.h (const_first_stmt, const_last_stmt): Delete. * tree-iterator.c (const_expr_first, const_expr_last, const_expr_only): Delete. * tree.c (const_lookup_attribute): Likewise. (attribute_list_contained): Use lookup_attribute. * tree.h (const_lookup_attribute, const_expr_first, const_expr_last, const_expr_only): Delete. cp: * tree.c (pod_type_p, zero_init_p): Use strip_array_types. * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p): Likewise. From-SVN: r128014
2007-09-01tree-cfg.c (verify_gimple_expr): Fix check for conversions between integral ↵Richard Guenther1-2/+4
types. 2007-09-01 Richard Guenther <rguenther@suse.de> * tree-cfg.c (verify_gimple_expr): Fix check for conversions between integral types. Also allow conversions between pointer types. From-SVN: r128011
2007-08-27alias.c (memory_modified_1, [...]): Constify.Kaveh R. Ghazi1-18/+18
* alias.c (memory_modified_1, memory_modified_in_insn_p): Constify. * basic-block.h (tree_predicted_by_p, rtl_predicted_by_p): Likewise. * bb-reorder.c (copy_bb_p): Likewise. * cfghooks.c (can_remove_branch_p, can_merge_blocks_p, predicted_by_p, can_duplicate_block_p, block_ends_with_call_p, block_ends_with_condjump_p): Likewise. * cfghooks.h (can_remove_branch_p, can_merge_blocks_p, predicted_by_p, can_duplicate_block_p, block_ends_with_call_p, block_ends_with_condjump_p): Likewise. * cfglayout.c (cfg_layout_can_duplicate_bb_p): Likewise. * cfgrtl.c (can_delete_note_p, can_delete_label_p, rtl_can_merge_blocks, cfg_layout_can_merge_blocks_p, rtl_block_ends_with_call_p, rtl_block_ends_with_condjump_p, need_fake_edge_p, rtl_can_remove_branch_p): Likewise. * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Use debug_true_const_tree instad of debug_true_tree. * debug.c (do_nothing_debug_hooks): Likewise. * debug.h (ignore_block, debug_true_const_tree): Constify. * dwarf2out.c (stack_adjust_offset, clobbers_queued_reg_save, dwarf2out_ignore_block, is_pseudo_reg, is_tagged_type, decl_ultimate_origin, block_ultimate_origin, lookup_decl_loc, same_dw_val_p, add_ranges, is_subrange_type, type_is_enum, dbx_reg_number, is_based_loc, field_type, simple_type_align_in_bits, simple_decl_align_in_bits, simple_type_size_in_bits, field_byte_offset, insert_float, type_tag, member_declared_type, is_redundant_typedef, secname_for_decl, is_inlined_entry_point): Likewise. * emit-rtl.c (const_next_insn, const_previous_insn, const_next_nonnote_insn, const_prev_nonnote_insn, const_next_real_insn, const_prev_real_insn, const_next_active_insn, const_prev_active_insn, const_next_label, const_prev_label): Likewise. * except.h (lookup_stmt_eh_region_fn, lookup_stmt_eh_region): Likewise. * haifa-sched.c (may_trap_exp, haifa_classify_insn, find_set_reg_weight, no_real_insns_p, find_set_reg_weight, sched_insn_is_legitimate_for_speculation_p): Likewise. * jump.c (reversed_comparison_code_parts, reversed_comparison_code, reversed_comparison, condjump_label): Likewise. * predict.c (rtl_predicted_by_p, tree_predicted_by_p): Likewise. * reg-stack.c (stack_regs_mentioned_p, stack_regs_mentioned): Likewise. * rtl.h (const_previous_insn, const_next_insn, const_prev_nonnote_insn, const_next_nonnote_insn, const_prev_real_insn, const_next_real_insn, const_prev_active_insn, const_next_active_insn, const_prev_label, const_next_label, modified_between_p, modified_in_p, const_note_storeskeep_with_call_p, condjump_label, reversed_comparison, reversed_comparison_code, reversed_comparison_code_parts, memory_modified_in_insn_p, stack_regs_mentioned): Likewise. * rtlanal.c (modified_between_p, modified_in_p, const_note_stores, keep_with_call_p): Likewise. * sched-deps.c (deps_may_trap_p, sched_get_condition, conditions_mutex_p, sched_insns_conditions_mutex_psd_next_list, sd_lists_size, sd_lists_empty_p): Likewise. * sched-int.h (sched_insns_conditions_mutex_p, haifa_classify_insn, no_real_insns_p, sched_insn_is_legitimate_for_speculation_p, sd_next_list, sd_lists_size, sd_lists_empty_p): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * tree-cfg.c (tree_can_merge_blocks_p, is_ctrl_altering_stmt, stmt_ends_bb_p, tree_can_remove_branch_p, tree_can_duplicate_bb_p, -tree_block_ends_with_call_p, tree_block_ends_with_condjump_p): Likewise. * tree-eh.c (lookup_stmt_eh_region_fn, lookup_stmt_eh_region, tree_can_throw_internal): Likewise. * tree-flow-inline.h (phi_nodes): Likewise. * tree-flow.h (phi_nodesstmt_ends_bb_p, is_ctrl_altering_stmt, tree_can_throw_internal, lookup_stmt_eh_region): Likewise. * tree-gimple.c (const_get_call_expr_in): Likewise. * tree-gimple.h (const_get_call_expr_in): Likewise. * tree.c (const_lookup_attribute, attribute_list_equal, attribute_list_contained): Likewise. * tree.h (attribute_list_equal, attribute_list_contained, const_lookup_attribute): Likewise. * vmsdbgout.c (vmsdbgout_ignore_block): Likewise. From-SVN: r127824
2007-08-16c-common.c (const_strip_array_types): New.Kaveh R. Ghazi1-1/+1
* c-common.c (const_strip_array_types): New. * c-common.h (lang_missing_noreturn_ok_p): Delete. (const_strip_array_types): New. * c-objc-common.c (c_disregard_inline_limits, c_warn_unused_global_decl): Constify. * c-tree.h (c_disregard_inline_limits, c_warn_unused_global_decl, c_vla_type_p, c_incomplete_type_error): Likewise. * c-typeck.c (c_incomplete_type_error, c_vla_type_p): Likewise. * hooks.c (hook_bool_const_tree_false): New. * hooks.h (hook_bool_const_tree_false): Likewise. * langhooks-def.h (lhd_warn_unused_global_decl, lhd_incomplete_type_error, lhd_expr_size, lhd_tree_inlining_disregard_inline_limits, lhd_tree_inlining_auto_var_in_fn_p, lhd_tree_dump_type_quals, LANG_HOOKS_GENERIC_TYPE_P, LANG_HOOKS_TYPE_MAX_SIZE): Constify. * langhooks.c (lhd_warn_unused_global_decl, lhd_incomplete_type_error, lhd_tree_inlining_disregard_inline_limits, lhd_tree_inlining_auto_var_in_fn_p, lhd_tree_dump_type_quals, lhd_expr_size): Likewise. * langhooks.h (lang_hooks_for_tree_inlining, lang_hooks_for_tree_dump, lang_hooks_for_types, lang_hooks_for_decls, lang_hooks): Likewise. * pointer-set.c (pointer_set_t, pointer_set_create, pointer_set_contains, insert_aux, pointer_set_insert, pointer_set_traverse, pointer_map_t, pointer_map_create, pointer_map_contains, pointer_map_insert, pointer_map_traverse): Likewise. * pointer-set.h (pointer_set_contains, pointer_set_insert, pointer_set_traverse, pointer_map_contains, pointer_map_insert, pointer_map_traverse): Likewise. * predict.c (assert_is_empty): Likewise. * tree-affine.c (free_name_expansion): Likewise. * tree-cfg.c (edge_to_cases_cleanup): Likewise. * tree.c (size_in_bytes, max_int_size_in_bytes): Likewise. * tree.h (size_in_bytes, max_int_size_in_bytes): Likewise. ada: * misc.c (gnat_type_max_size): Constify. cp: * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size): Constify. * cp-tree.h (local_variable_p, nonstatic_local_decl_p, class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals, cxx_incomplete_type_diagnostic, cxx_incomplete_type_error, cxx_warn_unused_global_decl, cp_expr_size): Likewise. * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise. * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise. * typeck.c (cp_type_quals): Likewise. * typeck2.c (cxx_incomplete_type_diagnostic, cxx_incomplete_type_error): Likewise. From-SVN: r127560
2007-08-14alias.c (component_uses_parent_alias_set): Constify.Kaveh R. Ghazi1-0/+12
* alias.c (component_uses_parent_alias_set): Constify. * alias.h (component_uses_parent_alias_set): Likewise. * cfgrtl.c (print_rtl_with_bb): Likewise. * double-int.c (tree_to_double_int, double_int_fits_to_tree_p, mpz_get_double_int): Likewise. * double-int.h (double_int_fits_to_tree_p, tree_to_double_int, mpz_get_double_int): Likewise. * expr.c (is_aligning_offset, undefined_operand_subword_p, mostly_zeros_p, all_zeros_p, safe_from_p, is_aligning_offset): Likewise. * expr.h (safe_from_p): Likewise. * gimple-low.c (try_catch_may_fallthru, block_may_fallthru): Likewise. * gimplify.c (should_carry_locus_p, zero_sized_field_decl, zero_sized_type, goa_lhs_expr_p): Likewise. * omp-low.c (is_variable_sized, use_pointer_for_field): Likewise. * rtl.h (print_rtl_with_bb): Likewise. * sched-vis.c (print_exp, print_value, print_pattern): Likewise. * tree-cfg.c (const_first_stmt, const_last_stmt): New. * tree-flow-inline.h (bb_stmt_list): Constify. (cbsi_start, cbsi_last, cbsi_end_p, cbsi_next, cbsi_prev, cbsi_stmt): New. * tree-flow.h (const_block_stmt_iterator, cbsi_start, cbsi_last, const_first_stmt, const_last_stmt): New. (block_may_fallthru, empty_block_p): Constify. * tree-iterator.c (EXPR_FIRST_BODY, EXPR_LAST_BODY, EXPR_ONLY_BODY): New. (expr_first, expr_last, expr_only): Use macro for body. (const_expr_first, const_expr_last, const_expr_only): New. * tree-iterator.h (const_tree_stmt_iterator, ctsi_start, ctsi_last, ctsi_end_p, ctsi_one_before_end_p, ctsi_next, ctsi_prev, ctsi_stmt): New. * tree-scalar-evolution.c (get_loop_exit_condition): Constify. * tree-scalar-evolution.h (get_loop_exit_condition): Likewise. * tree-ssa-loop-niter.c (loop_only_exit_p, derive_constant_upper_bound): Likewise. * tree-ssa-phiopt.c (empty_block_p): Likewise. * tree-ssa-threadupdate.c (redirection_block_p): Likewise. * tree-vectorizer.c (slpeel_can_duplicate_loop_p): Likewise. * tree-vectorizer.h (slpeel_can_duplicate_loop_p): Likewise. * tree-vrp.c (vrp_bitmap_equal_p): Likewise. * tree.c (get_type_static_bounds): Likewise. * tree.h (const_expr_first, const_expr_last, const_expr_only): New. (get_type_static_bounds): Constify. From-SVN: r127483
2007-08-14alias.c (rtx_equal_for_memref_p): Constify.Kaveh R. Ghazi1-3/+3
* alias.c (rtx_equal_for_memref_p): Constify. * basic-block.h (const_edge, const_basic_block): New. (reg_set_to_hard_reg_set, dfs_enumerate_from, single_succ_p, single_pred_p, single_succ_edge, single_pred_edge, single_succ, single_pred, maybe_hot_bb_p, probably_cold_bb_p, probably_never_executed_bb_p, edge_probability_reliable_p, br_prob_note_reliable_p, forwarder_block_p, flow_nodes_print, inside_basic_block_p, control_flow_insn_p, dominated_by_p): Likewise. * bb-reorder.c (better_edge_p, push_to_next_round_p): Likewise. * bt-load.c (basic_block_freq, insn_sets_btr_p, can_move_up): Likewise. * cfganal.c (flow_active_insn_p, forwarder_block_p, flow_nodes_print, dfs_enumerate_from): Likewise. * cfgbuild.c (count_basic_blocks, inside_basic_block_p, control_flow_insn_p, count_basic_blocks): Likewise. * cfgloop.c (flow_bb_inside_loop_p, glb_enum_p, get_loop_body_with_size, loop_exit_edge_p): Likewise. * cfgloop.h (flow_bb_inside_loop_p, num_loop_insns, average_num_loop_insns, loop_exit_edge_p, just_once_each_iteration_p, can_duplicate_loop_p): Likewise. * cfgloopanal.c (just_once_each_iteration_p, num_loop_insns, average_num_loop_insns, seq_cost): Likewise. * cfgloopmanip.c (rpe_enum_p, can_duplicate_loop_p): Likewise. * dominance.c (dominated_by_p): Likewise. * emit-rtl.c (validate_subreg): Likewise. * except.c (can_throw_internal, can_throw_external): Likewise. * except.h (can_throw_internal, can_throw_external): Likewise. * gcse.c (gcse_constant_p, oprs_unchanged_p, oprs_anticipatable_p, oprs_available_p, hash_expr, expr_equiv_p, oprs_not_set_p, compute_transp, load_killed_in_block_p, reg_killed_on_edge, simple_mem, store_ops_ok, load_kills_store, find_loads, store_killed_in_insn, store_killed_after, store_killed_before, gcse_mem_operand, implicit_set_cond_p, store_killed_in_pat): Likewise. * ifcvt.c (count_bb_insns, cheap_bb_rtx_cost_p, noce_operand_ok, noce_mem_write_may_trap_or_fault_p): Likewise. * pointer-set.c (pointer_set_contains, pointer_map_contains): Likewise. * pointer-set.h (pointer_set_contains, pointer_map_contains): Likewise. * predict.c (can_predict_insn_p, maybe_hot_bb_p, probably_cold_bb_p, probably_never_executed_bb_p, edge_probability_reliable_p, br_prob_note_reliable_p, can_predict_insn_p): Likewise. * regclass.c (reg_set_to_hard_reg_set): Likewise. * resource.c (return_insn_p): Likewise. * rtl.h (reg_set_between_p, reg_set_p, validate_subreg): Likewise. * rtlanal.c (reg_set_between_p, reg_set_p): Likewise. * tracer.c (count_insns, ignore_bb_p, better_p): Likewise. * tree-cfg.c (verify_gimple_unary_expr, verify_gimple_binary_expr, verify_gimple_modify_stmt): Likewise. * tree-chrec.c (is_not_constant_evolution, is_multivariate_chrec_rec, is_multivariate_chrec, chrec_contains_symbols, chrec_contains_undetermined, tree_contains_chrecs, evolution_function_is_affine_multivariate_p, evolution_function_is_univariate_p, avoid_arithmetics_in_type_p, eq_evolutions_p, scev_direction): Likewise. * tree-chrec.h (automatically_generated_chrec_p, tree_is_chrec, eq_evolutions_p, is_multivariate_chrec, chrec_contains_symbols, chrec_contains_symbols_defined_in_loop, chrec_contains_undetermined, tree_contains_chrecs, evolution_function_is_affine_multivariate_p, evolution_function_is_univariate_p, chrec_zerop, evolution_function_is_constant_p, evolution_function_is_affine_p, evolution_function_is_affine_or_constant_p, tree_does_not_contain_chrecs, chrec_type): Likewise. * tree-data-ref.c (tree_fold_divides_p, object_address_invariant_in_loop_p, dr_may_alias_p, ziv_subscript_p, siv_subscript_p, gcd_of_steps_may_divide_p, same_access_functions, constant_access_functions, access_functions_are_affine_or_constant_p, find_vertex_for_stmt): Likewise. * tree-flow.h (scev_direction): Likewise. * tree-gimple.c (is_gimple_stmt): Likewise. * tree-outof-ssa.c (identical_copies_p, identical_stmt_lists_p): Likewise. * tree-pretty-print.c (op_prio): Likewise. * tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop, analyzable_condition, backedge_phi_arg_p): Likewise. * tree-scalar-evolution.h (get_chrec_loop): Likewise. * tree-ssa-operands.c (get_name_decl, operand_build_cmp): Likewise. * tree-ssa-threadupdate.c (dbds_continue_enumeration_p): Likewise. From-SVN: r127404
2007-08-04tree-ssa-threadupdate.c (thread_through_all_blocks): Use loops' state ↵Zdenek Dvorak1-1/+1
accessor functions. * tree-ssa-threadupdate.c (thread_through_all_blocks): Use loops' state accessor functions. * cfgloopmanip.c (remove_path, create_preheaders, force_single_succ_latches, fix_loop_structure): Ditto. * tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa, tree_duplicate_loop_to_header_edge): Ditto. * cfgloopanal.c (mark_irreducible_loops): Ditto. * loop-init.c (loop_optimizer_init, loop_optimizer_finalize): Ditto. * tree-cfgcleanup.c (cleanup_tree_cfg_noloop, repair_loop_structures, cleanup_tree_cfg): Ditto. * tree-cfg.c (tree_merge_blocks): Ditto. * cfgloop.c (rescan_loop_exit, record_loop_exits, release_recorded_exits, get_loop_exit_edges, verify_loop_structure, loop_preheader_edge, single_exit): Ditto. (flow_loops_find): Do not clear loops->state. * cfgloop.h (loops_state_satisfies_p, loops_state_set, loops_state_clear): New functions. From-SVN: r127197
2007-08-01tree-pretty-print.c (dump_generic_node): Dump OMP_SECTIONS_SWITCH.Zdenek Dvorak1-8/+30
* tree-pretty-print.c (dump_generic_node): Dump OMP_SECTIONS_SWITCH. Display new operands of OMP_SECTIONS and OMP_CONTINUE. * tree.h (OMP_SECTIONS_CONTROL): New macro. (OMP_DIRECTIVE_P): Add OMP_SECTIONS_SWITCH. * omp-low.c (get_ws_args_for, determine_parallel_type, expand_omp_for_generic, expand_omp_for_static_nochunk, expand_omp_for_static_chunk, expand_omp_for, expand_omp_sections): Work with more precise CFG. (build_omp_regions_1): Handle OMP_SECTIONS_SWITCH. (lower_omp_sections): Emit OMP_SECTIONS_SWITCH. Add arguments to OMP_CONTINUE. * tree-gimple.c (is_gimple_stmt): Handle OMP_SECTIONS_SWITCH. * gimple-low.c (lower_stmt): Ditto. * tree-inline.c (estimate_num_insns_1): Ditto. * tree.def (OMP_SECTIONS, OMP_CONTINUE): Added new operands. (OMP_SECTIONS_SWITCH): New. * tree-cfgcleanup.c (cleanup_omp_return): New. (cleanup_tree_cfg_bb): Call cleanup_omp_return. * tree-cfg.c (make_edges): Create back edges for OMP_CONTINUE and exit edge for OMP_FOR. Handle OMP_SECTIONS_SWITCH. (tree_redirect_edge_and_branch): Handle omp constructs. * fortran/trans-openmp.c (gfc_trans_omp_sections): Build OMP_SECTIONS with three arguments. From-SVN: r127121
2007-08-01tree-cfg.c (tree_merge_blocks): Preserve loop exit phi nodes only in loop ↵Zdenek Dvorak1-2/+3
closed ssa. * tree-cfg.c (tree_merge_blocks): Preserve loop exit phi nodes only in loop closed ssa. From-SVN: r127119
2007-07-28calls.c (special_function_p, [...]): Constify.Kaveh R. Ghazi1-7/+7
* calls.c (special_function_p, setjmp_call_p, alloca_call_p, flags_from_decl_or_type): Constify. * gcc.c (do_spec_1): Likewise. * print-tree.c (dump_addr, print_node_brief): Likewise. * tree-cfg.c (stmt_starts_bb_p, is_ctrl_stmt, computed_goto_p, simple_goto_p, tree_can_make_abnormal_goto, stmt_starts_bb_p, tree_purge_all_dead_eh_edges): Likewise. * tree-flow.h (is_ctrl_stmt, computed_goto_p, simple_goto_p, tree_can_make_abnormal_goto, tree_purge_all_dead_eh_edges): Likewise. * tree.c (expr_location, expr_has_location, expr_locus, expr_filename, expr_lineno, get_inner_array_type, fields_compatible_p): Likewise. * tree.h (get_inner_array_type, fields_compatible_p, expr_location, expr_has_location, expr_locus, expr_filename, expr_lineno, dump_addr, print_node_brief, flags_from_decl_or_type, setjmp_call_p, alloca_call_p): Likewise. From-SVN: r127017
2007-07-26configure.ac: Add types checking to stage1 checking flags.Richard Guenther1-0/+704
2007-07-26 Richard Guenther <rguenther@suse.de> toplev/ * configure.ac: Add types checking to stage1 checking flags. * configure: Regenerate. gcc/ * tree-cfg.c (verify_gimple_unary_expr, verify_gimple_binary_expr, verify_gimple_min_lval, verify_gimple_reference, verify_gimple_expr, verify_gimple_modify_stmt, verify_gimple_stmt, verify_gimple_1, verify_gimple): New functions. * tree-flow.h (verify_gimple): Declare. (verify_gimple_1): Declare. * gimplify.c (cpt_same_type): Remove. (gimplify_addr_expr): Remove checking code. (check_pointer_types_r): Remove. (gimplify_body): Call verify_gimple_1 instead of check_pointer_types_r. Only verify if there were no errors. * configure.ac: Add types checking flag. * configure: Regenerate. * config.in: Regenerate. From-SVN: r126951
2007-07-26Change copyright header to refer to version 3 of the GNU General Public ↵Nick Clifton1-4/+3
License and to point readers at the COPYING3 file and the FSF's license web page. From-SVN: r126948
2007-07-20tree-cfg.c (verify_expr): COND_EXPRs can have any integral typed condition.Richard Guenther1-2/+2
2007-07-20 Richard Guenther <rguenther@suse.de> * tree-cfg.c (verify_expr): COND_EXPRs can have any integral typed condition. * tree-ssa.c (useless_type_conversion_p): Do not preserve booleanness. Only preserve conversions from a non-base type to a base type, not in general between types with different TYPE_MIN_VALUE or TYPE_MAX_VALUE. * tree.def (COND_EXPR): Document that the condition can be of any integral type. From-SVN: r126804
2007-07-02tree-flow.h (tree_ssa_useless_type_conversion_1): Rename to ...Richard Guenther1-2/+2
2007-07-02 Richard Guenther <rguenther@suse.de> * tree-flow.h (tree_ssa_useless_type_conversion_1): Rename to ... (useless_type_conversion_p): ... this. * tree-ssa.c (tree_ssa_useless_type_conversion_1): Rename to ... (useless_type_conversion_p): ... this. * builtins.c (fold_builtin_memory_op): Rename tree_ssa_useless_type_conversion_1 to useless_type_conversion_p. * tree-cfg.c (verify_expr): Likewise. * tree-ssa-address.c (tree_ssa_useless_type_conversion_1): Likewise. * tree-ssa-ccp.c (ccp_fold): Likewise. * tree-ssa-copy.c (may_propagate_copy): Likewise. * tree-ssa-dom.c (eliminate_redundant_computations): Likewise. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Likewise. * tree-ssa-loop-niter.c (refine_bounds_using_guard): Likewise. * tree-ssa-pre.c (eliminate): Likewise. * tree-ssa.c (delete_tree_ssa): Likewise. (tree_ssa_useless_type_conversion): Likewise. * tree.c (build2_stat): Likewise. From-SVN: r126194
2007-06-15[multiple changes]Andrew Pinski1-2/+29
2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> Zdenek Dvorak <dvorakz@suse.cz> Richard Guenther <rguenther@suse.de> Kaz Kojima <kkojima@gcc.gnu.org> * tree-vrp.c (compare_values_warnv): Convert val2 to the type of val1. (extract_range_from_assert): Create POINTER_PLUS_EXPR for pointer types. (extract_range_from_binary_expr): Handle only POINTER_PLUS_EXPR, MIN_EXPR, and MAX_EXPR for pointer types. * doc/c-tree.texi (POINTER_PLUS_EXPR): Document. * tree-ssa-loop-niter.c (split_to_var_and_offset): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (number_of_iterations_lt_to_ne): For pointer types, use sizetype when creating MINUS_EXPR/PLUS_EXPRs. (assert_loop_rolls_lt): For pointer types, use sizetype when creating MINUS_EXPR/PLUS_EXPRs. (number_of_iterations_le): Likewise. (expand_simple_operations): POINTER_PLUS_EXPR are simple also. (derive_constant_upper_bound): Handle POINTER_PLUS_EXPR just like PLUS_EXPR and MINUS_EXPR. * tree-pretty-print.c (dump_generic_node): Handle POINTER_PLUS_EXPR. (op_prio): Likewise. (op_symbol_1): Likewise. * optabs.c (optab_for_tree_code): Likewise. * tree-ssa-loop-manip.c (create_iv): Handle pointer base specially. * tree-tailcall.c (process_assignment): Mention POINTER_PLUS_EXPR in a TODO comment. * tree.c (build2_stat): Assert when trying to use PLUS_EXPR or MINUS_EXPR with a pointer. Also assert for POINTER_PLUS_EXPR not used with a pointer and an integer type. * tree-scalar-evolution.c (add_to_evolution_1): Convert the increment using chrec_convert_rhs instead of chrec_convert. (follow_ssa_edge_in_rhs): Handle POINTER_PLUS_EXPR like PLUS_EXPR except for the right hand side's type will be sizetype. (interpret_rhs_modify_stmt): Handle POINTER_PLUS_EXPR. (fold_used_pointer_cast): Kill. (pointer_offset_p): Kill. (fold_used_pointer): Kill. (pointer_used_p): Kill. (analyze_scalar_evolution_1 <case GIMPLE_MODIFY_STMT>): Don't call fold_used_pointer. (instantiate_parameters_1): Convert the increment using chrec_convert_rhs instead of chrec_convert. Handle POINTER_PLUS_EXPR as PLUS_EXPR. * builtins.c (get_pointer_alignment): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (expand_builtin_strcat): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (std_gimplify_va_arg_expr): Likewise. (fold_builtin_memory_op): Likewise. (fold_builtin_strstr): Likewise. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (expand_builtin_memory_chk): Likewise. (fold_builtin_memory_chk): Likewise. (std_expand_builtin_va_start): Use sizetype for the call to make_tree and then convert to the pointer type. (fold_builtin_memchr): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for adding to a pointer. (std_gimplify_va_arg_expr): Use fold_build2 for the creating of POINTER_PLUS_EXPR. For the BIT_AND_EXPR, cast the operands to sizetype first and then cast the BIT_AND_EXPR back to the pointer type. * fold-const.c (build_range_check): Handle pointer types specially. (extract_array_ref): Look for POINTER_PLUS_EXPR instead of PLUS_EXPR's. Make sure the offset is converted to sizetype. (try_move_mult_to_index): Strip the NOPs from the offset. Remove code argument and replace all uses with PLUS_EXPR. (fold_to_nonsharp_ineq_using_bound): Handle pointer types specially. Don't use a pointer type for MINUS_EXPR. (fold_unary): Handle for (T1)(X op Y), only p+ as that is the only as that can be handled for binary operators now. (fold_binary <case POINTER_PLUS_EXPR>): Add folding of POINTER_PLUS_EXPR. <case PLUS_EXPR>: Add folding of PTR+INT into PTR p+ INT. Don't call try_move_mult_to_index. <case MINUS_EXPR>: Fold (PTR0 p+ A) - (PTR1 p+ B) into (PTR0 - PTR1) + (A - B). Fold (PTR0 p+ A) - PTR1 into (PTR0 - PTR1) + A iff (PTR0 - PTR1) simplifies. Don't call try_move_mult_to_index. (tree_expr_nonnegative_warnv_p): Handle POINTER_PLUS_EXPR. (tree_expr_nonzero_p): Likewise. (fold_indirect_ref_1): Look at POINTER_PLUS_EXPR instead of PLUS_EXPR for the complex expression folding. * tree-chrec.c (chrec_fold_plus_poly_poly): If the first chrec is a pointer type, then the second should be sizetype and not the first's type. For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_fold_plus_1): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_fold_plus): For pointer types, use POINTER_PLUS_EXPR instead of PLUS_EXPR. When either operand is zero, convert the other operand. (chrec_apply): Use chrec_convert_rhs on the argument x instead of chrec_convert. (reset_evolution_in_loop): For pointer types, the new_evol should be sizetype. (convert_affine_scev): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_convert_rhs): New function. (chrec_convert_aggressive): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. * tree-chrec.h (chrec_convert_rhs): New prototype. (build_polynomial_chrec): For pointer types, the right hand * tree-ssa-ccp.c (maybe_fold_stmt_indirect): Look for POINTER_PLUS_EXPR instead of PLUS_EXPR's. Remove subtraction case as it is always addition now. Make sure the offset is converted to sizetype. (fold_stmt_r): Don't handle PLUS_EXPR/MINUS_EXPR specially. Handle POINTER_PLUS_EXPR like PLUS_EXPR was handled before. * tree-ssa-loop-ivopts.c (determine_base_object): Abort for PLUS_EXPR in pointer type. Handle POINTER_PLUS_EXPR. (tree_to_aff_combination): Likewise. (force_expr_to_var_cost): Likewise. (force_expr_to_var_cost): Likewise. Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * c-format.c (check_format_arg): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR of pointer types. * tree-stdarg.c (va_list_counter_bump): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (check_va_list_escapes): Likewise. (check_all_va_list_escapes): Likewise. * dwarf2out.c (loc_descriptor_from_tree_1): Handle POINT_PLUS_EXPR as a PLUS_EXPR. * expr.c (expand_expr_real_1): Handle POINTER_PLUS_EXPR. (string_constant): Likewise. * tree-ssa-address.c (tree_mem_ref_addr): When adding the offset to the base, use POINTER_PLUS_EXPR. (add_to_parts): Convert the index to sizetype. (create_mem_ref): Create A POINTER_PLUS_EXPR for the one case. * matrix-reorg.c (collect_data_for_malloc_call): Stmt will now only be either INDIRECT_REF and POINTER_PLUS_EXPR. Offset only holds something for PLUS_EXPR. (ssa_accessed_in_tree): Handle POINTER_PLUS_EXPR just as a PLUS_EXPR. (analyze_transpose): POINTER_PLUS_EXPR will only show up now and not PLUS_EXPR. (analyze_accesses_for_modify_stmt): Likewise. Remove comment about the type being integral type as it is wrong now. (can_calculate_expr_before_stmt): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (transform_access_sites): POINTER_PLUS_EXPR will only show up now and not PLUS_EXPR. Correct the type which the artimentic is done in (is now sizetype). Reindent one loop. * tree-data-ref.c (split_constant_offset): Handle POINTER_PLUS_EXPR * tree-affine.c (tree_to_aff_combination): Likewise. * c-typeck.c (build_unary_op): For pointers create the increment as a sizetype. Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * gimplify.c (gimplify_self_mod_expr): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (gimplify_omp_atomic_fetch_op): Handle POINTER_PLUS_EXPR. * tree.def (POINTER_PLUS_EXPR): New tree code. * tree-predcom.c (ref_at_iteration): If we have a pointer type do the multiplication in sizetype. * tree-mudflap.c (mf_xform_derefs_1): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-ssa-forwprop.c (forward_propagate_addr_into_variable_array_index): Don't expect there to be a cast for the index as that does not exist anymore. (forward_propagate_addr_expr_1): Check for POINTER_PLUS_EXPR instead of PLUS_EXPR. Don't check for the first operand of the POINTER_PLUS_EXPR was the index as it cannot be. Call forward_propagate_addr_into_variable_array_index with the SSA_NAME instead of the statement. * varasm.c (const_hash_1): Handle POINTER_PLUS_EXPR. (compare_constant): Likewise. (copy_constant): Likewise. (compute_reloc_for_constant): Likewise. (output_addressed_constants): Likewise. (initializer_constant_valid_p): Likewise. * tree-ssa.c (tree_ssa_useless_type_conversion_1): Convert the MIN/MAX of the inner type to the outer type before comparing them. * tree-ssa-loop-prefetch.c (idx_analyze_ref): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (issue_prefetch_ref): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-inline.c (estimate_num_insns_1): Handle POINTER_PLUS_EXPR. * tree-vect-transform.c (vect_create_addr_base_for_vector_ref): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (bump_vector_ptr): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for the pointer increment statement. (vect_update_ivs_after_vectorizer): For pointer types, create POINTER_PLUS_EXPR instead of PLUS_EXPR and also create MULT_EXPR in sizetype. (vect_gen_niters_for_prolog_loop): Add a cast when creating byte_misalign. * tree-object-size.c (plus_expr_object_size): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. Removing all the extra code which is trying to figure out which side is a pointer and is the index. (check_for_plus_in_loops_1): Likewise. (check_for_plus_in_loops): Likewise. * c-common.c (pointer_int_sum): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-ssa-structalias.c (handle_ptr_arith): Handle only POINTER_PLUS_EXPR. Removing all the extra code which is trying to figure out which side is a pointer and is the index. * tree-cfg.c (verify_expr): Add extra checking for pointers and PLUS_EXPR and MINUS_EXPR. Also add checking to make sure the operands of POINTER_PLUS_EXPR are correct. * config/frv/frv.c (frv_expand_builtin_va_start): Use sizetype with make_tree, instead of a pointer type. * config/s390/s390.c (s390_va_start): Use POINTER_PLUS_EXPR for pointers instead of PLUS_EXPR. (s390_gimplify_va_arg): Likewise. * config/spu/spu.c (spu_va_start): Create POINTER_PLUS_EXPR instead of PLUS_EXPR when doing addition on pointer types. Use sizetype for the second operand. (spu_gimplify_va_arg_expr): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Use POINTER_PLUS_EXPR instead of PLUS_EXPR when the operand was a pointer. Don't create a BIT_AND_EXPR for pointer types. * config/i386/i386.c (ix86_va_start): Use POINTER_PLUS_EXPR for the pointer addition and also use size_int/sizetype for the offset. (ix86_gimplify_va_arg): Likewise. Perform BIT_AND_EXPR on sizetype arguments. * config/sh/sh.c (sh_va_start): Call make_tree with sizetype and convert its result to a pointer type. Use POINTER_PLUS_EXPR for the pointer additions and also use size_int for the offsets. (sh_gimplify_va_arg_expr): Use POINTER_PLUS_EXPR for the pointer additions and also use size_int for the offsets. Perform BIT_AND_EXPR on sizetype arguments. * config/ia64/ia64.c (ia64_gimplify_va_arg): Use POINTER_PLUS_EXPR for pointers and create the BIT_AND_EXPR in sizetype. * config/rs6000/rs6000.c (rs6000_va_start): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for pointer addition. (rs6000_va_start): Likewise. Also use sizetype for the offset. * config/pa/pa.c (reloc_needed): Handle POINTER_PLUS_EXPR as PLUS_EXPR/MINUS_EXPR. (hppa_gimplify_va_arg_expr): Don't create MINUS_EXPR or PLUS_EXPR for pointers, instead use POINTER_PLUS_EXPR. Don't use BIT_AND_EXPR on a pointer type, convert the expression to sizetype first. * config/mips/mips.c (mips_va_start): Use POINTER_PLUS_EXPR for pointers. (mips_gimplify_va_arg_expr): Likewise. Don't create BIT_AND_EXPR in a pointer type. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * trans-intrinsic.c (gfc_conv_intrinsic_repeat): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for pointer addition. * trans-expr.c (gfc_trans_string_copy): Create POINTER_PLUS_EXPR instead of a PLUS_EXPR for pointer types. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * typeck.c (build_binary_op): For templates build the expression in pieces to avoid the assert in build2_stat. (get_member_function_from_ptrfunc): Change over to using POINTER_PLUS_EXPR and convert the second operand to sizetype. * typeck2.c (build_m_component_ref): Likewise. * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (build_new_1): Likewise. (build_vec_delete_1): Likewise. (build_vec_delete): Likewise. * class.c (build_base_path): Likewise. (build_base_path): Likewise. (convert_to_base_statically): Likewise. (fixed_type_or_null): Handle POINTER_PLUS_EXPR. (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * call.c (build_special_member_call): Likewise. * rtti.c (build_headof): Likewise. Use sizetype instead of ptrdiff_type_node. (tinfo_base_init): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * except.c (expand_start_catch_block): Do a NEGATIVE and then a POINTER_PLUS_EXPR instead of a MINUS_EXPR. * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert PLUS_EXPR on pointer types over to use POINTER_PLUS_EXPR and remove the conversion to the pointer types. * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for adding to a pointer type. Use size_int instead of ssize_int. Convert the index to sizetype before adding it to the pointer. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * trans.c (Attribute_to_gnu): When subtracting an offset from a pointer, use POINTER_PLUS_EXPR with NEGATE_EXPR instead of MINUS_EXPR. (gnat_to_gnu): Likewise. * utils.c (convert): When converting between thin pointers, use POINTER_PLUS_EXPR and sizetype for the offset. * utils2.c (known_alignment): POINTER_PLUS_EXPR have the same semantics as PLUS_EXPR for alignment. (build_binary_op): Add support for the semantics of POINTER_PLUS_EXPR's operands. When adding an offset to a pointer, use POINTER_PLUS_EXPR. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * class.c (make_class_data): Build the index in sizetype. Use POINTER_PLUS_EXPR instead of PLUS_EXPR when adding to a pointer type. (build_symbol_entry): Likewise. * expr.c (build_java_arrayaccess): Likewise. (build_field_ref): Likewise. (build_known_method_ref): Likewise. (build_invokevirtual): Likewise. * except.c (build_exception_object_ref): Do a NEGATIVE and then a POINTER_PLUS_EXPR instead of a MINUS_EXPR. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> PR tree-opt/32225 * gcc.c-torture/compile/20070605-1.c: New test. * gcc.c-torture/compile/20070603-1.c: New testcase. * gcc.c-torture/compile/20070603-2.c: New testcase. * gcc.c-torture/compile/20070531-1.c: New test. PR tree-opt/32167 * gcc.c-torture/compile/20070531-2.c: New test. PR tree-opt/32144 * gcc.c-torture/compile/20070529-1.c: New test. PR tree-opt/32145 * gcc.c-torture/compile/20070529-2.c: New test. PR tree-opt/32015 * gcc.c-torture/compile/20070520-1.c: New test. * g++.dg/ext/java-1.C: New test. * gcc.dg/vect/vect-106.c: We are now able to vectorize two loops instead of one. Remove the "can't determine dependence" check. * gcc.dg/tree-ssa/20030815-1.c: Remove testcase which is no longer needed as the cast is gone in the first place. * gcc.dg/max-1.c: Change local variable a to be a global one. * gcc.dg/tree-ssa/ssa-pre-8.c: Update testcase since we don't have a cast which is PREd. From-SVN: r125755
2007-06-03cfgloopmanip.c (remove_path, [...]): Change dom_bbs to vector.Zdenek Dvorak1-9/+7
* cfgloopmanip.c (remove_path, loopify, duplicate_loop_to_header_edge): Change dom_bbs to vector. Add argument to iterate_fix_dominators call. * loop-unroll.c (unroll_loop_runtime_iterations): Ditto. * tree-cfg.c (tree_duplicate_sese_region): Change doms to vector. Add argument to iterate_fix_dominators call. (remove_edge_and_dominated_blocks): Pass vector to bbs_to_fix_dom. * gcse.c (hoist_code): Change domby to vector. * cfghooks.c (make_forwarder_block): Change doms_to_fix to vector. Add argument to iterate_fix_dominators call. * loop-doloop.c (doloop_modify): Changed recount_dominator to recompute_dominator. * lambda-code.c (perfect_nestify): Ditto. * cfgloopanal.c: Include graphds.h. (struct edge, struct vertex, struct graph, dump_graph, new_graph, add_edge, dfs, for_each_edge, free_graph): Moved to graphds.c. (mark_irreducible_loops): Use graphds_scc. Remove argument from add_edge call. * graphds.c: New file. * graphds.h: New file. * dominance.c: Include vecprim.h, pointer-set.h and graphds.h. (get_dominated_by, get_dominated_by_region): Change return type to vector. (verify_dominators): Recompute all dominators and compare the results. (recount_dominator): Renamed to ... (recompute_dominator): ... this. Do not check that the block is dominated by entry. (iterate_fix_dominators): Reimplemented. (prune_bbs_to_update_dominators, root_of_dom_tree, determine_dominators_for_sons): New functions. * et-forest.c (et_root): New function. * et-forest.h (et_root): Declare. * Makefile.in (graphds.o): Add. (cfgloopanal.o): Add graphds.h dependency. (dominance.o): Add graphds.h, vecprim.h and pointer-set.h dependency. * basic-block.h (get_dominated_by, get_dominated_by_region, iterate_fix_dominators): Declaration changed. (recount_dominator): Renamed to ... (recompute_dominator): ... this. * tree-ssa-threadupdate.c (thread_block): Free dominance info. (thread_through_all_blocks): Do not free dominance info. From-SVN: r125297