[Bug fortran/32937] segfault with string and -fdefault-integer-8

fxcoudert at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Aug 11 11:17:00 GMT 2007



------- Comment #5 from fxcoudert at gcc dot gnu dot org  2007-08-11 11:17 -------
Hurray! It's been my wildest gdb session since a very long time (two sessions
of two hours each), but I've made it at last! My analysis in the previous
comment was right, we are generating a charlen's backend_decl with a wrong
type, which is fixed by:

Index: trans-array.c
===================================================================
--- trans-array.c       (revision 127334)
+++ trans-array.c       (working copy)
@@ -4547,9 +4547,7 @@ gfc_conv_expr_descriptor (gfc_se * se, g
          else if (expr->ts.cl->length
                     && expr->ts.cl->length->expr_type == EXPR_CONSTANT)
            {
-             expr->ts.cl->backend_decl
-               = gfc_conv_mpz_to_tree (expr->ts.cl->length->value.integer,
-                                       expr->ts.cl->length->ts.kind);
+             gfc_conv_const_charlen (expr->ts.cl);
              loop.temp_ss->data.temp.type
                = gfc_typenode_for_spec (&expr->ts);
              loop.temp_ss->string_length

(we even have a function ready for that case, mind you). I'm regtesting, and
I'll commit as obvious shortly after.

/me goes for a shower and an afternoon far away from gdb


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
   Target Milestone|---                         |4.3.0


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



More information about the Gcc-bugs mailing list