re PR fortran/39352 (gfortran.dg/vect/pr39318.f90 doesn't work on ia64)
2009-05-15 Tobias Burnus <burnus@net-b.de> PR fortran/39352 * f95-lang.c: Add gfc_maybe_initialize_eh. * gfortran.h: Add gfc_maybe_initialize_eh prototype. * Make-lang.in: Add new .h dendencies for f95-lang.c * openmp.c (resolve_omp_do): Call gfc_maybe_initialize_eh. * misc.c (gfc_free): Avoid #define trickery for free. From-SVN: r147559
This commit is contained in:
parent
675a72d643
commit
602b85231d
@ -1,3 +1,12 @@
|
||||
2009-05-15 Tobias Burnus <burnus@net-b.de>
|
||||
|
||||
PR fortran/39352
|
||||
* f95-lang.c: Add gfc_maybe_initialize_eh.
|
||||
* gfortran.h: Add gfc_maybe_initialize_eh prototype.
|
||||
* Make-lang.in: Add new .h dendencies for f95-lang.c
|
||||
* openmp.c (resolve_omp_do): Call gfc_maybe_initialize_eh.
|
||||
* misc.c (gfc_free): Avoid #define trickery for free.
|
||||
|
||||
2009-05-14 Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
* dump-parse-tree.c (show_code_node): Add ERRMSG to the dumping
|
||||
|
@ -313,7 +313,8 @@ GFORTRAN_TRANS_DEPS = fortran/gfortran.h fortran/libgfortran.h \
|
||||
|
||||
fortran/f95-lang.o: $(GFORTRAN_TRANS_DEPS) fortran/mathbuiltins.def \
|
||||
gt-fortran-f95-lang.h gtype-fortran.h $(CGRAPH_H) $(TARGET_H) fortran/cpp.h \
|
||||
$(BUILTINS_DEF) fortran/types.def
|
||||
$(BUILTINS_DEF) fortran/types.def \
|
||||
libfuncs.h expr.h except.h
|
||||
fortran/scanner.o: toplev.h fortran/cpp.h
|
||||
fortran/convert.o: $(GFORTRAN_TRANS_DEPS)
|
||||
fortran/trans.o: $(GFORTRAN_TRANS_DEPS) tree-iterator.h
|
||||
|
@ -43,6 +43,10 @@ along with GCC; see the file COPYING3. If not see
|
||||
#include "diagnostic.h"
|
||||
#include "tree-dump.h"
|
||||
#include "cgraph.h"
|
||||
/* For gfc_maybe_initialize_eh. */
|
||||
#include "libfuncs.h"
|
||||
#include "expr.h"
|
||||
#include "except.h"
|
||||
|
||||
#include "gfortran.h"
|
||||
#include "cpp.h"
|
||||
@ -165,6 +169,10 @@ static GTY(()) struct binding_level *free_binding_level;
|
||||
It is indexed by a RID_... value. */
|
||||
tree *ridpointers = NULL;
|
||||
|
||||
/* True means we've initialized exception handling. */
|
||||
bool gfc_eh_initialized_p;
|
||||
|
||||
|
||||
/* Prepare expr to be an argument of a TRUTH_NOT_EXPR,
|
||||
or validate its data type for an `if' or `while' statement or ?..: exp.
|
||||
|
||||
@ -1223,5 +1231,21 @@ gfc_init_ts (void)
|
||||
tree_contains_struct[NAMESPACE_DECL][TS_DECL_MINIMAL] = 1;
|
||||
}
|
||||
|
||||
void
|
||||
gfc_maybe_initialize_eh (void)
|
||||
{
|
||||
if (!flag_exceptions || gfc_eh_initialized_p)
|
||||
return;
|
||||
|
||||
gfc_eh_initialized_p = true;
|
||||
eh_personality_libfunc
|
||||
= init_one_libfunc (USING_SJLJ_EXCEPTIONS
|
||||
? "__gcc_personality_sj0"
|
||||
: "__gcc_personality_v0");
|
||||
default_init_unwind_resume_libfunc ();
|
||||
using_eh_for_cleanups ();
|
||||
}
|
||||
|
||||
|
||||
#include "gt-fortran-f95-lang.h"
|
||||
#include "gtype-fortran.h"
|
||||
|
@ -2198,6 +2198,9 @@ unsigned int gfc_init_options (unsigned int, const char **);
|
||||
int gfc_handle_option (size_t, const char *, int);
|
||||
bool gfc_post_options (const char **);
|
||||
|
||||
/* f95-lang.c */
|
||||
void gfc_maybe_initialize_eh (void);
|
||||
|
||||
/* iresolve.c */
|
||||
const char * gfc_get_string (const char *, ...) ATTRIBUTE_PRINTF_1;
|
||||
bool gfc_find_sym_in_expr (gfc_symbol *, gfc_expr *);
|
||||
|
@ -42,22 +42,15 @@ gfc_getmem (size_t n)
|
||||
}
|
||||
|
||||
|
||||
/* gfortran.h defines free to something that triggers a syntax error,
|
||||
but we need free() here. */
|
||||
|
||||
#define temp free
|
||||
#undef free
|
||||
|
||||
void
|
||||
gfc_free (void *p)
|
||||
{
|
||||
/* The parentheses around free are needed in order to call not
|
||||
the redefined free of gfortran.h. */
|
||||
if (p != NULL)
|
||||
free (p);
|
||||
(free) (p);
|
||||
}
|
||||
|
||||
#define free temp
|
||||
#undef temp
|
||||
|
||||
|
||||
/* Get terminal width. */
|
||||
|
||||
|
@ -1503,6 +1503,9 @@ resolve_omp_do (gfc_code *code)
|
||||
void
|
||||
gfc_resolve_omp_directive (gfc_code *code, gfc_namespace *ns ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (code->op != EXEC_OMP_ATOMIC)
|
||||
gfc_maybe_initialize_eh ();
|
||||
|
||||
switch (code->op)
|
||||
{
|
||||
case EXEC_OMP_DO:
|
||||
|
Loading…
Reference in New Issue
Block a user