This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/51993] Erroneous type component initialization leads to internal compiler error


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

--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Changing the gcc_assert to an early return gives ...

Confirmed with the patch

--- ../_clean/gcc/fortran/decl.c        2015-10-27 18:14:22.000000000 +0100
+++ gcc/fortran/decl.c  2015-10-29 12:02:02.000000000 +0100
@@ -1293,7 +1293,9 @@ gfc_set_constant_character_len (int len,
   int slen;

   gcc_assert (expr->expr_type == EXPR_CONSTANT);
-  gcc_assert (expr->ts.type == BT_CHARACTER);
+  /* gcc_assert (expr->ts.type == BT_CHARACTER); */
+  if (expr->ts.type != BT_CHARACTER)
+    return;

   slen = expr->value.character.length;
   if (len != slen)

No regression.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]