This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31251] Non-integer character length leads to segfault
- From: "jvdelisle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 May 2007 05:42:23 -0000
- Subject: [Bug fortran/31251] Non-integer character length leads to segfault
- References: <bug-31251-10259@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from jvdelisle at gcc dot gnu dot org 2007-05-04 06:42 -------
I think the problem may be in arith.c (gfc_constant_result). We are passing a
type real into this and so we do not mpz_init (result->value.integer);
Which we later try to set at simplify.c: 2143
mpz_set (result->value.integer, e->ts.cl->length->value.integer);
And it breaks sometimes.
As I said, I can not reproduce the bug, but this is my look into it for what
its worth. You might try this and see what it does:
Index: arith.c
===================================================================
--- arith.c (revision 124405)
+++ arith.c (working copy)
@@ -420,6 +420,7 @@ gfc_constant_result (bt type, int kind,
case BT_REAL:
gfc_set_model_kind (kind);
+ mpz_init (result->value.integer);
mpfr_init (result->value.real);
break;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31251