aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
AgeCommit message (Collapse)AuthorFilesLines
2005-02-02re PR tree-optimization/19578 (function pointer propagation fails for ↵Richard Sandiford1-5/+19
noreturn functions (part 2)) PR tree-optimization/19578 * tree-flow.h (modified_noreturn_calls): Declare. (noreturn_call_p): Declare. * tree-flow-inline.h (noreturn_call_p): New function. (modify_stmt): Add modified noreturn calls to modified_noreturn_calls. * tree-cfg.c (modified_noreturn_calls): New variable. (cleanup_control_flow): Use noreturn_call_p. Split basic blocks that contain a mid-block noreturn call. * tree-ssa.c (delete_tree_ssa): Clear modified_noreturn_calls. From-SVN: r94610
2005-02-01re PR tree-optimization/19217 (ICE: verify_stmts failed: address taken, but ↵Steven Bosscher1-2/+14
ADDRESSABLE bit not set) PR tree-optimization/19217 * tree-cfg.c (verify_expr): Use the data field to see if TP was seen inside a PHI node. Do not do the ADDR_EXPR check if it was. (verify_stmts): Pass (void*)1 as data to verify_expr to signal that it is walking a PHI node. From-SVN: r94570
2005-01-22re PR tree-optimization/19484 (function pointer propagation fails for ↵Richard Sandiford1-1/+29
noreturn functions) PR tree-optimization/19484 * tree-cfg.c (remove_fallthru_edge): New function. (cleanup_control_flow): Remove fallthru edges from calls that are now known not to return. From-SVN: r94070
2005-01-22tree-cfg.c (remove_forwarder_block_with_phi): Look at the first label to see ↵Kazu Hirata1-11/+6
if it is a nonlocal label. * tree-cfg.c (remove_forwarder_block_with_phi): Look at the first label to see if it is a nonlocal label. From-SVN: r94067
2005-01-21re PR tree-optimization/13000 ([unit-at-a-time] Using -O2 cannot detect ↵Ian Lance Taylor1-0/+2
missing return statement in a function) PR tree-optimization/13000 * tree-inline.c: Include "tree-flow.h". (expand_call_inline): If warn_return_type, warn if non-void inline function falls through. * tree-cfg.c (execute_warn_function_return): Don't warn about control reaching end if TREE_NO_WARNING is set. Set TREE_NO_WARNING. * gimple-low.c (block_may_fallthru): Don't assume that SWITCH_EXPR has been lowered. * gimplify.c (shortcut_cond_expr): Don't emit a jump over the else branch if we don't need one. * c-typeck.c: Include "tree-flow.h" (c_finish_bc_stmt): Don't add a goto if the current statement list doesn't fall through to the current point. From-SVN: r94024
2005-01-21* tree-cfg.c: Fix comment typos.Kazu Hirata1-4/+4
From-SVN: r94016
2005-01-20* tree-cfg.c (tree_verify_flow_info): Fix a typo.Kazu Hirata1-1/+1
From-SVN: r93995
2005-01-20tree-cfg.c (tree_verify_flow_info): Check that a nonlocal label is first in ↵Kazu Hirata1-5/+18
a sequence of labels. * tree-cfg.c (tree_verify_flow_info): Check that a nonlocal label is first in a sequence of labels. From-SVN: r93993
2005-01-20re PR tree-optimization/15349 ([tree-ssa] Merge two phi nodes.)Kazu Hirata1-8/+212
PR tree-optimization/15349 * timevar.def (TV_TREE_MERGE_PHI): New. * tree-cfg.c (tree_forwarder_block_p): Add a new argument PHI_WANTED. (remove_forwarder_block, cleanup_forwarder_blocks): Adjust the calls to tree_forwarder_block_p. (remove_forwarder_block_with_phi, merge_phi_nodes, gate_merge_phi, pass_merge_phi): New. * tree-optimize.c (init_tree_optimization_passes): Add pass_merge_phi. * tree-pass.h: Add an extern for pass_merge_phi; PR tree-optimization/15349 * testsuite/gcc.dg/tree-ssa/pr15349.c: New. From-SVN: r93977
2005-01-19tree-cfg.c (remove_forwarder_block): Fix the check to prevent a nonlocal ↵Kazu Hirata1-1/+1
label from appearing in the middle of a... * tree-cfg.c (remove_forwarder_block): Fix the check to prevent a nonlocal label from appearing in the middle of a basic block. From-SVN: r93917
2005-01-17tree-cfg.c (tree_forwarder_block_p): Speed up by walking through the ↵Kazu Hirata1-3/+3
statements backward. * tree-cfg.c (tree_forwarder_block_p): Speed up by walking through the statements backward. From-SVN: r93768
2005-01-17* tree-cfg.c (tree_can_merge_blocks_p): Reorder two checks.Kazu Hirata1-3/+3
From-SVN: r93767
2005-01-01re PR middle-end/17544 (incorrect -Wunreachable-code warning for mains with ↵Steven Bosscher1-5/+14
a return statement) * emit-rtl.c (add_insn_before): Fix comment typo. PR middle-end/17544 * c-decl.c (finish_function): If compiling C99, annotate the compiler generated return with the current file name and line 0. * tree-cfg.c (remove_useless_stmts_warn_notreached): Only warn if the source line is greater than 0. (remove_bb): Likewise. cp/ PR middle-end/17544 * decl.c (finish_function): Fix comment. Annotate the compiler generated return with the current file name and line 0. testsuite/ * gcc.dg/20041231-1.C: New test. * g++.dg/warn/Wunreachable-code-1.C: New test. From-SVN: r92784
2004-12-13tree-cfg.c (remove_useless_stmts_cond): Call fold on COND_EXPR_COND.Andrew Pinski1-1/+1
2004-12-13 Andrew Pinski <pinskia@physics.uc.edu> * tree-cfg.c (remove_useless_stmts_cond): Call fold on COND_EXPR_COND. From-SVN: r92093
2004-12-13defaults.h, [...]: Fix comment typos.Kazu Hirata1-4/+4
* defaults.h, stmt.c, tree-cfg.c, tree-ssa-dce.c: Fix comment typos. From-SVN: r92092
2004-12-10re PR middle-end/18903 (ice in bsi_after_labels)Andrew Pinski1-2/+2
2004-12-10 Andrew Pinski <pinskia@physics.uc.edu> PR middle-end/18903 * gcc.c-torture/compile/pr18903.c: New test. 2004-12-10 Andrew Pinski <pinskia@physics.uc.edu> PR middle-end/18903 * tree-cfg.c (remove_bb): Put the moved label at the beginning of the basic block. From-SVN: r92006
2004-12-06re PR tree-optimization/18601 (tree cfglceanup is slow)Zdenek Dvorak1-236/+139
PR tree-optimization/18601 * tree-cfg.c (thread_jumps, thread_jumps_from_bb): Removed. (tree_forwarder_block_p): Do not consider blocks that are its own successors forwarders. (cleanup_forwarder_blocks, remove_forwarder_block): New functions. (cleanup_tree_cfg): Use cleanup_forwarder_blocks instead of thread_jumps. * tree-flow.h (bb_ann_d): Remove forwardable. Co-Authored-By: Kazu Hirata <kazu@cs.umass.edu> From-SVN: r91787
2004-12-02* tree-cfg.c (thread_jumps): Reduce the size of WORKLIST.Kazu Hirata1-1/+1
From-SVN: r91648
2004-12-02tree-cfg.c (phi_alternatives_equal): Check that PHI_ARG_DEF is not null.Kazu Hirata1-4/+5
* tree-cfg.c (phi_alternatives_equal): Check that PHI_ARG_DEF is not null. From-SVN: r91647
2004-12-02tree-cfg.c (phi_alternatives_equal): Check that PHI_ARG_DEF is not null.Kazu Hirata1-9/+7
* tree-cfg.c (phi_alternatives_equal): Check that PHI_ARG_DEF is not null. From-SVN: r91646
2004-11-29expr.c (get_inner_reference): Handle REAL/IMAGPART_EXPR.Richard Henderson1-5/+2
* expr.c (get_inner_reference): Handle REAL/IMAGPART_EXPR. (handled_component_p): Likewise. * alias.c (can_address_p): Reformat and simplify. Handle REAL/IMAGPART_EXPR. Do not disable addressability based on alias set zero. * fold-const.c (build_fold_addr_expr_with_type): Remove duplicate check for REAL/IMAGPART_EXPR. * gimplify.c (gimplify_compound_lval): Likewise. * tree-cfg.c (verify_expr): Likewise. * tree-gimple.c (is_gimple_addressable, get_base_address): Likewise. * tree-nested.c (build_addr, convert_nonlocal_reference): Likewise. (convert_local_reference): Likewise. * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Likewise. From-SVN: r91511
2004-11-29* tree-cfg.c (tree_node_can_be_shared): Fix typo'd error_mark_node.Richard Henderson1-1/+1
From-SVN: r91490
2004-11-29re PR middle-end/18725 (another ICE on trivial invalid asm)Andrew Pinski1-1/+2
2004-11-29 Andrew Pinski <pinskia@physics.uc.edu> PR middle-end/18725 * gcc.dg/pr18725.c: New test. 2004-11-29 Andrew Pinski <pinskia@physics.uc.edu> PR middle-end/18725 * tree-cfg.c (tree_node_can_be_shared): Error_mark_node can be shared always. From-SVN: r91487
2004-11-29tree-cfg.c (tree_redirect_edge_and_branch): Call find_edge only when needed.Kazu Hirata1-1/+1
* tree-cfg.c (tree_redirect_edge_and_branch): Call find_edge only when needed. From-SVN: r91476
2004-11-27tree.c (operand_equal_for_phi_arg_p): New.Kazu Hirata1-1/+1
* tree.c (operand_equal_for_phi_arg_p): New. * tree.h: Add a prototype for operand_equal_for_phi_arg_p. * tree-cfg.c, tree-ssa-dom.c, tree-ssa-phiopt.c, tree-ssa.c: Replace operand_equal_p with operand_for_phi_arg_p appropriately. From-SVN: r91385
2004-11-27tree-cfg.c (cleanup_tree_cfg): Also return true if blocks are merged.Jeff Law1-1/+1
* tree-cfg.c (cleanup_tree_cfg): Also return true if blocks are merged. From-SVN: r91376
2004-11-26* tree-cfg.c (tree_split_edge): Speed up by using find_edge.Kazu Hirata1-7/+3
From-SVN: r91341
2004-11-25tree-phinodes.c (add_phi_arg): Take "tree" instead of "tree *" as the first ↵Kazu Hirata1-6/+6
argument. * tree-phinodes.c (add_phi_arg): Take "tree" instead of "tree *" as the first argument. * tree-flow.h: Update the prototype of add_phi_arg. * lambda-code.c, tree-cfg.c, tree-into-ssa.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-manip.c, tree-ssa-pre.c, tree-ssa-threadupdate.c, tree-ssa.c, tree-tailcall.c, tree-vectorizer.c: Update all call sites of add_phi_arg. From-SVN: r91307
2004-11-25tree-cfg.c (tree_verify_flow_info): Do not terminate error() message with \n.Gerald Pfeifer1-1/+1
* tree-cfg.c (tree_verify_flow_info): Do not terminate error() message with \n. From-SVN: r91291
2004-11-23tree-cfg.c (tree_forwarder_block_p): Speed up by reordering two checks.Kazu Hirata1-3/+3
* tree-cfg.c (tree_forwarder_block_p): Speed up by reordering two checks. From-SVN: r91108
2004-11-23function.h (struct function): Remove calls_longjmp.Zack Weinberg1-4/+3
* function.h (struct function): Remove calls_longjmp. (current_function_calls_longjmp): Delete. * tree.h (ECF_LONGJMP): Delete. (ECF_SIBCALL, ECF_PURE, ECF_SP_DEPRESSED, ECF_ALWAYS_RETURN) (ECF_LIBCALL_BLOCK): Everybody slide down one. (ECF_CONST, ECF_NORETURN, ECF_SIBCALL): Clarify comments. * builtins.c (expand_builtin_longjmp): Don't set current_function_calls_longjmp. * calls.c (special_function_p): Mark longjmp and siglongjmp with ECF_NORETURN, not ECF_LONGJMP. (emit_call_1, expand_call, emit_library_call_value_1): Don't check for ECF_LONGJMP. * tree-cfg.c (make_exit_edges, is_ctrl_altering_stmt) (need_fake_edge_p): Likewise. * config/avr/avr.h, config/ip2k/ip2k.h: Don't define NON_SAVING_SETJMP. * system.h: Poison NON_SAVING_SETJMP. * function.c (use_register_for_decl) * gcse.c (compute_hash_table_work, compute_store_table) * postreload-gcse.c (record_opr_changes) * reload.c (find_equiv_reg) * reload1.c (reload) * config/i386/i386.c (ix86_can_use_return_insn_p): Remove code conditional on NON_SAVING_SETJMP. * doc/tm.texi: Delete documentation of NON_SAVING_SETJMP. * config/i386/sysv3.h: Delete file. * config/i386/i386.c (ix86_svr3_asm_out_constructor): Delete. From-SVN: r91101
2004-11-23tree-cfg.c (tree_try_redirect_by_replacing_jump): Speed up by restricting to ↵Kazu Hirata1-8/+6
the case with two outgoing edges. * tree-cfg.c (tree_try_redirect_by_replacing_jump): Speed up by restricting to the case with two outgoing edges. From-SVN: r91098
2004-11-23tree-cfg.c (tree_execute_on_growing_pred): New.Kazu Hirata1-1/+13
* tree-cfg.c (tree_execute_on_growing_pred): New. (tree_cfg_hooks): Add tree_execute_on_growing_pred. * tree-flow.h: Add a prototype for reserve_phi_args_for_new_edge. * tree-phinodes.c (reserve_phi_args_for_new_edge): New. (add_phi_arg): Don't resize a PHI array. From-SVN: r91075
2004-11-22tree-ssa.c (ssa_remove_edge): Remove.Kazu Hirata1-3/+3
* tree-ssa.c (ssa_remove_edge): Remove. * tree-flow.h: Remove the corresponding prototype. * tree-cfg.c: Replace ssa_remove_edge with remove_edge. * basic-block.h: Likewise. * tree-if-conv.c: Likewise. * tree-ssa-threadupdate.c: Likewise. From-SVN: r91039
2004-11-22tree-cfg.c (tree_execute_on_shrinking_pred): New.Kazu Hirata1-1/+11
* tree-cfg.c (tree_execute_on_shrinking_pred): New. (tree_cfg_hooks): Use it. * tree-ssa.c (ssa_remove_edge): Don't call remove_phi_args. (ssa_redirect_edge): Don't call remove_phi_arg_num. From-SVN: r91036
2004-11-22cfg.c (unchecked_make_edge): Call execute_on_growing_pred after making an edge.Kazu Hirata1-1/+3
* cfg.c (unchecked_make_edge): Call execute_on_growing_pred after making an edge. (remove_edge): Call execute_on_shrinking_pred before removing an edge. (redirect_edge_succ): Call execute_on_growing_pred and execute_on_shrinking_pred. * cfghooks.c (execute_on_growing_pred): New. (execute_on_shrinking_pred): Likewise. * cfghooks.h (cfg_hooks): Add execute_on_growing_pred and execute_on_shrinking_pred. Add prototypes for execute_on_growing_pred and execute_on_shrinking_pred. * cfgrtl.c (rtl_cfg_hooks): Add NULL hooks to execute_on_growing_pred and execute_on_shrinking_pred. (cfg_layout_rtl_cfg_hook): Likewise. * tree-cfg.c (tree_cfg_hooks): Likewise. From-SVN: r91035
2004-11-22cfg.c (cached_make_edge): Use find_edge rather than an inlined variant.Jeff Law1-21/+12
* cfg.c (cached_make_edge): Use find_edge rather than an inlined variant. * cfgbuild.c (make_edges): Likewise. * cfghooks.c (can_duplicate_block_p): Likewise. * cfgloop.c (loop_latch_edge): Likewise. * cfgloopmanip.c (force_single_succ_latches): Likewise. * cfgrtl.c (rtl_flow_call_edges_add): Likewise. * predict.c (predict_loops, propagate_freq): Likewise. * tracer.c (tail_duplicate): Likewise. * tree-cfg.c (disband_implicit_edges): Likewise. (tree_forwarder_block_p, tree_flow_call_edges_add): Likewise. From-SVN: r91019
2004-11-19tree-cfg.c (reinstall_phi_args): New.Kazu Hirata1-17/+26
* tree-cfg.c (reinstall_phi_args): New. (tree_split_edge): Use it after redirecting an edge. Don't modify PHI_ARG_EDGE. From-SVN: r90940
2004-11-17tree-cfg.c (edge_to_cases): Renamed from edge_to_case_leader.Jeff Law1-100/+158
* tree-cfg.c (edge_to_cases): Renamed from edge_to_case_leader. (edge_to_cases_elt): Renamed from edge_to_case_leader. (edge_to_cases_hash): Renamed from edge_to_case_leader_hash. (edge_to_cases_eq): Renamed from edge_to_case_leader_eq. (edge_to_cases_cleanup, recording_case_labels_p): New functions. (get_cases_for_edge): New function. (start_recording_case_labels, end_recording_case_labels): Similarly. (record_switch_edge): Don't muck with the CASE_LABEL. Instead chain equivalent CASE_LABEL_EXPRs together. (get_case_leader_for_edge, get_case_leader_for_edge_hash): Kill. (make_switch_expr_edges): Do not record edge/cases here. (cleanup_tree_cfg): Record cases around the call to thread_jumps. (split_critical_edges): Record cases around the edge splitting code. (cleanup_dead_labels): Use CASE_LABEL again. (tree_redirect_edge_and_branch): If we have a mapping from edge to cases, use it to handle redirections. Else do it the slow way. * tree.h (CASE_LEADER_OR_LABEL): Kill. (CASE_LABEL): Revert to just looking at the tree's second operand. * tree.c (get_case_label): Kill. From-SVN: r90817
2004-11-16tree-cfg.c (bsi_commit_edge_inserts): Remove an argument.Kazu Hirata1-12/+3
* tree-cfg.c (bsi_commit_edge_inserts): Remove an argument. (tree_flow_call_edges_add): Update the call to bsi_commit_edge_inserts. * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise. * profile.c (branch_prob): Likewise. * tree-mudflap.c (mf_decl_cache_locals): Likewise. * tree-sra.c (scalarize_function): Likewise. * tree-ssa-loop-im.c (loop_commit_inserts): Likewise. * tree-ssa-pre.c (fini_pre): Likewise. * tree-flow.h: Update the prototype for bsi_commit_edge_inserts. From-SVN: r90704
2004-11-16tree-cfg.c (verify_expr): Replace TREE_OPERAND with COND_EXPR_COND.Kazu Hirata1-1/+1
* tree-cfg.c (verify_expr): Replace TREE_OPERAND with COND_EXPR_COND. * tree-if-conv.c (tree_if_convert_cond_expr): Likewise. * tree-ssa-dom.c (thread_across_edge): Likewise. * tree-vectorizer.c (vect_transform_loop_bound): Replace TREE_OPERAND with COND_EXPR_COND, COND_EXPR_THEN, or COND_EXPR_ELSE. From-SVN: r90703
2004-11-14tree-cfg.c, [...]: Replace TREE_CHAIN with PHI_CHAIN where appropriate.Kazu Hirata1-2/+2
* tree-cfg.c, tree-if-conv.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-manip.c, tree-vectorizer.c: Replace TREE_CHAIN with PHI_CHAIN where appropriate. From-SVN: r90611
2004-11-13bitmap.c, [...]: Fix comment formatting.Kazu Hirata1-3/+3
* bitmap.c, bitmap.h, expmed.c, tree-cfg.c: Fix comment formatting. From-SVN: r90595
2004-11-12tree-cfg.c (hashtab.h): Include.Jeff Law1-11/+182
* tree-cfg.c (hashtab.h): Include. (struct edge_to_case_leader_elt): New structure. (edge_to_case_leader): New. (edge_to_case_leader_hash): New hashtable hasing function. (edge_to_case_leader_eq): New hashtable equality function. (record_switch_edge): New function. (get_case_leader_for_edge, get_case_leader_for_edge): New functions. (make_switch_expr_edges): Build the edge-to-case-leader hash table. Tear down the hash table when we're done. (cleanup_dead_labels): Use CASE_LEADER_OR_LABEL instead of CASE_LABEL. (tree_node_can_be_shared): Allow sharing of CASE_LABEL_EXPR nodes. (tree_redirect_edge_and_branch, case SWITCH_EXPR): Update to use new concept of case leaders to reduce overhead of redirecting outgoing edges from switch statements. * tree.c (get_case_label): New function. * tree.h (CASE_LABEL): Define in terms of get_case_label. (CASE_LEADER_OR_LABEL): Define. From-SVN: r90570
2004-11-09* tree-cfg.c (create_bb): Remove unnecessary memset.Kazu Hirata1-2/+3
From-SVN: r90360
2004-11-09tree-phinodes.c (phi_reverse): New.Kazu Hirata1-10/+3
* tree-phinodes.c (phi_reverse): New. * tree-cfg.c (tree_make_forwarder_block, tree_duplicate_bb): Use it. * tree-flow.h: Add a prototype for phi_reverse. From-SVN: r90344
2004-11-08tree-cfg.c (thread_jumps): Speed up by keeping a pointer to the last used ↵Kazu Hirata1-8/+5
element in the worklist. * tree-cfg.c (thread_jumps): Speed up by keeping a pointer to the last used element in the worklist. From-SVN: r90314
2004-11-08tree-cfg.c, [...]: Replace TREE_CHAIN with PHI_CHAIN where appropriate.Kazu Hirata1-3/+3
* tree-cfg.c, tree-if-conv.c, tree-into-ssa.c, tree-scalar-evolution.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-manip.c, tree-ssa.c, tree-vectorizer.c: Replace TREE_CHAIN with PHI_CHAIN where appropriate. From-SVN: r90262
2004-11-06tree-cfg.c (find_taken_edge_cond_expr): Remove an "if" statement that never ↵Kazu Hirata1-5/+0
triggers. * tree-cfg.c (find_taken_edge_cond_expr): Remove an "if" statement that never triggers. From-SVN: r90176
2004-11-04tree-cfg.c (find_taken_edge): Reject VAL begin NULL.Kazu Hirata1-2/+3
* tree-cfg.c (find_taken_edge): Reject VAL begin NULL. * tree-ssa-ccp.c (visit_cond_stmt): Don't call find_taken_edge with VAL being NULL. From-SVN: r90083