diff options
author | Mikael Morin <mikael@gcc.gnu.org> | 2011-10-18 15:17:29 +0000 |
---|---|---|
committer | Mikael Morin <mikael@gcc.gnu.org> | 2011-10-18 15:17:29 +0000 |
commit | fef8962802d6a69b56eb31aba37b7c841a992ef6 (patch) | |
tree | 8be28509d40dae1897e69d8ad9ae23b70edfa848 /gcc | |
parent | 49b804d0ea34e091ad19dfbb4d3d04c7a0112f0e (diff) | |
download | gcc-fef8962802d6a69b56eb31aba37b7c841a992ef6.zip gcc-fef8962802d6a69b56eb31aba37b7c841a992ef6.tar.gz gcc-fef8962802d6a69b56eb31aba37b7c841a992ef6.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/trans.c | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f8105b1..f7a793f 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,6 +1,12 @@ 2011-10-18 Mikael Morin <mikael@gcc.gnu.org> 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. + +2011-10-18 Mikael Morin <mikael@gcc.gnu.org> + + PR fortran/50420 * trans-types.c (gfc_build_array_type): Don't force lower bound to one in the deferred case. 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)) |