This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: internal compiler error: in fold_convert_loc, at fold-const.c:1899


On 09/06/2010 10:07 PM, Janus Weil wrote:
Thanks. Can you please tell me if this patch fixes the problem for you?

As it fixes Salavatore's issue and PR 45577:


The patch is OK with a test case (Salvatore's or Dominique's from PR 45577) with a changelog and after build + regtest.

Thanks for the quick fix.

Tobias

Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c       (revision 163901)
+++ gcc/fortran/resolve.c       (working copy)
@@ -6727,7 +6727,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code
        if (ts.type == BT_CLASS)
         ts = ts.u.derived->components->ts;

-      if (ts.type == BT_DERIVED)
+      if (ts.type == BT_DERIVED&&  gfc_has_default_initializer(ts.u.derived))
         {
           code->expr3 = gfc_default_initializer (&ts);
           gfc_resolve_expr (code->expr3);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]