From fef8962802d6a69b56eb31aba37b7c841a992ef6 Mon Sep 17 00:00:00 2001 From: Mikael Morin Date: Tue, 18 Oct 2011 15:17:29 +0000 Subject: re PR fortran/50420 ([Coarray] lcobound doesn't accept coarray subcomponents) PR fortran/50420 * trans.c (gfc_build_array_ref): If type is not an array, check that there is nothing to do, and do nothing. From-SVN: r180152 --- gcc/fortran/trans.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/trans.c') diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index 0176aec..88bd389 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -323,7 +323,14 @@ gfc_build_array_ref (tree base, tree offset, tree decl) return fold_convert (TYPE_MAIN_VARIANT (type), base); } - gcc_assert (TREE_CODE (type) == ARRAY_TYPE); + /* Scalar coarray, there is nothing to do. */ + if (TREE_CODE (type) != ARRAY_TYPE) + { + gcc_assert (decl == NULL_TREE); + gcc_assert (integer_zerop (offset)); + return base; + } + type = TREE_TYPE (type); if (DECL_P (base)) -- cgit v1.1