[Bug fortran/93497] ICE in gfc_conv_array_constructor_expr, at fortran/trans-expr.c:7594
sgk at troutmask dot apl.washington.edu
gcc-bugzilla@gcc.gnu.org
Thu Feb 6 02:06:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93497
--- Comment #3 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Thu, Feb 06, 2020 at 02:01:21AM +0000, kargl at gcc dot gnu.org wrote:
>
> Index: gcc/fortran/decl.c
> ===================================================================
> --- gcc/fortran/decl.c (revision 280157)
> +++ gcc/fortran/decl.c (working copy)
> @@ -1056,6 +1072,11 @@ char_len_param_value (gfc_expr **expr, bool *deferred)
>
> if (!gfc_expr_check_typed (*expr, gfc_current_ns, false))
> return MATCH_ERROR;
> +
> + /* If gfortran gets an EXPR_OP, try to reduce it. This catches things
> + like CHARACTER(([1])). */
> + if ((*expr)->expr_type == EXPR_OP)
> + gfc_reduce_init_expr (*expr);
>
Another possibility to fix the bug is to use gfc_expr_walker
from frontend-passes.c to check if the expression has an array
result. Don't know how to do that.
More information about the Gcc-bugs
mailing list