This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran,committed] Fix half or PR31251: segfault in real charlen
- From: "François-Xavier Coudert" <fxcoudert at gmail dot com>
- To: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 4 May 2007 13:10:51 +0200
- Subject: [gfortran,committed] Fix half or PR31251: segfault in real charlen
Committed as obvious after regtesting on i686-linux, since the ICE
doesn't appear on Jerry's system. The other half of the PR (we're
emitting two identical error messages) still needs fixing.
2007-05-04 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/31251
* simplify.c (gfc_simplify_len): Only simplify integer lengths.
Index: simplify.c
===================================================================
--- simplify.c (revision 124412)
+++ simplify.c (working copy)
@@ -2136,14 +2136,15 @@ gfc_simplify_len (gfc_expr *e)
}
if (e->ts.cl != NULL && e->ts.cl->length != NULL
- && e->ts.cl->length->expr_type == EXPR_CONSTANT)
+ && e->ts.cl->length->expr_type == EXPR_CONSTANT
+ && e->ts.cl->length->ts.type == BT_INTEGER)
{
result = gfc_constant_result (BT_INTEGER, gfc_default_integer_kind,
&e->where);
mpz_set (result->value.integer, e->ts.cl->length->value.integer);
return range_check (result, "LEN");
}
-
+
return NULL;
}