aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMikael Morin <mikael@gcc.gnu.org>2011-11-03 21:21:30 +0000
committerMikael Morin <mikael@gcc.gnu.org>2011-11-03 21:21:30 +0000
commit36e783e3824427f779f293a991ea97a4d7782588 (patch)
treef843134839a71a6ca6b42da7d516d1e90468cbb2 /gcc
parenta13d9afef7fc87c6ddd4420192370531ee02524c (diff)
downloadgcc-36e783e3824427f779f293a991ea97a4d7782588.zip
gcc-36e783e3824427f779f293a991ea97a4d7782588.tar.gz
gcc-36e783e3824427f779f293a991ea97a4d7782588.tar.bz2
trans-array.c (gfc_trans_array_bound_check, [...]): Rename the former to the latter.
* trans-array.c (gfc_trans_array_bound_check, trans_array_bound_check): Rename the former to the latter. Replace descriptor argument with ss argument. Get descriptor from ss. (gfc_conv_array_index_offset, conv_array_index_offset): Rename the former to the latter. Update call to trans_array_bound_check. Replace info argument with ss argument. Get info from ss. (gfc_conv_scalarized_array_ref): Update call to conv_array_index_offset. (add_array_offset): Ditto From-SVN: r180857
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog11
-rw-r--r--gcc/fortran/trans-array.c33
2 files changed, 29 insertions, 15 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 2401c18..f264095 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,16 @@
2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+ * trans-array.c (gfc_trans_array_bound_check,
+ trans_array_bound_check): Rename the former to the latter.
+ Replace descriptor argument with ss argument. Get descriptor from ss.
+ (gfc_conv_array_index_offset, conv_array_index_offset): Rename the
+ former to the latter. Update call to trans_array_bound_check.
+ Replace info argument with ss argument. Get info from ss.
+ (gfc_conv_scalarized_array_ref): Update call to conv_array_index_offset.
+ (add_array_offset): Ditto
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
* trans-array.c (gfc_trans_constant_array_constructor,
trans_constant_array_constructor): Rename the former to the latter.
Don't set the rank of the temporary for the loop. Remove then unused
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index c39fc9e..45bf683 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -2426,17 +2426,20 @@ gfc_conv_array_ubound (tree descriptor, int dim)
/* Generate code to perform an array index bound check. */
static tree
-gfc_trans_array_bound_check (gfc_se * se, tree descriptor, tree index, int n,
- locus * where, bool check_upper)
+trans_array_bound_check (gfc_se * se, gfc_ss *ss, tree index, int n,
+ locus * where, bool check_upper)
{
tree fault;
tree tmp_lo, tmp_up;
+ tree descriptor;
char *msg;
const char * name = NULL;
if (!(gfc_option.rtcheck & GFC_RTCHECK_BOUNDS))
return index;
+ descriptor = ss->data.info.descriptor;
+
index = gfc_evaluate_now (index, &se->pre);
/* We find a name for the error message. */
@@ -2521,13 +2524,16 @@ gfc_trans_array_bound_check (gfc_se * se, tree descriptor, tree index, int n,
DIM is the array dimension, I is the loop dimension. */
static tree
-gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i,
- gfc_array_ref * ar, tree stride)
+conv_array_index_offset (gfc_se * se, gfc_ss * ss, int dim, int i,
+ gfc_array_ref * ar, tree stride)
{
+ gfc_ss_info *info;
tree index;
tree desc;
tree data;
+ info = &ss->data.info;
+
/* Get the index into the array for this dimension. */
if (ar)
{
@@ -2544,10 +2550,9 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i,
/* We've already translated this value outside the loop. */
index = info->subscript[dim]->data.scalar.expr;
- index = gfc_trans_array_bound_check (se, info->descriptor,
- index, dim, &ar->where,
- ar->as->type != AS_ASSUMED_SIZE
- || dim < ar->dimen - 1);
+ index = trans_array_bound_check (se, ss, index, dim, &ar->where,
+ ar->as->type != AS_ASSUMED_SIZE
+ || dim < ar->dimen - 1);
break;
case DIMEN_VECTOR:
@@ -2574,10 +2579,9 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i,
index = fold_convert (gfc_array_index_type, index);
/* Do any bounds checking on the final info->descriptor index. */
- index = gfc_trans_array_bound_check (se, info->descriptor,
- index, dim, &ar->where,
- ar->as->type != AS_ASSUMED_SIZE
- || dim < ar->dimen - 1);
+ index = trans_array_bound_check (se, ss, index, dim, &ar->where,
+ ar->as->type != AS_ASSUMED_SIZE
+ || dim < ar->dimen - 1);
break;
case DIMEN_RANGE:
@@ -2648,7 +2652,7 @@ gfc_conv_scalarized_array_ref (gfc_se * se, gfc_array_ref * ar)
else
n = 0;
- index = gfc_conv_array_index_offset (se, info, info->dim[n], n, ar,
+ index = conv_array_index_offset (se, se->ss, info->dim[n], n, ar,
info->stride0);
/* Add the offset for this dimension to the stored offset for all other
dimensions. */
@@ -2843,8 +2847,7 @@ add_array_offset (stmtblock_t *pblock, gfc_loopinfo *loop, gfc_ss *ss,
se.loop = loop;
se.expr = info->descriptor;
stride = gfc_conv_array_stride (info->descriptor, array_dim);
- index = gfc_conv_array_index_offset (&se, info, array_dim, loop_dim, ar,
- stride);
+ index = conv_array_index_offset (&se, ss, array_dim, loop_dim, ar, stride);
gfc_add_block_to_block (pblock, &se.pre);
info->offset = fold_build2_loc (input_location, PLUS_EXPR,