aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-intrinsic.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2010-01-31 12:05:22 +0000
committerPaul Thomas <pault@gcc.gnu.org>2010-01-31 12:05:22 +0000
commitb7d1d8b460bcc996883f2aa089d49598736620a5 (patch)
treec8dec18636f40d47646ddb667f434ea8cb76305e /gcc/fortran/trans-intrinsic.c
parent9b7b903efdb5a1a1b15c2a5c87618a67c36f82fa (diff)
downloadgcc-b7d1d8b460bcc996883f2aa089d49598736620a5.zip
gcc-b7d1d8b460bcc996883f2aa089d49598736620a5.tar.gz
gcc-b7d1d8b460bcc996883f2aa089d49598736620a5.tar.bz2
re PR fortran/38324 (Wrong lbound given to allocatable components)
2010-01-31 Paul Thomas <pault@gcc.gnu.org> PR fortran/38324 * expr.c (gfc_get_full_arrayspec_from_expr): New function. * gfortran.h : Add prototype for above. * trans-expr.c (gfc_trans_alloc_subarray_assign): New function. (gfc_trans_subcomponent_assign): Call new function to replace the code to deal with allocatable components. * trans-intrinsic.c (gfc_conv_intrinsic_bound): Call gfc_get_full_arrayspec_from_expr to replace existing code. 2010-01-31 Paul Thomas <pault@gcc.gnu.org> PR fortran/38324 * gfortran.dg/alloc_comp_basics_1.f90: Remove option -O2. * gfortran.dg/alloc_comp_bounds_1.f90: New test. From-SVN: r156399
Diffstat (limited to 'gcc/fortran/trans-intrinsic.c')
-rw-r--r--gcc/fortran/trans-intrinsic.c38
1 files changed, 1 insertions, 37 deletions
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index 208a3b5..62bf146 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -838,7 +838,6 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper)
gfc_se argse;
gfc_ss *ss;
gfc_array_spec * as;
- gfc_ref *ref;
arg = expr->value.function.actual;
arg2 = arg->next;
@@ -907,42 +906,7 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper)
ubound = gfc_conv_descriptor_ubound_get (desc, bound);
lbound = gfc_conv_descriptor_lbound_get (desc, bound);
- /* Follow any component references. */
- if (arg->expr->expr_type == EXPR_VARIABLE
- || arg->expr->expr_type == EXPR_CONSTANT)
- {
- as = arg->expr->symtree->n.sym->as;
- for (ref = arg->expr->ref; ref; ref = ref->next)
- {
- switch (ref->type)
- {
- case REF_COMPONENT:
- as = ref->u.c.component->as;
- continue;
-
- case REF_SUBSTRING:
- continue;
-
- case REF_ARRAY:
- {
- switch (ref->u.ar.type)
- {
- case AR_ELEMENT:
- case AR_SECTION:
- case AR_UNKNOWN:
- as = NULL;
- continue;
-
- case AR_FULL:
- break;
- }
- break;
- }
- }
- }
- }
- else
- as = NULL;
+ as = gfc_get_full_arrayspec_from_expr (arg->expr);
/* 13.14.53: Result value for LBOUND