diff options
author | Mikael Morin <mikael@gcc.gnu.org> | 2010-09-09 13:25:07 +0000 |
---|---|---|
committer | Mikael Morin <mikael@gcc.gnu.org> | 2010-09-09 13:25:07 +0000 |
commit | ea5e803f5d4270439e1cfdae8525c108cd7841ae (patch) | |
tree | d60d58da74620f3332da4110ac15e9fa4c5069bd /gcc/fortran/trans-array.c | |
parent | 4b6133ea8b7a4db9e69e7a72459aa7e754b8c596 (diff) | |
download | gcc-ea5e803f5d4270439e1cfdae8525c108cd7841ae.zip gcc-ea5e803f5d4270439e1cfdae8525c108cd7841ae.tar.gz gcc-ea5e803f5d4270439e1cfdae8525c108cd7841ae.tar.bz2 |
trans-array.c (gfc_trans_create_temp_array): Assert loop dimension and info dimension are the same.
2010-09-09 Mikael Morin <mikael@gcc.gnu.org>
* trans-array.c (gfc_trans_create_temp_array): Assert loop dimension
and info dimension are the same. Loop over loop dimension.
* trans-stmt.c (gfc_conv_elemental_dependencies): Set loop dimension
Co-Authored-By: Janus Weil <janus@gcc.gnu.org>
From-SVN: r164090
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r-- | gcc/fortran/trans-array.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 154ecc4..59b5531 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -742,6 +742,7 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post, int dim; gcc_assert (info->dimen > 0); + gcc_assert (loop->dimen == info->dimen); if (gfc_option.warn_array_temp && where) gfc_warning ("Creating array temporary at %L", where); @@ -793,17 +794,17 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post, or_expr = NULL_TREE; - /* If there is at least one null loop->to[n], it is a callee allocated + /* If there is at least one null loop->to[n], it is a callee allocated array. */ - for (n = 0; n < info->dimen; n++) + for (n = 0; n < loop->dimen; n++) if (loop->to[n] == NULL_TREE) { size = NULL_TREE; break; } - for (n = 0; n < info->dimen; n++) - { + for (n = 0; n < loop->dimen; n++) + { dim = info->dim[n]; if (size == NULL_TREE) |