From 591bb5e4bf6b9a75175b162bcf9d22bcae2b5abf Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Fri, 1 Jan 2016 17:02:51 +0000 Subject: re PR fortran/68864 (ICE: in gfc_get_descriptor_dimension, at fortran/trans-array.c:268) 2016-01-01 Paul Thomas PR fortran/68864 * trans-array.c (evaluate_bound): If deferred, test that 'desc' is an array descriptor before using gfc_conv_descriptor_xxx. 2016-01-01 Paul Thomas PR fortran/68864 * gfortran.dg/pr68864.f90: New test. From-SVN: r232026 --- gcc/fortran/trans-array.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/trans-array.c') diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 71e0482..287b4af 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -3821,10 +3821,10 @@ evaluate_bound (stmtblock_t *block, tree *bounds, gfc_expr ** values, gfc_add_block_to_block (block, &se.pre); *output = se.expr; } - else if (deferred) + else if (deferred && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (desc))) { /* The gfc_conv_array_lbound () routine returns a constant zero for - deferred length arrays, which in the scalarizer wrecks havoc, when + deferred length arrays, which in the scalarizer wreaks havoc, when copying to a (newly allocated) one-based array. Keep returning the actual result in sync for both bounds. */ *output = lbound ? gfc_conv_descriptor_lbound_get (desc, -- cgit v1.1