This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch,Fortran, 4.6] Coarray 4/n: Rename "ALL STOP" to "ERROR STOP"
- From: Tobias Burnus <burnus at net-b dot de>
- To: gcc patches <gcc-patches at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>
- Date: Tue, 23 Feb 2010 21:12:39 +0100
- Subject: Re: [Patch,Fortran, 4.6] Coarray 4/n: Rename "ALL STOP" to "ERROR STOP"
- References: <4B843263.2070304@net-b.de>
Tobias Burnus wrote:
> I intent to apply this patch atop of patch 1,
> http://gcc.gnu.org/ml/fortran/2010-02/msg00043.html, before committal.
>
> At the WG5/J3 (well, PL22.3) meeting it was decided to rename ALL STOP
> into ERROR STOP, see http://j3-fortran.org/doc/meeting/191/10-144.txt.
> Well, that's what this patch does.
>
> Build on x86-64-linux. OK for the 4.6 trunk?
>
For those whose glass ball is currently broken I have now also attached
the patch.
Tobias
diff --git a/gcc/fortran/dump-parse-tree.c b/gcc/fortran/dump-parse-tree.c
index da9b293..e722ff0 100644
--- a/gcc/fortran/dump-parse-tree.c
+++ b/gcc/fortran/dump-parse-tree.c
@@ -1275,8 +1275,8 @@ show_code_node (int level, gfc_code *c)
break;
- case EXEC_ALL_STOP:
- fputs ("ALL ", dumpfile);
+ case EXEC_ERROR_STOP:
+ fputs ("ERROR ", dumpfile);
/* Fall through. */
case EXEC_STOP:
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 23a8e8f..2a63d71 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -205,7 +205,7 @@ arith;
/* Statements. */
typedef enum
{
- ST_ARITHMETIC_IF, ST_ALL_STOP, ST_ALLOCATE, ST_ATTR_DECL, ST_BACKSPACE,
+ ST_ARITHMETIC_IF, ST_ERROR_STOP, ST_ALLOCATE, ST_ATTR_DECL, ST_BACKSPACE,
ST_BLOCK, ST_BLOCK_DATA,
ST_CALL, ST_CASE, ST_CLOSE, ST_COMMON, ST_CONTINUE, ST_CONTAINS, ST_CYCLE,
ST_DATA, ST_DATA_DECL, ST_DEALLOCATE, ST_DO, ST_ELSE, ST_ELSEIF,
@@ -1977,7 +1977,7 @@ gfc_forall_iterator;
typedef enum
{
EXEC_NOP = 1, EXEC_END_BLOCK, EXEC_ASSIGN, EXEC_LABEL_ASSIGN,
- EXEC_POINTER_ASSIGN, EXEC_ALL_STOP, EXEC_CRITICAL,
+ EXEC_POINTER_ASSIGN, EXEC_CRITICAL, EXEC_ERROR_STOP,
EXEC_GOTO, EXEC_CALL, EXEC_COMPCALL, EXEC_ASSIGN_CALL, EXEC_RETURN,
EXEC_ENTRY, EXEC_PAUSE, EXEC_STOP, EXEC_CONTINUE, EXEC_INIT_ASSIGN,
EXEC_IF, EXEC_ARITHMETIC_IF, EXEC_DO, EXEC_DO_WHILE, EXEC_SELECT, EXEC_BLOCK,
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 796bdc5..ba65a62 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -1538,7 +1538,6 @@ gfc_match_if (gfc_statement *if_type)
gfc_clear_error ();
- match ("all stop", gfc_match_all_stop, ST_ALL_STOP)
match ("allocate", gfc_match_allocate, ST_ALLOCATE)
match ("assign", gfc_match_assign, ST_LABEL_ASSIGNMENT)
match ("backspace", gfc_match_backspace, ST_BACKSPACE)
@@ -1548,6 +1547,7 @@ gfc_match_if (gfc_statement *if_type)
match ("cycle", gfc_match_cycle, ST_CYCLE)
match ("deallocate", gfc_match_deallocate, ST_DEALLOCATE)
match ("end file", gfc_match_endfile, ST_END_FILE)
+ match ("error stop", gfc_match_error_stop, ST_ERROR_STOP)
match ("exit", gfc_match_exit, ST_EXIT)
match ("flush", gfc_match_flush, ST_FLUSH)
match ("forall", match_simple_forall, ST_FORALL)
@@ -2046,8 +2046,8 @@ gfc_match_stopcode (gfc_statement st)
case ST_STOP:
new_st.op = EXEC_STOP;
break;
- case ST_ALL_STOP:
- new_st.op = EXEC_ALL_STOP;
+ case ST_ERROR_STOP:
+ new_st.op = EXEC_ERROR_STOP;
break;
case ST_PAUSE:
new_st.op = EXEC_PAUSE;
@@ -2099,16 +2099,16 @@ gfc_match_stop (void)
}
-/* Match the ALL STOP statement. */
+/* Match the ERROR STOP statement. */
match
-gfc_match_all_stop (void)
+gfc_match_error_stop (void)
{
- if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: ALL STOP statement at %C")
+ if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: ERROR STOP statement at %C")
== FAILURE)
return MATCH_ERROR;
- return gfc_match_stopcode (ST_ALL_STOP);
+ return gfc_match_stopcode (ST_ERROR_STOP);
}
diff --git a/gcc/fortran/match.h b/gcc/fortran/match.h
index f21fcd6..7894716 100644
--- a/gcc/fortran/match.h
+++ b/gcc/fortran/match.h
@@ -76,7 +76,7 @@ match gfc_match_cycle (void);
match gfc_match_exit (void);
match gfc_match_pause (void);
match gfc_match_stop (void);
-match gfc_match_all_stop (void);
+match gfc_match_error_stop (void);
match gfc_match_continue (void);
match gfc_match_assign (void);
match gfc_match_goto (void);
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 0c0203a..f996c9b 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -331,7 +331,6 @@ decode_statement (void)
ST_INTERFACE);
match ("allocate", gfc_match_allocate, ST_ALLOCATE);
match ("allocatable", gfc_match_allocatable, ST_ATTR_DECL);
- match ("all stop", gfc_match_all_stop, ST_ALL_STOP);
match ("assign", gfc_match_assign, ST_LABEL_ASSIGNMENT);
match ("asynchronous", gfc_match_asynchronous, ST_ATTR_DECL);
break;
@@ -366,6 +365,7 @@ decode_statement (void)
match ("else", gfc_match_else, ST_ELSE);
match ("else where", gfc_match_elsewhere, ST_ELSEWHERE);
match ("else if", gfc_match_elseif, ST_ELSEIF);
+ match ("error stop", gfc_match_error_stop, ST_ERROR_STOP);
match ("enum , bind ( c )", gfc_match_enum, ST_ENUM);
if (gfc_match_end (&st) == MATCH_YES)
@@ -943,7 +943,7 @@ next_statement (void)
case ST_POINTER_ASSIGNMENT: case ST_EXIT: case ST_CYCLE: \
case ST_ASSIGNMENT: case ST_ARITHMETIC_IF: case ST_WHERE: case ST_FORALL: \
case ST_LABEL_ASSIGNMENT: case ST_FLUSH: case ST_OMP_FLUSH: \
- case ST_OMP_BARRIER: case ST_OMP_TASKWAIT: case ST_ALL_STOP: \
+ case ST_OMP_BARRIER: case ST_OMP_TASKWAIT: case ST_ERROR_STOP: \
case ST_SYNC_ALL: case ST_SYNC_IMAGES: case ST_SYNC_MEMORY
/* Statements that mark other executable statements. */
@@ -1155,8 +1155,8 @@ gfc_ascii_statement (gfc_statement st)
case ST_ALLOCATE:
p = "ALLOCATE";
break;
- case ST_ALL_STOP:
- p = "ALL STOP";
+ case ST_ERROR_STOP:
+ p = "ERROR STOP";
break;
case ST_ATTR_DECL:
p = _("attribute declaration");
@@ -3559,7 +3559,7 @@ parse_executable (gfc_statement st)
case ST_CYCLE:
case ST_PAUSE:
case ST_STOP:
- case ST_ALL_STOP:
+ case ST_ERROR_STOP:
case ST_END_SUBROUTINE:
case ST_DO:
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index f1970a2..0e6b8f2 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -8113,7 +8113,7 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
case EXEC_CYCLE:
case EXEC_PAUSE:
case EXEC_STOP:
- case EXEC_ALL_STOP:
+ case EXEC_ERROR_STOP:
case EXEC_EXIT:
case EXEC_CONTINUE:
case EXEC_DT_END:
diff --git a/gcc/fortran/st.c b/gcc/fortran/st.c
index 5f8090d..3f98c60 100644
--- a/gcc/fortran/st.c
+++ b/gcc/fortran/st.c
@@ -98,7 +98,7 @@ gfc_free_statement (gfc_code *p)
case EXEC_IF:
case EXEC_PAUSE:
case EXEC_STOP:
- case EXEC_ALL_STOP:
+ case EXEC_ERROR_STOP:
case EXEC_EXIT:
case EXEC_WHERE:
case EXEC_IOLENGTH:
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index f85a4ea..b5cdbc7 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -85,7 +85,7 @@ tree gfor_fndecl_pause_numeric;
tree gfor_fndecl_pause_string;
tree gfor_fndecl_stop_numeric;
tree gfor_fndecl_stop_string;
-tree gfor_fndecl_all_stop_string;
+tree gfor_fndecl_error_stop_string;
tree gfor_fndecl_runtime_error;
tree gfor_fndecl_runtime_error_at;
tree gfor_fndecl_runtime_warning_at;
@@ -2719,12 +2719,12 @@ gfc_build_builtin_function_decls (void)
/* Stop doesn't return. */
TREE_THIS_VOLATILE (gfor_fndecl_stop_string) = 1;
- gfor_fndecl_all_stop_string =
- gfc_build_library_function_decl (get_identifier (PREFIX("all_stop_string")),
+ gfor_fndecl_error_stop_string =
+ gfc_build_library_function_decl (get_identifier (PREFIX("error_stop_string")),
void_type_node, 2, pchar_type_node,
gfc_int4_type_node);
- /* ALL STOP doesn't return. */
- TREE_THIS_VOLATILE (gfor_fndecl_all_stop_string) = 1;
+ /* ERROR STOP doesn't return. */
+ TREE_THIS_VOLATILE (gfor_fndecl_error_stop_string) = 1;
gfor_fndecl_pause_numeric =
gfc_build_library_function_decl (get_identifier (PREFIX("pause_numeric")),
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 9ee83ca..58c9f3e 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -576,7 +576,7 @@ gfc_trans_pause (gfc_code * code)
to a runtime library call. */
tree
-gfc_trans_stop (gfc_code *code, bool all_stop)
+gfc_trans_stop (gfc_code *code, bool error_stop)
{
tree gfc_int4_type_node = gfc_get_int_type (4);
gfc_se se;
@@ -596,7 +596,7 @@ gfc_trans_stop (gfc_code *code, bool all_stop)
{
gfc_conv_expr_reference (&se, code->expr1);
tmp = build_call_expr_loc (input_location,
- all_stop ? gfor_fndecl_all_stop_string
+ error_stop ? gfor_fndecl_error_stop_string
: gfor_fndecl_stop_string,
2, se.expr, se.string_length);
}
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index edce754..b5ff619 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -1130,8 +1130,8 @@ trans_code (gfc_code * code, tree cond)
break;
case EXEC_STOP:
- case EXEC_ALL_STOP:
- res = gfc_trans_stop (code, code->op == EXEC_ALL_STOP);
+ case EXEC_ERROR_STOP:
+ res = gfc_trans_stop (code, code->op == EXEC_ERROR_STOP);
break;
case EXEC_CALL:
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 6ceb962..53c1dc6 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -533,7 +533,7 @@ extern GTY(()) tree gfor_fndecl_pause_numeric;
extern GTY(()) tree gfor_fndecl_pause_string;
extern GTY(()) tree gfor_fndecl_stop_numeric;
extern GTY(()) tree gfor_fndecl_stop_string;
-extern GTY(()) tree gfor_fndecl_all_stop_string;
+extern GTY(()) tree gfor_fndecl_error_stop_string;
extern GTY(()) tree gfor_fndecl_runtime_error;
extern GTY(()) tree gfor_fndecl_runtime_error_at;
extern GTY(()) tree gfor_fndecl_runtime_warning_at;
diff --git a/gcc/testsuite/gfortran.dg/coarray_1.f90 b/gcc/testsuite/gfortran.dg/coarray_1.f90
index da05884..ba10d64 100644
--- a/gcc/testsuite/gfortran.dg/coarray_1.f90
+++ b/gcc/testsuite/gfortran.dg/coarray_1.f90
@@ -14,5 +14,5 @@ sync images(*) ! { dg-error "Fortran 2008:" }
! num_images is implicitly defined:
n = num_images() ! { dg-error "convert UNKNOWN to INTEGER" }
-all stop 'stop' ! { dg-error "Fortran 2008:" }
+error stop 'stop' ! { dg-error "Fortran 2008:" }
end
diff --git a/gcc/testsuite/gfortran.dg/coarray_2.f90 b/gcc/testsuite/gfortran.dg/coarray_2.f90
index 2d11ca3..1fcb9b8 100644
--- a/gcc/testsuite/gfortran.dg/coarray_2.f90
+++ b/gcc/testsuite/gfortran.dg/coarray_2.f90
@@ -1,5 +1,5 @@
! { dg-do run }
-! { dg-shouldfail "all stop" }
+! { dg-shouldfail "error stop" }
!
! Coarray support
! PR fortran/18918
@@ -40,7 +40,7 @@ sync images (1)
sync images ([1])
if (num_images() /= 1) call abort()
-all stop 'stop'
+error stop 'stop'
end
-! { dg-output "ALL STOP stop" }
+! { dg-output "ERROR STOP stop" }
diff --git a/gcc/testsuite/gfortran.dg/coarray_3.f90 b/gcc/testsuite/gfortran.dg/coarray_3.f90
index 8056126..648f2fa 100644
--- a/gcc/testsuite/gfortran.dg/coarray_3.f90
+++ b/gcc/testsuite/gfortran.dg/coarray_3.f90
@@ -78,7 +78,7 @@ pure subroutine pureSub()
critical ! { dg-error "Image control statement CRITICAL" }
end critical ! { dg-error "Expecting END SUBROUTINE statement" }
sync all ! { dg-error "Image control statement SYNC" }
- all stop ! { dg-error "not allowed in PURE procedure" }
+ error stop ! { dg-error "not allowed in PURE procedure" }
end subroutine pureSub
diff --git a/libgfortran/gfortran.map b/libgfortran/gfortran.map
index 200bed6..bcca957 100644
--- a/libgfortran/gfortran.map
+++ b/libgfortran/gfortran.map
@@ -1100,7 +1100,7 @@ GFORTRAN_1.2 {
GFORTRAN_1.3 {
global:
- _gfortran_all_stop_string;
+ _gfortran_error_stop_string;
} GFORTRAN_1.2;
F2C_1.0 {
diff --git a/libgfortran/runtime/stop.c b/libgfortran/runtime/stop.c
index d434d87..bda6b89 100644
--- a/libgfortran/runtime/stop.c
+++ b/libgfortran/runtime/stop.c
@@ -54,18 +54,18 @@ stop_string (const char *string, GFC_INTEGER_4 len)
sys_exit (0);
}
-extern void all_stop_string (const char *, GFC_INTEGER_4);
-export_proto(all_stop_string);
+extern void error_stop_string (const char *, GFC_INTEGER_4);
+export_proto(error_stop_string);
/* Per Fortran 2008, section 8.4: "Execution of a STOP statement initiates
- normal termination of execution. Execution of an ALL STOP statement
- initiates error termination of execution." Thus, all_stop_string returns
+ normal termination of execution. Execution of an ERROR STOP statement
+ initiates error termination of execution." Thus, error_stop_string returns
a nonzero exit status code. */
void
-all_stop_string (const char *string, GFC_INTEGER_4 len)
+error_stop_string (const char *string, GFC_INTEGER_4 len)
{
- st_printf ("ALL STOP ");
+ st_printf ("ERROR STOP ");
while (len--)
st_printf ("%c", *(string++));
st_printf ("\n");