aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/simplify.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2011-04-18 07:56:05 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2011-04-18 07:56:05 +0200
commit5af0793001c54632a5160a352cfdee6195338314 (patch)
tree4fea0be54c2c3408b2ee50b9961ef7a822c4f87b /gcc/fortran/simplify.c
parent12df8d0150a2f18d7e86a8b0a94cfc4201795c18 (diff)
downloadgcc-5af0793001c54632a5160a352cfdee6195338314.zip
gcc-5af0793001c54632a5160a352cfdee6195338314.tar.gz
gcc-5af0793001c54632a5160a352cfdee6195338314.tar.bz2
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-04-18 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * iresolve.c (gfc_resolve_image_index): Set ts.type. * simplify.c (gfc_simplify_image_index): Don't abort if the * bounds are not known at compile time and handle -fcoarray=lib. * trans-intrinsics.c (gfc_conv_intrinsic_function): Handle IMAGE_INDEX. (conv_intrinsic_cobound): Fix comment typo. (trans_this_image): New function. * trans-array.c (gfc_unlikely): Move to trans.c. * trans.c (gfc_unlikely): Function moved from trans-array.c. (gfc_trans_runtime_check): Use it. * trans-io.c (gfc_trans_io_runtime_check): Ditto. * trans.h (gfc_unlikely): Add prototype. 2011-04-18 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_16.f90: New. From-SVN: r172637
Diffstat (limited to 'gcc/fortran/simplify.c')
-rw-r--r--gcc/fortran/simplify.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index abc3383..b744a21 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -6189,7 +6189,7 @@ gfc_simplify_image_index (gfc_expr *coarray, gfc_expr *sub)
int d;
if (!is_constant_array_expr (sub))
- goto not_implemented; /* return NULL;*/
+ return NULL;
/* Follow any component references. */
as = coarray->symtree->n.sym->as;
@@ -6198,7 +6198,7 @@ gfc_simplify_image_index (gfc_expr *coarray, gfc_expr *sub)
as = ref->u.ar.as;
if (as->type == AS_DEFERRED)
- goto not_implemented; /* return NULL;*/
+ return NULL;
/* "valid sequence of cosubscripts" are required; thus, return 0 unless
the cosubscript addresses the first image. */
@@ -6221,7 +6221,7 @@ gfc_simplify_image_index (gfc_expr *coarray, gfc_expr *sub)
ca_bound = simplify_bound_dim (coarray, NULL, d + as->rank, 0, as,
NULL, true);
if (ca_bound == NULL)
- goto not_implemented; /* return NULL */
+ return NULL;
if (ca_bound == &gfc_bad_expr)
return ca_bound;
@@ -6285,6 +6285,10 @@ gfc_simplify_image_index (gfc_expr *coarray, gfc_expr *sub)
return &gfc_bad_expr;
}
+
+ if (gfc_option.coarray != GFC_FCOARRAY_SINGLE && !first_image)
+ return NULL;
+
result = gfc_get_constant_expr (BT_INTEGER, gfc_default_integer_kind,
&gfc_current_locus);
if (first_image)
@@ -6293,11 +6297,6 @@ gfc_simplify_image_index (gfc_expr *coarray, gfc_expr *sub)
mpz_set_si (result->value.integer, 0);
return result;
-
-not_implemented:
- gfc_error ("Not yet implemented: IMAGE_INDEX for coarray with non-constant "
- "cobounds at %L", &coarray->where);
- return &gfc_bad_expr;
}