summaryrefslogtreecommitdiff
path: root/gcc/integrate.c
diff options
context:
space:
mode:
authoramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>1998-12-08 14:04:03 +0000
committeramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>1998-12-08 14:04:03 +0000
commitd63ea2f2662df984f448bd99527dd0d97ccc0f75 (patch)
tree7f21607b0446aa635cee54fb52e2f750bc2be0d5 /gcc/integrate.c
parentf6afeec969d39729b5272eb9559c6f0d48fe71ac (diff)
downloadgcc-d63ea2f2662df984f448bd99527dd0d97ccc0f75.tar.gz
Tue Dec 8 15:32:56 EST 1998 Andrew MacLeod <amacleod@cygnus.com>
See ChangeLog.. These are the files that were changed: * eh-common.h (struct eh_context): Add table_index for rethrows. * rtl.h (enum reg_note): Add REG_EH_REGION and REG_EH_RETHROW reg notes. * rtl.c (reg_note_name): Add strings for new reg_note enums. * expr.h (rethrow_libfunc): New library decl. * optabs.c (rethrow_libfunc): Initialize. * except.h (struct eh_entry): Add new field 'rethrow_label'. * except.c (create_rethrow_ref): New function to create a single * flow.c (make_edges): Add different edges for rethrow calls, * integrate.c (save_for_inline_eh_labelmap): New callback routine to * libgcc2.c (find_exception_handler): Generalize to enable it to * cp/except.c * cp/exception.cc git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24194 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/integrate.c')
-rw-r--r--gcc/integrate.c67
1 files changed, 42 insertions, 25 deletions
diff --git a/gcc/integrate.c b/gcc/integrate.c
index 76ccf5f59b5..702e5fa4f51 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -265,6 +265,16 @@ static rtvec copy_asm_constraints_vector;
/* In save_for_inline, nonzero if past the parm-initialization insns. */
static int in_nonparm_insns;
+/* subroutines passed to duplicate_eh_handlers to map exception labels */
+
+static rtx
+save_for_inline_eh_labelmap (label)
+ rtx label;
+{
+ int index = CODE_LABEL_NUMBER (label);
+ return label_map[index];
+}
+
/* Subroutine for `save_for_inline{copying,nocopy}'. Performs initialization
needed to save FNDECL's insns and info for future inline expansion. */
@@ -667,19 +677,8 @@ save_for_inline_copying (fndecl)
/* we have to duplicate the handlers for the original */
if (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_BEG)
- {
- handler_info *ptr, *temp;
- int nr;
- nr = new_eh_region_entry (new_region);
- ptr = get_first_handler (NOTE_BLOCK_NUMBER (copy));
- for ( ; ptr; ptr = ptr->next)
- {
- temp = get_new_handler (
- label_map[CODE_LABEL_NUMBER (ptr->handler_label)],
- ptr->type_info);
- add_new_handler (nr, temp);
- }
- }
+ duplicate_eh_handlers (NOTE_BLOCK_NUMBER (copy), new_region,
+ save_for_inline_eh_labelmap);
/* We have to forward these both to match the new exception
region. */
@@ -1075,11 +1074,15 @@ copy_for_inline (orig)
{
case QUEUED:
case CONST_INT:
- case SYMBOL_REF:
case PC:
case CC0:
return x;
+ case SYMBOL_REF:
+ if (! SYMBOL_REF_NEED_ADJUST (x))
+ return x;
+ return rethrow_symbol_map (x, save_for_inline_eh_labelmap);
+
case CONST_DOUBLE:
/* We have to make a new CONST_DOUBLE to ensure that we account for
it correctly. Using the old CONST_DOUBLE_MEM data is wrong. */
@@ -1338,6 +1341,18 @@ process_reg_param (map, loc, copy)
}
map->reg_map[REGNO (loc)] = copy;
}
+
+/* Used by duplicate_eh_handlers to map labels for the exception table */
+static struct inline_remap *eif_eh_map;
+
+static rtx
+expand_inline_function_eh_labelmap (label)
+ rtx label;
+{
+ int index = CODE_LABEL_NUMBER (label);
+ return get_label_from_map (eif_eh_map, index);
+}
+
/* Integrate the procedure defined by FNDECL. Note that this function
may wind up calling itself. Since the static variables are not
reentrant, we do not assign them until after the possibility
@@ -2055,17 +2070,12 @@ expand_inline_function (fndecl, parms, target, ignore, type,
/* we have to duplicate the handlers for the original */
if (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_BEG)
{
- handler_info *ptr, *temp;
- int nr;
- nr = new_eh_region_entry (CODE_LABEL_NUMBER (label));
- ptr = get_first_handler (NOTE_BLOCK_NUMBER (copy));
- for ( ; ptr; ptr = ptr->next)
- {
- temp = get_new_handler ( get_label_from_map (map,
- CODE_LABEL_NUMBER (ptr->handler_label)),
- ptr->type_info);
- add_new_handler (nr, temp);
- }
+ /* 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),
+ CODE_LABEL_NUMBER (label),
+ expand_inline_function_eh_labelmap);
}
/* We have to forward these both to match the new exception
@@ -2533,6 +2543,13 @@ copy_rtx_and_substitute (orig, map)
map)),
0);
}
+ else
+ if (SYMBOL_REF_NEED_ADJUST (orig))
+ {
+ eif_eh_map = map;
+ return rethrow_symbol_map (orig,
+ expand_inline_function_eh_labelmap);
+ }
return orig;