[Bug fortran/87994] ICE in match_data_constant, at fortran/decl.c:399

kargl at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Nov 14 22:31:00 GMT 2018


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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4

--- Comment #4 from kargl at gcc dot gnu.org ---
Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c  (revision 266155)
+++ gcc/fortran/decl.c  (working copy)
@@ -388,6 +388,13 @@ match_data_constant (gfc_expr **result)
     }
   else if (m == MATCH_YES)
     {
+      /* If a parameter inquiry ends up here, symtree is NULL but **result
+        contains the right constant expression.  Check here.  */
+      if ((*result)->symtree == NULL
+         && (*result)->expr_type == EXPR_CONSTANT
+         && (*result)->ts.type == BT_INTEGER)
+       return m;
+
       /* F2018:R845 data-stmt-constant is initial-data-target.
         A data-stmt-constant shall be ... initial-data-target if and
         only if the corresponding data-stmt-object has the POINTER


More information about the Gcc-bugs mailing list