This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[patch, fortran] Patch for PR fortran/39352, using -fexceptions.
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 12 May 2009 17:00:45 -0700 (PDT)
- Subject: [patch, fortran] Patch for PR fortran/39352, using -fexceptions.
- Reply-to: sje at cup dot hp dot com
This patch for PR fortran/39352 initializes eh_personality_libfunc if
-fexceptions is used. This is the same initalization that is done in
init_exception_processing (cp/except.c) and in java_init_decl_processing
(java/decl.c)
Tested with no regressions on IA64 HP-UX and Linux.
OK to checkin?
Steve Ellcey
sje@cup.hp.com
2009-05-12 Steve Ellcey <sje@cup.hp.com>
PR fortran/39352
* f95-lang.c (gfc_init): Initialize eh_personality_libfunc.
Index: f95-lang.c
===================================================================
--- f95-lang.c (revision 147407)
+++ f95-lang.c (working copy)
@@ -43,6 +43,9 @@ along with GCC; see the file COPYING3.
#include "diagnostic.h"
#include "tree-dump.h"
#include "cgraph.h"
+#include "libfuncs.h"
+#include "expr.h"
+#include "except.h"
#include "gfortran.h"
#include "cpp.h"
@@ -269,6 +272,11 @@ gfc_init (void)
if (gfc_new_file () != SUCCESS)
fatal_error ("can't open input file: %s", gfc_source_file);
+ if (flag_exceptions)
+ eh_personality_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS
+ ? "__gxx_personality_sj0"
+ : "__gxx_personality_v0");
+
return true;
}