http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46842
Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jvdelisle at gcc dot | |gnu.org --- Comment #24 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2010-12-11 17:12:38 UTC --- The case in 12 is a different bug and not a regression. How about this variation for this PR and get this one closed? Index: trans-array.c =================================================================== --- trans-array.c (revision 167624) +++ trans-array.c (working copy) @@ -5293,6 +5293,16 @@ get_array_charlen (gfc_expr *expr, gfc_se *se) } } +/* Helper function to check dimensions. */ +static bool +dim_ok (gfc_ss_info *info) +{ + int n; + for (n = 0; n < info->dimen; n++) + if (info->dim[n] != n) + return false; + return true; +} /* Convert an array for passing as an actual argument. Expressions and vector subscripts are evaluated and stored in a temporary, which is then @@ -5588,7 +5598,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * desc = loop.temp_ss->data.info.descriptor; } - else if (expr->expr_type == EXPR_FUNCTION) + else if (expr->expr_type == EXPR_FUNCTION && dim_ok (info)) { desc = info->descriptor; se->string_length = ss->string_length;