aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlessandro Fanfarillo <fanfarillo.gcc@gmail.com>2016-03-28 03:05:01 -0600
committerAlessandro Fanfarillo <afanfa@gcc.gnu.org>2016-03-28 03:05:01 -0600
commit0daa7ed9447c71f2a1c1311729f840c36d0a558d (patch)
tree5e06caaa5702f05c412828249ea7d92ef377f1a6 /gcc
parent45733562ce6c85f6bfd60afa5438f20ef47c2c15 (diff)
downloadgcc-0daa7ed9447c71f2a1c1311729f840c36d0a558d.zip
gcc-0daa7ed9447c71f2a1c1311729f840c36d0a558d.tar.gz
gcc-0daa7ed9447c71f2a1c1311729f840c36d0a558d.tar.bz2
STOP managed by external library when coarrays are used
From-SVN: r234502
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog8
-rw-r--r--gcc/fortran/trans-decl.c14
-rw-r--r--gcc/fortran/trans-stmt.c12
-rw-r--r--gcc/fortran/trans.h2
4 files changed, 33 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index dac67d1..cf95d6f 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,11 @@
+2016-03-28 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
+
+ * 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-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/69043
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 4bd7dc4..309baf1 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -137,6 +137,8 @@ tree gfor_fndecl_caf_sendget;
tree gfor_fndecl_caf_sync_all;
tree gfor_fndecl_caf_sync_memory;
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_str;
tree gfor_fndecl_caf_atomic_def;
@@ -3550,6 +3552,18 @@ gfc_build_builtin_function_decls (void)
/* CAF's ERROR STOP doesn't return. */
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 (
get_identifier (PREFIX("caf_atomic_define")), "R..RW",
void_type_node, 7, pvoid_type_node, size_type_node, integer_type_node,
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index cb54499..2fc43ed 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -635,7 +635,9 @@ gfc_trans_stop (gfc_code *code, bool error_stop)
? (flag_coarray == GFC_FCOARRAY_LIB
? gfor_fndecl_caf_error_stop_str
: 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);
}
else if (code->expr1->ts.type == BT_INTEGER)
@@ -646,7 +648,9 @@ gfc_trans_stop (gfc_code *code, bool error_stop)
? (flag_coarray == GFC_FCOARRAY_LIB
? gfor_fndecl_caf_error_stop
: 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));
}
else
@@ -657,7 +661,9 @@ gfc_trans_stop (gfc_code *code, bool error_stop)
? (flag_coarray == GFC_FCOARRAY_LIB
? gfor_fndecl_caf_error_stop_str
: 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);
}
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 316ee9b..add0cea 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -762,6 +762,8 @@ extern GTY(()) tree gfor_fndecl_caf_sendget;
extern GTY(()) tree gfor_fndecl_caf_sync_all;
extern GTY(()) tree gfor_fndecl_caf_sync_memory;
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_str;
extern GTY(()) tree gfor_fndecl_caf_atomic_def;