------- Comment #11 from kargl at gcc dot gnu dot org  2009-12-30 00:44 -------
The following patch "cures" the segfault but it sure feels like an ugly hack.
Note cut-n-paste tab corruption is likely.


troutmask:sgk[212] svn diff interface.c
Index: interface.c
===================================================================
--- interface.c (revision 155486)
+++ interface.c (working copy)
@@ -1700,7 +1700,9 @@ get_expr_storage_size (gfc_expr *e)
          {
            if (ref->u.ar.as->lower[i] && ref->u.ar.as->upper[i]
                && ref->u.ar.as->lower[i]->expr_type == EXPR_CONSTANT
-               && ref->u.ar.as->upper[i]->expr_type == EXPR_CONSTANT)
+               && ref->u.ar.as->lower[i]->ts.type == BT_INTEGER
+               && ref->u.ar.as->upper[i]->expr_type == EXPR_CONSTANT
+               && ref->u.ar.as->upper[i]->ts.type == BT_INTEGER)
              elements *= mpz_get_si (ref->u.ar.as->upper[i]->value.integer)
                          - mpz_get_si (ref->u.ar.as->lower[i]->value.integer)
                          + 1L;


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36192

Reply via email to