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

kargl at gcc dot gnu.org changed:

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

--- Comment #1 from kargl at gcc dot gnu.org ---
An gcc_unreachable() conditional can obviously be reached with invalid code.
Return NULL instead of an ICE.

diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index c9e13b59da9..2c4240c8f0d 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -4411,12 +4411,9 @@ simplify_cobound (gfc_expr *array, gfc_expr *dim,
gfc_expr *kind, int upper)
        }
     }

-  if (!as)
-    gcc_unreachable ();
-
  done:

-  if (as->cotype == AS_DEFERRED || as->cotype == AS_ASSUMED_SHAPE)
+  if (!as || as->cotype == AS_DEFERRED || as->cotype == AS_ASSUMED_SHAPE)
     return NULL;

   if (dim == NULL)

Reply via email to