[Bug fortran/104330] ICE in gfc_simplify_image_index, at fortran/simplify.cc:8294
anlauf at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Oct 17 20:24:36 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104330
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |anlauf at gcc dot gnu.org
--- Comment #3 from anlauf at gcc dot gnu.org ---
(In reply to kargl from comment #2)
> NULL pointer dereference. This fixes the ICE. Don't know if the compiled
> code is correct. I don't have CLASS in my codes.
>
> diff --git a/gcc/fortran/simplify.cc b/gcc/fortran/simplify.cc
> index 233cc42137f..542c8cb5537 100644
> --- a/gcc/fortran/simplify.cc
> +++ b/gcc/fortran/simplify.cc
> @@ -8295,7 +8295,7 @@ gfc_simplify_image_index (gfc_expr *coarray, gfc_expr
> *sub)
> if (ref->type == REF_COMPONENT)
> as = ref->u.ar.as;
>
> - if (as->type == AS_DEFERRED)
> + if (!as || as->type == AS_DEFERRED)
> return NULL;
>
> /* "valid sequence of cosubscripts" are required; thus, return 0 unless
Steve,
I think it is obvious that we cannot simplify IMAGE_INDEX here.
If you don't object, I will commit your fix for you as obvious.
More information about the Gcc-bugs
mailing list