summaryrefslogtreecommitdiff
path: root/gcc/fortran/parse.c
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-08 06:28:41 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-08 06:28:41 +0000
commit3f73d66e38658de2fb5277e5ad8e0a49222ea41a (patch)
tree2bbcfee69dbbc562c058ffd1078f6f90732ef100 /gcc/fortran/parse.c
parenteadf7d4bf5c2895313824a857bd9d4b77205b6a7 (diff)
downloadgcc-3f73d66e38658de2fb5277e5ad8e0a49222ea41a.tar.gz
2011-06-08 Tobias Burnus <burnus@net-b.de>
PR fortran/18918 * gfortran.h (gfc_statement): Add ST_LOCK and ST_UNLOCK. (gfc_exec_op): Add EXEC_LOCK and EXEC_UNLOCK. (gfc_code): Add expr4. * match.h (gfc_match_lock, gfc_match_unlock): New prototypes. * match.c (gfc_match_lock, gfc_match_unlock, lock_unlock_statement): New functions. (sync_statement): Bug fix, avoiding double freeing. (gfc_match_if): Handle LOCK/UNLOCK statement. * parse.c (decode_statement, next_statement, gfc_ascii_statement): Ditto. * st.c (gfc_free_statement): Handle LOCK and UNLOCK. * resolve.c (resolve_lock_unlock): New function. (resolve_code): Call it. * dump-parse-tree.c (show_code_node): Handle LOCK/UNLOCK. * frontend-passes.c (gfc_code_walker): Optimize gfc_code's expr4. 2011-06-08 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_lock_1.f90: New. * gfortran.dg/coarray_lock_2.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174796 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r--gcc/fortran/parse.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index a47b4578169..6013931d355 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -398,6 +398,10 @@ decode_statement (void)
match ("intrinsic", gfc_match_intrinsic, ST_ATTR_DECL);
break;
+ case 'l':
+ match ("lock", gfc_match_lock, ST_LOCK);
+ break;
+
case 'm':
match ("module% procedure", gfc_match_modproc, ST_MODULE_PROC);
match ("module", gfc_match_module, ST_MODULE);
@@ -449,6 +453,7 @@ decode_statement (void)
break;
case 'u':
+ match ("unlock", gfc_match_unlock, ST_UNLOCK);
match ("use", gfc_match_use, ST_USE);
break;
@@ -953,7 +958,8 @@ next_statement (void)
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_ERROR_STOP: \
- case ST_SYNC_ALL: case ST_SYNC_IMAGES: case ST_SYNC_MEMORY
+ case ST_SYNC_ALL: case ST_SYNC_IMAGES: case ST_SYNC_MEMORY: \
+ case ST_LOCK: case ST_UNLOCK
/* Statements that mark other executable statements. */
@@ -1334,6 +1340,9 @@ gfc_ascii_statement (gfc_statement st)
case ST_INTERFACE:
p = "INTERFACE";
break;
+ case ST_LOCK:
+ p = "LOCK";
+ break;
case ST_PARAMETER:
p = "PARAMETER";
break;
@@ -1394,6 +1403,9 @@ gfc_ascii_statement (gfc_statement st)
case ST_TYPE:
p = "TYPE";
break;
+ case ST_UNLOCK:
+ p = "UNLOCK";
+ break;
case ST_USE:
p = "USE";
break;