[Patch, fortran, PR44672, v6] [F08] ALLOCATE with SOURCE and no array-spec

Andre Vehreschild vehre@gmx.de
Wed Jun 3 15:09:00 GMT 2015


Hi,

no, I lost patience with this. Attached is the last version of this patch I will
provide. I have changed some things to fix the issues needed for
allocate_with_source_3.f90 (now called allocate_with_source_8.f08) to run. The
fix implies that source=[type_constructor(...)] generate a zero-bound array,
which is not correct according to the standard, but I can't do anything about
it you will like.

> I have thought some more about the code not distinguishing source vs mold.
> It seems to me that it makes sense to _not_ distinguish, and what you do
> with e3_is == E3_MOLD seems bogus to me.  For example:
> 
> > @@ -5391,6 +5398,12 @@ gfc_trans_allocate (gfc_code * code)
> >  	}
> >        gcc_assert (expr3_esize);
> >        expr3_esize = fold_convert (sizetype, expr3_esize);
> > +      if (e3_is == E3_MOLD)
> > +	{
> > +	  /* The expr3 is no longer valid after this point.  */
> > +	  expr3 = NULL_TREE;
> > +	  e3_is = E3_UNSET;
> > +	}
> >      }
> >    else if (code->ext.alloc.ts.type != BT_UNKNOWN)
> >      {
> You forget about the descriptor you have just created?!?

+      e3_is = expr3 != NULL_TREE ?
+	    (code->ext.alloc.arr_spec_from_expr3 ?
+	       E3_DESC
+	     : (code->expr3->mold ? E3_MOLD : E3_SOURCE))
+	  : E3_UNSET;

No, a E3_DESC is set before a E3_MOLD, therefore the reset in the chunk above
is not triggered.

I can't spend more resources on this. When you see the need of changes, you are
welcome to add them. 

- Andre
-- 
Andre Vehreschild * Email: vehre ad gmx dot de 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr44672_8.patch
Type: text/x-patch
Size: 26673 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20150603/3fbf286e/attachment.bin>


More information about the Fortran mailing list