summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1997-12-12 05:15:30 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1997-12-12 05:15:30 +0000
commit725cde8fb723f22a35708b36cc76a010db97af61 (patch)
tree15fddd8589e7b848e33c703a1eea6abf0f98396c /gcc/cp
parent6f2eefe66adb6d383e3d2f82f8f819d7afe33559 (diff)
downloadgcc-725cde8fb723f22a35708b36cc76a010db97af61.tar.gz
* except.c (use_eh_context): Don't copy_rtx a REG.
(emit_throw): Lose old unwinder support. (expand_internal_throw): Likewise. * libgcc2.c (struct eh_context): Likewise. (new_eh_context): Likewise. (__get_eh_info): Lose redundant cast. (__get_dynamic_handler_chain): Likewise. (__get_saved_pc): Lose. Lose all old unwinder support code. * decl2.c (finish_file): Lose call to expand_builtin_throw. * except.c (expand_builtin_throw): Remove. * cp-tree.h: Remove ptr_ptr_type_node. * decl.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17054 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/cp-tree.h2
-rw-r--r--gcc/cp/decl.c5
-rw-r--r--gcc/cp/decl2.c2
-rw-r--r--gcc/cp/except.c222
5 files changed, 8 insertions, 230 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d2070090997..6c17bd1aee4 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+Thu Dec 11 21:12:09 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl2.c (finish_file): Lose call to expand_builtin_throw.
+ * except.c (expand_builtin_throw): Remove.
+ * cp-tree.h: Remove ptr_ptr_type_node.
+ * decl.c: Likewise.
+
Thu Dec 11 20:43:33 1997 Teemu Torma <tot@trema.com>
* decl.c (ptr_ptr_type_node): Define.
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 48740a5e3cb..e1653020194 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1511,7 +1511,7 @@ extern tree vt_off_identifier;
/* A node that is a list (length 1) of error_mark_nodes. */
extern tree error_mark_list;
-extern tree ptr_type_node, ptr_ptr_type_node;
+extern tree ptr_type_node;
extern tree class_type_node, record_type_node, union_type_node, enum_type_node;
extern tree unknown_type_node;
extern tree opaque_type_node, signature_type_node;
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index fd753d8ad79..7ece1d33d38 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -241,10 +241,6 @@ tree void_zero_node;
tree ptr_type_node;
tree const_ptr_type_node;
-/* Node for type `void **'. */
-
-tree ptr_ptr_type_node;
-
/* Nodes for types `char *' and `const char *'. */
tree string_type_node, const_string_type_node;
@@ -5069,7 +5065,6 @@ init_decl_processing ()
ptr_type_node = build_pointer_type (void_type_node);
const_ptr_type_node
= build_pointer_type (build_type_variant (void_type_node, 1, 0));
- ptr_ptr_type_node = build_pointer_type (ptr_type_node);
#if 0
record_builtin_type (RID_MAX, NULL_PTR, ptr_type_node);
#endif
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 93452b29392..5e54f49ed2f 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -3166,8 +3166,6 @@ finish_file ()
assemble_constructor (IDENTIFIER_POINTER (fnname));
}
- expand_builtin_throw ();
-
permanent_allocation (1);
/* Done with C language context needs. */
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 0fa5c2425a8..0c66074888f 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -185,10 +185,6 @@ static tree Unwind;
========================================================================= */
-#ifndef DWARF2_UNWIND_INFO
-extern int throw_used;
-#endif
-
extern rtx catch_clauses;
extern tree const_ptr_type_node;
@@ -734,224 +730,6 @@ do_unwind (inner_throw_label)
}
-/* Is called from expand_exception_blocks to generate the code in a function
- to "throw" if anything in the function needs to perform a throw.
-
- expands "throw" as the following pseudo code:
-
- throw:
- eh = find_first_exception_match (saved_pc);
- if (!eh) goto gotta_rethrow_it;
- goto eh;
-
- gotta_rethrow_it:
- saved_pc = __builtin_return_address (0);
- pop_to_previous_level ();
- goto throw; */
-
-void
-expand_builtin_throw ()
-{
-#ifndef DWARF2_UNWIND_INFO
- tree fcall;
- tree params;
- rtx handler;
- rtx saved_pcnthrow;
- rtx next_pc;
- rtx gotta_rethrow_it;
- rtx gotta_call_terminate;
- rtx after_unwind;
- rtx top_of_loop;
- tree t;
- rtx x;
-
- if (! doing_eh (0))
- return;
-
- if (! throw_used)
- return;
-
- params = void_list_node;
- t = make_call_declarator (get_identifier ("__throw"), params, NULL_TREE,
- NULL_TREE);
- start_function (decl_tree_cons (NULL_TREE,
- get_identifier ("void"),
- decl_tree_cons (NULL_TREE,
- get_identifier ("static"),
- NULL_TREE)),
- t, NULL_TREE, 0);
- store_parm_decls ();
- pushlevel (0);
- clear_last_expr ();
- push_momentary ();
- expand_start_bindings (0);
-
- gotta_rethrow_it = gen_label_rtx ();
- gotta_call_terminate = gen_label_rtx ();
-
- /* These two can be frontend specific. If wanted, they can go in
- expand_throw. */
- /* Do we have a valid object we are throwing? */
- t = call_eh_info ();
- emit_cmp_insn (expand_expr (t, NULL_RTX, Pmode, 0),
- const0_rtx, EQ, NULL_RTX,
- GET_MODE (DECL_RTL (t)), 0, 0);
- emit_jump_insn (gen_beq (gotta_call_terminate));
-
- /* search for an exception handler for the saved_pc */
- handler = do_function_call (FirstExceptionMatch,
- expr_tree_cons (NULL_TREE,
- make_tree (ptr_ptr_type_node,
- get_saved_pc_ref ()),
- NULL_TREE),
- ptr_type_node);
-
- /* did we find one? */
- emit_cmp_insn (handler, const0_rtx, EQ, NULL_RTX,
- GET_MODE (handler), 0, 0);
-
- /* if not, jump to gotta_rethrow_it */
- emit_jump_insn (gen_beq (gotta_rethrow_it));
-
- {
- rtx ret_val, x;
- ret_val = expand_builtin_return_addr (BUILT_IN_RETURN_ADDRESS,
- 0, hard_frame_pointer_rtx);
-
- /* Set it up so that we continue at the handler. */
- emit_move_insn (ret_val, handler);
-#ifdef RETURN_ADDR_OFFSET
- x = plus_constant (ret_val, -RETURN_ADDR_OFFSET);
- if (x != ret_val)
- emit_move_insn (ret_val, x);
-#endif
-
- expand_null_return ();
- }
-
- top_of_loop = gen_label_rtx ();
- emit_label (top_of_loop);
-
-#ifdef DONT_ACCESS_GBLS_AFTER_EPILOGUE
- if (DONT_ACCESS_GBLS_AFTER_EPILOGUE)
- {
- saved_pcnthrow = gen_reg_rtx (Pmode);
- emit_move_insn (saved_pcnthrow, hard_function_value (ptr_type_node,
- NULL_TREE));
- }
-#endif
-
- /* Call to __builtin_return_address. */
-#if defined (ARM_FRAME_RTX) /* was __arm */
- /* This should be moved into arm.h:RETURN_ADDR_RTX */
- /* This replaces a 'call' to __builtin_return_address */
- next_pc = gen_reg_rtx (Pmode);
- emit_move_insn (next_pc,
- gen_rtx (MEM, Pmode, plus_constant (hard_frame_pointer_rtx, -4)));
-#else
- params = expr_tree_cons (NULL_TREE, integer_zero_node, NULL_TREE);
- fcall = build_function_call (builtin_return_address_fndecl, params);
- next_pc = expand_expr (fcall, NULL_RTX, Pmode, 0);
-#endif
-
- /* Did __builtin_return_address return a valid address? */
- emit_cmp_insn (next_pc, const0_rtx, EQ, NULL_RTX,
- GET_MODE (next_pc), 0, 0);
-
- emit_jump_insn (gen_beq (gotta_call_terminate));
-
- next_pc = eh_outer_context (next_pc);
-
- /* Yes it did. */
-#ifdef DONT_ACCESS_GBLS_AFTER_EPILOGUE
- if (DONT_ACCESS_GBLS_AFTER_EPILOGUE)
- {
- rtx x;
-
- x = validize_mem (gen_rtx (MEM, Pmode, saved_pcnthrow));
- emit_move_insn (validize_mem (gen_rtx (MEM, Pmode, x)),
- next_pc);
-#ifdef FUNCTION_OUTGOING_VALUE
- emit_move_insn (FUNCTION_OUTGOING_VALUE (ptr_type_node, NULL_TREE),
- validize_mem (gen_rtx (MEM, Pmode,
- plus_constant (saved_pcnthrow,
- GET_MODE_SIZE (Pmode)))));
- emit_insn (gen_rtx (USE, VOIDmode,
- FUNCTION_OUTGOING_VALUE (ptr_type_node, NULL_TREE)));
-#endif
- }
- else
-#endif
- emit_move_insn (get_saved_pc_ref (), next_pc);
-
- after_unwind = gen_label_rtx ();
- do_unwind (gen_rtx (LABEL_REF, Pmode, after_unwind));
-
- emit_label (after_unwind);
-
-#ifdef DONT_ACCESS_GBLS_AFTER_EPILOGUE
- if (DONT_ACCESS_GBLS_AFTER_EPILOGUE)
- {
- t = build_function_type (void_type_node, void_list_node);
- t = make_tree (build_pointer_type (t),
- hard_function_value (ptr_type_node,
- NULL_TREE));
- t = build_function_call (t, NULL_TREE);
- expand_expr (t, const0_rtx, VOIDmode, 0);
- }
- else
-#endif
- emit_throw ();
-
- /* no it didn't --> therefore we need to call terminate */
- emit_label (gotta_call_terminate);
- do_function_call (Terminate, NULL_TREE, NULL_TREE);
-
- {
- rtx ret_val, x;
- /* code to deal with unwinding and looking for it again */
- emit_label (gotta_rethrow_it);
- ret_val = expand_builtin_return_addr (BUILT_IN_RETURN_ADDRESS,
- 0, hard_frame_pointer_rtx);
-
- /* Set it up so that we continue inside, at the top of the loop. */
- emit_move_insn (ret_val, gen_rtx (LABEL_REF, Pmode, top_of_loop));
-#ifdef RETURN_ADDR_OFFSET
- x = plus_constant (ret_val, -RETURN_ADDR_OFFSET);
- if (x != ret_val)
- emit_move_insn (ret_val, x);
-#endif
-
-#ifdef DONT_ACCESS_GBLS_AFTER_EPILOGUE
- if (DONT_ACCESS_GBLS_AFTER_EPILOGUE)
- {
- rtx x = emit_library_call_value (gen_rtx (SYMBOL_REF, Pmode,
- "__eh_pcnthrow"),
- NULL_RTX, 1,
- Pmode, 0);
- /* This is to get a version of throw that will throw properly. */
- emit_move_insn (validize_mem (gen_rtx (MEM, Pmode,
- plus_constant (x, GET_MODE_SIZE (Pmode)))),
- throw_libfunc);
-#ifdef FUNCTION_OUTGOING_VALUE
- emit_move_insn (FUNCTION_OUTGOING_VALUE (ptr_type_node, NULL_TREE),
- x);
- emit_insn (gen_rtx (USE, VOIDmode, FUNCTION_OUTGOING_VALUE (ptr_type_node, NULL_TREE)));
-#endif
- }
-#endif
-
- /* Fall into epilogue to unwind prologue. */
- }
-
- expand_end_bindings (getdecls (), 1, 0);
- poplevel (1, 0, 0);
- pop_momentary ();
-
- finish_function (lineno, 0, 0);
-#endif /* DWARF2_UNWIND_INFO */
-}
-
/* An exception spec is implemented more or less like:
try {