From 165b54c3f3249b748d8e7ac186d9ad93dab86d86 Mon Sep 17 00:00:00 2001 From: Steven Bosscher Date: Sat, 17 Jul 2004 00:31:15 +0000 Subject: cfgcleanup.c (try_simplify_condjump): Don't remove line notes to avoid unreachable code warnings. * cfgcleanup.c (try_simplify_condjump): Don't remove line notes to avoid unreachable code warnings. * toplev.c (backend_init): Don't emit line notes for unreachable code warnings. * combine.c (distribute_notes): Don't distribute a REG_VTABLE_REF note. * final.c (final_scan_insn): Don't handle it. * rtl.c (reg_note_name): Remove it. * rtl.h (enum reg_node): Dito. * emit-rtl.c (force_line_numbers, restore_line_number_status): Remove. * rtl.h (force_line_numbers, restore_line_number_status): Remove prototypes. * stmt.c (using_eh_for_cleanups_p, using_eh_for_cleanups): Move... * tree-eh.c (using_eh_for_cleanups_p): ...here. Make static. (using_eh_for_cleanups): Also moved here. * expr.c (expand_expr_real_1) : Die if we see one. : Die if we have a non-NULL SWITCH_BODY. Update calls to expand_start_case and add_case_node. * stmt.c (struct nesting): Cleanup unused fields condition_code, last_unconditional_cleanup, nominal_type, printname, and line_number_status. (struct fixup_goto): Remove. (struct stmt_status): Remove x_goto_fixup_chain field. (goto_fixup_chain): Remove. (strip_default_case_nodes, group_case_nodes, emit_jump_if_reachable, pushcase, pushcase_range): Remove. (expand_start_bindings_and_block): Don't set unused fields in the nesting stack. (expand_start_case, add_case_node): Cleanup unused formal arguments. (expand_end_case_type): Don't simplify the case-list. Use emit_jump instead of emit_jump_if_reachable. (emit_case_nodes): Likewise. * tree-cfg.c (group_case_labels, cleanup_dead_labels): No longer static. (update_eh_label): Work around left-over exception handing regions. * tree-flow.h (group_case_labels, cleanup_dead_labels): Add protos. * tree-optimize.c (execute_cleanup_cfg_post_optimizing): New function. (pass_cleanup_cfg_post_optimizing): New pass. (init_tree_optimization_passes): Run the new pass after all optimizations. * tree.h (pushcase, pushcase_range): Remove prototypes. (expand_start_case, add_case_node): Update prototypes. cp/ * cp-tree.h (struct lang_type): Don't have three GTY options on a single bit GTY desc. java/ * parse.y (java_complete_expand_methods, java_expand_classes): Don't abuse restore_line_number_status. From-SVN: r84849 --- gcc/tree-cfg.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'gcc/tree-cfg.c') diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index f3df4e2..ac2d5da 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -99,8 +99,6 @@ static void tree_cfg2vcg (FILE *); static void tree_merge_blocks (basic_block, basic_block); static bool tree_can_merge_blocks_p (basic_block, basic_block); static void remove_bb (basic_block); -static void group_case_labels (void); -static void cleanup_dead_labels (void); static bool cleanup_control_flow (void); static bool cleanup_control_expr_graph (basic_block, block_stmt_iterator); static edge find_taken_edge_cond_expr (basic_block, tree); @@ -769,7 +767,16 @@ update_eh_label (struct eh_region *region) tree old_label = get_eh_region_tree_label (region); if (old_label) { - tree new_label = label_for_bb[label_to_block (old_label)->index]; + tree new_label; + basic_block bb = label_to_block (old_label); + + /* ??? After optimizing, there may be EH regions with labels + that have already been removed from the function body, so + there is no basic block for them. */ + if (! bb) + return; + + new_label = label_for_bb[bb->index]; set_eh_region_tree_label (region, new_label); } } @@ -791,7 +798,7 @@ main_block_label (tree label) 2) Redirect all references to labels to the leading labels. 3) Cleanup all useless labels. */ -static void +void cleanup_dead_labels (void) { basic_block bb; @@ -924,7 +931,7 @@ cleanup_dead_labels (void) same label. Eg. three separate entries 1: 2: 3: become one entry 1..3: */ -static void +void group_case_labels (void) { basic_block bb; -- cgit v1.1