summaryrefslogtreecommitdiff
path: root/gcc/fortran/options.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2010-04-06 21:03:10 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2010-04-06 21:03:10 +0200
commitf4d1d50a5a78c87a06a269f25fbfc7ff29896d14 (patch)
tree44ad7701af6f733236c159c4af2013f131e90322 /gcc/fortran/options.c
parent377949813aecca7f8c1ede0c28d3de708eb5d06a (diff)
downloadgcc-f4d1d50a5a78c87a06a269f25fbfc7ff29896d14.tar.gz
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-06 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * array.c (gfc_match_array_spec): Add error for -fcoarray=none. * match.c (gfc_match_critical, sync_statement): Ditto. * gfortran.h (gfc_fcoarray): New enum. (gfc_option_t): Use it. * lang.opt (fcoarray): Add new flag. * invoke.texi (fcoarray): Document it. * options.c (gfc_init_options,gfc_handle_option): Handle * -fcoarray=. (gfc_handle_coarray_option): New function. 2010-04-06 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_2.f90: Add dg-options -fcoarray=single. * gfortran.dg/coarray_3.f90: Ditto. * gfortran.dg/coarray_4.f90: Ditto. * gfortran.dg/coarray_5.f90: Ditto. * gfortran.dg/coarray_6.f90: Ditto. * gfortran.dg/coarray_7.f90: Ditto. * gfortran.dg/coarray_8.f90: Ditto. * gfortran.dg/coarray_9.f90: New -fcoarray=none test. From-SVN: r158016
Diffstat (limited to 'gcc/fortran/options.c')
-rw-r--r--gcc/fortran/options.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 0ad87f4e0e6..676bbe125bd 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -130,6 +130,7 @@ gfc_init_options (unsigned int argc, const char **argv)
gfc_option.fpe = 0;
gfc_option.rtcheck = 0;
+ gfc_option.coarray = GFC_FCOARRAY_NONE;
/* Argument pointers cannot point to anything but their argument. */
flag_argument_noalias = 3;
@@ -480,6 +481,18 @@ gfc_handle_fpe_trap_option (const char *arg)
static void
+gfc_handle_coarray_option (const char *arg)
+{
+ if (strcmp (arg, "none") == 0)
+ gfc_option.coarray = GFC_FCOARRAY_NONE;
+ else if (strcmp (arg, "single") == 0)
+ gfc_option.coarray = GFC_FCOARRAY_SINGLE;
+ else
+ gfc_fatal_error ("Argument to -fcoarray is not valid: %s", arg);
+}
+
+
+static void
gfc_handle_runtime_check_option (const char *arg)
{
int result, pos = 0, n;
@@ -931,6 +944,9 @@ gfc_handle_option (size_t scode, const char *arg, int value)
gfc_handle_runtime_check_option (arg);
break;
+ case OPT_fcoarray_:
+ gfc_handle_coarray_option (arg);
+ break;
}
return result;