This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/51993] Erroneous type component initialization leads to internal compiler error
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 29 Oct 2015 12:34:13 +0000
- Subject: [Bug fortran/51993] Erroneous type component initialization leads to internal compiler error
- Auto-submitted: auto-generated
- References: <bug-51993-4 at http dot gcc dot gnu dot org/bugzilla/>
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.