mirror of git://gcc.gnu.org/git/gcc.git
STOP managed by external library when coarrays are used
From-SVN: r234503
This commit is contained in:
parent
8a7c025d0e
commit
9dc443e6ce
|
|
@ -1,3 +1,12 @@
|
||||||
|
2016-03-28 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
|
||||||
|
|
||||||
|
Backport from trunk.
|
||||||
|
* trans-decl.c (gfc_build_builtin_function_decls):
|
||||||
|
caf_stop_numeric and caf_stop_str definition.
|
||||||
|
* trans-stmt.c (gfc_trans_stop): invoke external functions
|
||||||
|
for stop and stop_str when coarrays are used.
|
||||||
|
* trans.h: extern for new functions.
|
||||||
|
|
||||||
2016-03-09 Paul Thomas <pault@gcc.gnu.org>
|
2016-03-09 Paul Thomas <pault@gcc.gnu.org>
|
||||||
|
|
||||||
Backport from trunk.
|
Backport from trunk.
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,8 @@ tree gfor_fndecl_caf_sendget;
|
||||||
tree gfor_fndecl_caf_sync_all;
|
tree gfor_fndecl_caf_sync_all;
|
||||||
tree gfor_fndecl_caf_sync_memory;
|
tree gfor_fndecl_caf_sync_memory;
|
||||||
tree gfor_fndecl_caf_sync_images;
|
tree gfor_fndecl_caf_sync_images;
|
||||||
|
tree gfor_fndecl_caf_stop_str;
|
||||||
|
tree gfor_fndecl_caf_stop_numeric;
|
||||||
tree gfor_fndecl_caf_error_stop;
|
tree gfor_fndecl_caf_error_stop;
|
||||||
tree gfor_fndecl_caf_error_stop_str;
|
tree gfor_fndecl_caf_error_stop_str;
|
||||||
tree gfor_fndecl_caf_atomic_def;
|
tree gfor_fndecl_caf_atomic_def;
|
||||||
|
|
@ -3491,6 +3493,18 @@ gfc_build_builtin_function_decls (void)
|
||||||
/* CAF's ERROR STOP doesn't return. */
|
/* CAF's ERROR STOP doesn't return. */
|
||||||
TREE_THIS_VOLATILE (gfor_fndecl_caf_error_stop_str) = 1;
|
TREE_THIS_VOLATILE (gfor_fndecl_caf_error_stop_str) = 1;
|
||||||
|
|
||||||
|
gfor_fndecl_caf_stop_numeric = gfc_build_library_function_decl_with_spec (
|
||||||
|
get_identifier (PREFIX("caf_stop_numeric")), ".R.",
|
||||||
|
void_type_node, 1, gfc_int4_type_node);
|
||||||
|
/* CAF's STOP doesn't return. */
|
||||||
|
TREE_THIS_VOLATILE (gfor_fndecl_caf_stop_numeric) = 1;
|
||||||
|
|
||||||
|
gfor_fndecl_caf_stop_str = gfc_build_library_function_decl_with_spec (
|
||||||
|
get_identifier (PREFIX("caf_stop_str")), ".R.",
|
||||||
|
void_type_node, 2, pchar_type_node, gfc_int4_type_node);
|
||||||
|
/* CAF's STOP doesn't return. */
|
||||||
|
TREE_THIS_VOLATILE (gfor_fndecl_caf_stop_str) = 1;
|
||||||
|
|
||||||
gfor_fndecl_caf_atomic_def = gfc_build_library_function_decl_with_spec (
|
gfor_fndecl_caf_atomic_def = gfc_build_library_function_decl_with_spec (
|
||||||
get_identifier (PREFIX("caf_atomic_define")), "R..RW",
|
get_identifier (PREFIX("caf_atomic_define")), "R..RW",
|
||||||
void_type_node, 7, pvoid_type_node, size_type_node, integer_type_node,
|
void_type_node, 7, pvoid_type_node, size_type_node, integer_type_node,
|
||||||
|
|
|
||||||
|
|
@ -647,7 +647,9 @@ gfc_trans_stop (gfc_code *code, bool error_stop)
|
||||||
? (flag_coarray == GFC_FCOARRAY_LIB
|
? (flag_coarray == GFC_FCOARRAY_LIB
|
||||||
? gfor_fndecl_caf_error_stop_str
|
? gfor_fndecl_caf_error_stop_str
|
||||||
: gfor_fndecl_error_stop_string)
|
: gfor_fndecl_error_stop_string)
|
||||||
: gfor_fndecl_stop_string,
|
: (flag_coarray == GFC_FCOARRAY_LIB
|
||||||
|
? gfor_fndecl_caf_stop_str
|
||||||
|
: gfor_fndecl_stop_string),
|
||||||
2, build_int_cst (pchar_type_node, 0), tmp);
|
2, build_int_cst (pchar_type_node, 0), tmp);
|
||||||
}
|
}
|
||||||
else if (code->expr1->ts.type == BT_INTEGER)
|
else if (code->expr1->ts.type == BT_INTEGER)
|
||||||
|
|
@ -658,7 +660,9 @@ gfc_trans_stop (gfc_code *code, bool error_stop)
|
||||||
? (flag_coarray == GFC_FCOARRAY_LIB
|
? (flag_coarray == GFC_FCOARRAY_LIB
|
||||||
? gfor_fndecl_caf_error_stop
|
? gfor_fndecl_caf_error_stop
|
||||||
: gfor_fndecl_error_stop_numeric)
|
: gfor_fndecl_error_stop_numeric)
|
||||||
: gfor_fndecl_stop_numeric_f08, 1,
|
: (flag_coarray == GFC_FCOARRAY_LIB
|
||||||
|
? gfor_fndecl_caf_stop_numeric
|
||||||
|
: gfor_fndecl_stop_numeric_f08), 1,
|
||||||
fold_convert (gfc_int4_type_node, se.expr));
|
fold_convert (gfc_int4_type_node, se.expr));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -669,7 +673,9 @@ gfc_trans_stop (gfc_code *code, bool error_stop)
|
||||||
? (flag_coarray == GFC_FCOARRAY_LIB
|
? (flag_coarray == GFC_FCOARRAY_LIB
|
||||||
? gfor_fndecl_caf_error_stop_str
|
? gfor_fndecl_caf_error_stop_str
|
||||||
: gfor_fndecl_error_stop_string)
|
: gfor_fndecl_error_stop_string)
|
||||||
: gfor_fndecl_stop_string,
|
: (flag_coarray == GFC_FCOARRAY_LIB
|
||||||
|
? gfor_fndecl_caf_stop_str
|
||||||
|
: gfor_fndecl_stop_string),
|
||||||
2, se.expr, se.string_length);
|
2, se.expr, se.string_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -750,6 +750,8 @@ extern GTY(()) tree gfor_fndecl_caf_sendget;
|
||||||
extern GTY(()) tree gfor_fndecl_caf_sync_all;
|
extern GTY(()) tree gfor_fndecl_caf_sync_all;
|
||||||
extern GTY(()) tree gfor_fndecl_caf_sync_memory;
|
extern GTY(()) tree gfor_fndecl_caf_sync_memory;
|
||||||
extern GTY(()) tree gfor_fndecl_caf_sync_images;
|
extern GTY(()) tree gfor_fndecl_caf_sync_images;
|
||||||
|
extern GTY(()) tree gfor_fndecl_caf_stop_numeric;
|
||||||
|
extern GTY(()) tree gfor_fndecl_caf_stop_str;
|
||||||
extern GTY(()) tree gfor_fndecl_caf_error_stop;
|
extern GTY(()) tree gfor_fndecl_caf_error_stop;
|
||||||
extern GTY(()) tree gfor_fndecl_caf_error_stop_str;
|
extern GTY(()) tree gfor_fndecl_caf_error_stop_str;
|
||||||
extern GTY(()) tree gfor_fndecl_caf_atomic_def;
|
extern GTY(()) tree gfor_fndecl_caf_atomic_def;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
2016-03-28 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
|
||||||
|
|
||||||
|
Backport from trunk.
|
||||||
|
* caf/libcaf.h: caf_stop_numeric and caf_stop_str prototype.
|
||||||
|
* caf/single.c: _gfortran_caf_stop_numeric and
|
||||||
|
_gfortran_caf_stop_str implementation.
|
||||||
|
|
||||||
2016-02-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
2016-02-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||||
|
|
||||||
PR libgfortran/69651
|
PR libgfortran/69651
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,10 @@ void _gfortran_caf_sync_all (int *, char *, int);
|
||||||
void _gfortran_caf_sync_memory (int *, char *, int);
|
void _gfortran_caf_sync_memory (int *, char *, int);
|
||||||
void _gfortran_caf_sync_images (int, int[], int *, char *, int);
|
void _gfortran_caf_sync_images (int, int[], int *, char *, int);
|
||||||
|
|
||||||
|
void _gfortran_caf_stop_numeric (int32_t)
|
||||||
|
__attribute__ ((noreturn));
|
||||||
|
void _gfortran_caf_stop_str (const char *, int32_t)
|
||||||
|
__attribute__ ((noreturn));
|
||||||
void _gfortran_caf_error_stop_str (const char *, int32_t)
|
void _gfortran_caf_error_stop_str (const char *, int32_t)
|
||||||
__attribute__ ((noreturn));
|
__attribute__ ((noreturn));
|
||||||
void _gfortran_caf_error_stop (int32_t) __attribute__ ((noreturn));
|
void _gfortran_caf_error_stop (int32_t) __attribute__ ((noreturn));
|
||||||
|
|
|
||||||
|
|
@ -204,6 +204,23 @@ _gfortran_caf_sync_images (int count __attribute__ ((unused)),
|
||||||
*stat = 0;
|
*stat = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_gfortran_caf_stop_numeric(int32_t stop_code)
|
||||||
|
{
|
||||||
|
fprintf (stderr, "STOP %d\n", stop_code);
|
||||||
|
exit (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_gfortran_caf_stop_str(const char *string, int32_t len)
|
||||||
|
{
|
||||||
|
fputs ("STOP ", stderr);
|
||||||
|
while (len--)
|
||||||
|
fputc (*(string++), stderr);
|
||||||
|
fputs ("\n", stderr);
|
||||||
|
|
||||||
|
exit (0);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_gfortran_caf_error_stop_str (const char *string, int32_t len)
|
_gfortran_caf_error_stop_str (const char *string, int32_t len)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue