* except.h (protect_cleanup_actions): Remove it.
(lang_protect_cleanup_actions): Declare it.
* except.c (protect_cleanup_actions): Remove it.
(lang_protect_cleanup_actions): New variable.
(init_eh): Don't make protect_cleanup_actions a GC root.
(expand_eh_region_and_cleanup): Call
lang_protect_cleanup_actions.
(output_function_exception_table): Remove unused `align'
variable.
* varasm.c (assemble_external): Abort if we have not yet
opened the assembly output file.
* except.c (cp_protect_cleanup_actions): New function.
(init_exception_processing): Don't set protect_cleanup_actions
here. Do set lang_protect_cleanup_actions.
From-SVN: r42218
+2001-05-17 Mark Mitchell <mark@codesourcery.com>
+
+ * except.h (protect_cleanup_actions): Remove it.
+ (lang_protect_cleanup_actions): Declare it.
+ * except.c (protect_cleanup_actions): Remove it.
+ (lang_protect_cleanup_actions): New variable.
+ (init_eh): Don't make protect_cleanup_actions a GC root.
+ (expand_eh_region_and_cleanup): Call
+ lang_protect_cleanup_actions.
+ (output_function_exception_table): Remove unused `align'
+ variable.
+ * varasm.c (assemble_external): Abort if we have not yet
+ opened the assembly output file.
+
Thu May 17 11:54:50 2001 Jeffrey A Law (law@cygnus.com)
* except.c (sjlj_emit_function_enter): Call assemble_external_libcall
+2001-05-17 Mark Mitchell <mark@codesourcery.com>
+
+ * except.c (cp_protect_cleanup_actions): New function.
+ (init_exception_processing): Don't set protect_cleanup_actions
+ here. Do set lang_protect_cleanup_actions.
+
2001-05-16 Nathan Sidwell <nathan@codesourcery.com>
* spew.c (read_token): Call yyerror on all unexpected tokens.
static bool is_admissible_throw_operand PARAMS ((tree));
static int can_convert_eh PARAMS ((tree, tree));
static void check_handlers_1 PARAMS ((tree, tree));
+static tree cp_protect_cleanup_actions PARAMS ((void));
#include "decl.h"
#include "obstack.h"
if (flag_honor_std)
pop_namespace ();
- protect_cleanup_actions = build_call (terminate_node, NULL_TREE);
-
/* void __cxa_call_unexpected(void *); */
tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
tmp = build_function_type (void_type_node, tmp);
: "__gxx_personality_v0");
lang_eh_runtime_type = build_eh_type_type;
+ lang_protect_cleanup_actions = &cp_protect_cleanup_actions;
}
+/* Returns an expression to be executed if an unhandled exception is
+ propogated out of a cleanup region. */
+
+static tree
+cp_protect_cleanup_actions ()
+{
+ /* [except.terminate]
+
+ When the destruction of an object during stack unwinding exits
+ using an exception ... void terminate(); is called. */
+ return build_call (terminate_node, NULL_TREE);
+}
+
static tree
prepare_eh_type (type)
tree type;
@settitle Installing GCC: Binaries
@end ifset
-@comment $Id: install.texi,v 1.1 2001/05/11 22:10:54 gerald Exp $
+@comment $Id: install.texi,v 1.2 2001/05/16 14:57:06 dje Exp $
@c Copyright (C) 2001 Free Software Foundation, Inc.
@c *** Converted to texinfo by Dean Wakerley, dean@wakerley.com
compiler, see our @uref{binaries.html,,binaries page} for
details.
+You must use GNU Make to build GCC on Solaris 2. If you don't have GNU
+Make installed, you can use the prebuilt compiler mentioned above to
+build it.
+
Sun as 4.X is broken in that it cannot cope with long symbol names.
A typical error message might look similar to the following:
@samp{/usr/ccs/bin/as: "/var/tmp/ccMsw135.s", line 11041:
error: can't compute value of an expression involving an external symbol.}
-This is Sun bug 4237974. See the @uref{../faq.html#squangle,,How to work around too long C++
-symbol names?} FAQ entry for further information and a workaround. This is fixed with patch
-108908-02 and has been fixed in later (5.x) versions of the assembler.
-
-Sun make in all known Solaris 1 (SunOS 4) and Solaris 2 releases has a
-broken @emph{VPATH} mechanism, which means you must either:
-@itemize @bullet
-@item
-Use GNU make (recommended), @emph{or:}
-@item
-Always build in the source directory, @emph{or:}
-@item
-@emph{(For GCC 2.95.1 only)}
-apply the patches mentioned at
-@uref{http://www.gnu.org/software/gcc/extensions.html#sun-make,,
-http://www.gnu.org/software/gcc/extensions.html#sun-make}.
-@end itemize
-
-
+This is Sun bug 4237974. This is fixed with patch 108908-02 and has
+been fixed in later (5.x) versions of the assembler.
@html
<p>
<hr>
/* Protect cleanup actions with must-not-throw regions, with a call
to the given failure handler. */
-tree protect_cleanup_actions;
+tree (*lang_protect_cleanup_actions) PARAMS ((void));
/* Return true if type A catches type B. */
int (*lang_eh_type_covers) PARAMS ((tree a, tree b));
init_eh ()
{
ggc_add_rtx_root (&exception_handler_labels, 1);
- ggc_add_tree_root (&protect_cleanup_actions, 1);
if (! flag_exceptions)
return;
tree handler;
{
struct eh_region *region;
+ tree protect_cleanup_actions;
rtx around_label;
rtx data_save[2];
emit_label (region->label);
+ /* Give the language a chance to specify an action to be taken if an
+ exception is thrown that would propogate out of the HANDLER. */
+ protect_cleanup_actions
+ = (lang_protect_cleanup_actions
+ ? (*lang_protect_cleanup_actions) ()
+ : NULL_TREE);
+
if (protect_cleanup_actions)
expand_eh_region_start ();
extern void sjlj_emit_function_exit_after PARAMS ((rtx));
-/* Nonzero to protect cleanup actions with must-not-throw regions. */
-extern tree protect_cleanup_actions;
+/* If non-NULL, this is a function that returns an expression to be
+ executed if an unhandled exception is propogated out of a cleanup
+ region. For example, in C++, an exception thrown by a destructor
+ during stack unwinding is required to result in a call to
+ `std::terminate', so the C++ version of this function returns a
+ CALL_EXPR for `std::terminate'. */
+extern tree (*lang_protect_cleanup_actions) PARAMS ((void));
/* Return true if type A catches type B. */
extern int (*lang_eh_type_covers) PARAMS ((tree a, tree b));
assemble_external (decl)
tree decl ATTRIBUTE_UNUSED;
{
+ /* Because most platforms do not define ASM_OUTPUT_EXTERNAL, the
+ main body of this code is only rarely exercised. To provide some
+ testing, on all platforms, we make sure that the ASM_OUT_FILE is
+ open. If it's not, we should not be calling this function. */
+ if (!asm_out_file)
+ abort ();
+
#ifdef ASM_OUTPUT_EXTERNAL
if (DECL_P (decl) && DECL_EXTERNAL (decl) && TREE_PUBLIC (decl))
{