https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104330

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |kargl at gcc dot gnu.org
   Last reconfirmed|                            |2022-05-25

--- Comment #2 from kargl at gcc dot gnu.org ---
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

Reply via email to