From bf43101eb660ad64e5f63f8070b7ab4c814e52b6 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Tue, 14 Sep 1999 23:51:34 +0000 Subject: [PATCH] except.c (expand_eh_region_start_for_decl): Use NOTE_EH_HANDLER, not NOTE_BLOCK_NUMBER. * except.c (expand_eh_region_start_for_decl): Use NOTE_EH_HANDLER, not NOTE_BLOCK_NUMBER. (expand_eh_region_end): Likewise. (find_exception_handler_labels): Likewise. (scan_region): Likewise. (exception_optimize): Likewise. (update_rethrow_references): Likewise. (set_insn_eh_region): Likewise. * final.c (final_scan_insn): Likewise. * flow.c (make_edges): Likewise. * integrate.c (expand_inline_function): Likewise. * print-rtl.c (print_rtx): Likewise. From-SVN: r29418 --- gcc/ChangeLog | 15 +++++++++++++++ gcc/except.c | 30 +++++++++++++++--------------- gcc/final.c | 12 ++++++------ gcc/flow.c | 2 +- gcc/integrate.c | 6 +++--- gcc/print-rtl.c | 10 +++++++--- 6 files changed, 47 insertions(+), 28 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 12ee80a389f..6b1d3a0a99f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +Tue Sep 14 16:47:08 1999 Mark Mitchell + + * except.c (expand_eh_region_start_for_decl): Use NOTE_EH_HANDLER, + not NOTE_BLOCK_NUMBER. + (expand_eh_region_end): Likewise. + (find_exception_handler_labels): Likewise. + (scan_region): Likewise. + (exception_optimize): Likewise. + (update_rethrow_references): Likewise. + (set_insn_eh_region): Likewise. + * final.c (final_scan_insn): Likewise. + * flow.c (make_edges): Likewise. + * integrate.c (expand_inline_function): Likewise. + * print-rtl.c (print_rtx): Likewise. + Tue Sep 14 16:30:16 1999 Richard Henderson * ginclude/stdarg.h, ginclude/varargs.h: Implement in diff --git a/gcc/except.c b/gcc/except.c index d36fec673e7..9a190c7513d 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -1437,7 +1437,7 @@ expand_eh_region_start_for_decl (decl) push_eh_entry (&ehstack); note = emit_note (NULL_PTR, NOTE_INSN_EH_REGION_BEG); - NOTE_BLOCK_NUMBER (note) + NOTE_EH_HANDLER (note) = CODE_LABEL_NUMBER (ehstack.top->entry->exception_handler_label); if (exceptions_via_longjmp) start_dynamic_handler (); @@ -1476,7 +1476,7 @@ expand_eh_region_end (handler) entry = pop_eh_entry (&ehstack); note = emit_note (NULL_PTR, NOTE_INSN_EH_REGION_END); - ret = NOTE_BLOCK_NUMBER (note) + ret = NOTE_EH_HANDLER (note) = CODE_LABEL_NUMBER (entry->exception_handler_label); if (exceptions_via_longjmp == 0 && ! flag_new_exceptions /* We share outer_context between regions; only emit it once. */ @@ -1498,7 +1498,7 @@ expand_eh_region_end (handler) entry->finalization = handler; /* create region entry in final exception table */ - r = new_eh_region_entry (NOTE_BLOCK_NUMBER (note), entry->rethrow_label); + r = new_eh_region_entry (NOTE_EH_HANDLER (note), entry->rethrow_label); enqueue_eh_entry (&ehqueue, entry); @@ -2018,7 +2018,7 @@ static int eh_table_max_size = 0; Called from final_scan_insn when a NOTE_INSN_EH_REGION_BEG is seen. (Or NOTE_INSN_EH_REGION_END sometimes) - N is the NOTE_BLOCK_NUMBER of the note, which comes from the code + N is the NOTE_EH_HANDLER of the note, which comes from the code label number of the exception handler for the region. */ void @@ -2289,7 +2289,7 @@ find_exception_handler_labels () if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG) { - ptr = get_first_handler (NOTE_BLOCK_NUMBER (insn)); + ptr = get_first_handler (NOTE_EH_HANDLER (insn)); for ( ; ptr; ptr = ptr->next) { /* make sure label isn't in the list already */ @@ -2560,7 +2560,7 @@ scan_region (insn, n, delete_outer) if (insn == NULL_RTX || GET_CODE (insn) != NOTE || NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_BEG - || NOTE_BLOCK_NUMBER (insn) != n + || NOTE_EH_HANDLER (insn) != n || delete_outer == NULL) abort (); @@ -2580,14 +2580,14 @@ scan_region (insn, n, delete_outer) if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG) { - insn = scan_region (insn, NOTE_BLOCK_NUMBER (insn), &delete); + insn = scan_region (insn, NOTE_EH_HANDLER (insn), &delete); } insn = NEXT_INSN (insn); } /* The _BEG/_END NOTEs must match and nest. */ - if (NOTE_BLOCK_NUMBER (insn) != n) + if (NOTE_EH_HANDLER (insn) != n) abort (); /* If anything in this exception region can throw, we can throw. */ @@ -2665,7 +2665,7 @@ exception_optimize () inbetween. We are also guaranteed that the value of insn returned will be valid, as otherwise scan_region won't return. */ - insn = scan_region (insn, NOTE_BLOCK_NUMBER (insn), &n); + insn = scan_region (insn, NOTE_EH_HANDLER (insn), &n); } } } @@ -2706,7 +2706,7 @@ update_rethrow_references () { if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG) { - region = find_func_region (NOTE_BLOCK_NUMBER (insn)); + region = find_func_region (NOTE_EH_HANDLER (insn)); saw_region[region] = 1; } } @@ -2946,10 +2946,10 @@ set_insn_eh_region (first, region_num) for (insn = *first; insn; insn = NEXT_INSN (insn)) { - if ((GET_CODE (insn) == NOTE) && - (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)) + if ((GET_CODE (insn) == NOTE) + && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)) { - rnum = NOTE_BLOCK_NUMBER (insn); + rnum = NOTE_EH_HANDLER (insn); insn_eh_region[INSN_UID (insn)] = rnum; insn = NEXT_INSN (insn); set_insn_eh_region (&insn, rnum); @@ -3147,12 +3147,12 @@ init_eh_nesting_info () { if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG) { - int block = NOTE_BLOCK_NUMBER (insn); + int block = NOTE_EH_HANDLER (insn); region_count++; info->region_index[block] = region_count; if (eh_note) nested_eh_region [block] = - NOTE_BLOCK_NUMBER (XEXP (eh_note, 0)); + NOTE_EH_HANDLER (XEXP (eh_note, 0)); else nested_eh_region [block] = 0; eh_note = gen_rtx_EXPR_LIST (VOIDmode, insn, eh_note); diff --git a/gcc/final.c b/gcc/final.c index 7046344e36d..d3b3579d081 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -2099,11 +2099,11 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG && ! exceptions_via_longjmp) { - ASM_OUTPUT_INTERNAL_LABEL (file, "LEHB", NOTE_BLOCK_NUMBER (insn)); + ASM_OUTPUT_INTERNAL_LABEL (file, "LEHB", NOTE_EH_HANDLER (insn)); if (! flag_new_exceptions) - add_eh_table_entry (NOTE_BLOCK_NUMBER (insn)); + add_eh_table_entry (NOTE_EH_HANDLER (insn)); #ifdef ASM_OUTPUT_EH_REGION_BEG - ASM_OUTPUT_EH_REGION_BEG (file, NOTE_BLOCK_NUMBER (insn)); + ASM_OUTPUT_EH_REGION_BEG (file, NOTE_EH_HANDLER (insn)); #endif break; } @@ -2111,11 +2111,11 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END && ! exceptions_via_longjmp) { - ASM_OUTPUT_INTERNAL_LABEL (file, "LEHE", NOTE_BLOCK_NUMBER (insn)); + ASM_OUTPUT_INTERNAL_LABEL (file, "LEHE", NOTE_EH_HANDLER (insn)); if (flag_new_exceptions) - add_eh_table_entry (NOTE_BLOCK_NUMBER (insn)); + add_eh_table_entry (NOTE_EH_HANDLER (insn)); #ifdef ASM_OUTPUT_EH_REGION_END - ASM_OUTPUT_EH_REGION_END (file, NOTE_BLOCK_NUMBER (insn)); + ASM_OUTPUT_EH_REGION_END (file, NOTE_EH_HANDLER (insn)); #endif break; } diff --git a/gcc/flow.c b/gcc/flow.c index bd42a56bc5b..5bd8453ce49 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -990,7 +990,7 @@ make_edges (label_value_list, bb_eh_end) int num; if (eh_list) - eh_region = NOTE_BLOCK_NUMBER (XEXP (eh_list, 0)); + eh_region = NOTE_EH_HANDLER (XEXP (eh_list, 0)); num = reachable_handlers (eh_region, eh_nest_info, insn, &handler_list); diff --git a/gcc/integrate.c b/gcc/integrate.c index d5699565a86..0ffa2b3565b 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -1217,7 +1217,7 @@ expand_inline_function (fndecl, parms, target, ignore, type, || NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_END)) { rtx label - = get_label_from_map (map, NOTE_BLOCK_NUMBER (copy)); + = get_label_from_map (map, NOTE_EH_HANDLER (copy)); /* we have to duplicate the handlers for the original */ if (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_BEG) @@ -1225,14 +1225,14 @@ expand_inline_function (fndecl, parms, target, ignore, type, /* We need to duplicate the handlers for the EH region and we need to indicate where the label map is */ eif_eh_map = map; - duplicate_eh_handlers (NOTE_BLOCK_NUMBER (copy), + duplicate_eh_handlers (NOTE_EH_HANDLER (copy), CODE_LABEL_NUMBER (label), expand_inline_function_eh_labelmap); } /* We have to forward these both to match the new exception region. */ - NOTE_BLOCK_NUMBER (copy) = CODE_LABEL_NUMBER (label); + NOTE_EH_HANDLER (copy) = CODE_LABEL_NUMBER (label); } } else diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c index 59193f4c7eb..862999a8c75 100644 --- a/gcc/print-rtl.c +++ b/gcc/print-rtl.c @@ -162,9 +162,13 @@ print_rtx (in_rtx) if (i == 3 && GET_CODE (in_rtx) == NOTE) { if (NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_EH_REGION_BEG - || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_EH_REGION_END - || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_BLOCK_BEG - || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_BLOCK_END) + || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_EH_REGION_END) + { + fprintf (outfile, " %d", NOTE_EH_HANDLER (in_rtx)); + sawclose = 1; + } + else if (NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_BLOCK_BEG + || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_BLOCK_END) { fprintf (outfile, " %d", NOTE_BLOCK_NUMBER (in_rtx)); sawclose = 1; -- 2.30.2