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: allocate with mold


 
I have confirmed that the reported behavior exists in gfortran 5.4.0 based on the following simplified version of the submitted code:

integer, allocatable :: b(:)  
allocate(b,mold=[1])  
end  

whereas gfortran 6.1.0 compiles the above code without error. I guess the only question is whether this feature can be ported back to the GCC 5 branch.  I see no mention of "mold=“ in the GCC 5 series release notes at https://gcc.gnu.org/gcc-5/changes.html.

Damian


On August 22, 2016 at 11:28:18 AM, B Finney (brad.finney@humboldt.edu(mailto:brad.finney@humboldt.edu)) wrote:

> My understanding (likely wrong) is that the mold= attribute for allocate
> was available in gfortran from (at least) 5.1. The following program
> complied with gfortran version 5.3
>  
> gcc version 5.3.1 20160301 [gcc-5-branch revision 233849] (SUSE Linux)
>  
>  
> results in an error that suggests mold isn't working?
>  
> program allocate_array
> implicit none
> integer, dimension(3,2)::a
> integer, dimension(:,:),allocatable::b
> a=reshape([1,3,5,2,4,6],[3,2])
> allocate(b,mold=a)
> b=a
> end program allocate_array
>  
> allocatearray2.f90:6:11:
>  
> allocate(b,mold=a)
> 1
> Error: Array specification required in ALLOCATE statement at (1)


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