[patch, committed] Fix PR22327 (Re: array constructor)

Feng Wang wf_cs@yahoo.com
Thu Jul 7 02:08:00 GMT 2005


Committed as obvious. Diff file is attached.

Regression tested on ia64 and i686 linux.

--- Steve Kargl <sgk@troutmask.apl.washington.edu>дµÀ:

> On Wed, Jul 06, 2005 at 06:18:02PM +0200, Salvatore Filippone wrote:
> > What is going on here? 
> >
> > program test3
> > 
> >   implicit none
> >   integer :: i
> >   i = 9999
> >   write(*,*) 'Test ',(/i,2,3,4,5,i/)
> >   
> > end program test3
> > 
> > [sfilippo@localhost TEMP]$ gfortran -o test3 test3.f90
> > [sfilippo@localhost TEMP]$ ./test3 
> >  Test   9999    2     3   4      5   1151552
> 
> Looks like you've found a bug.  Add -fdump-tree-original to your
> command line.  You'll get a test3.f90.t0.original, which shows
> 
>     (*atmp.0.data)[17] = i;
> 
> Clearly, 17 should be 5.  If I had to guess, it looks like the 1 index
> in the memcpy is added to the number of bytes 16 to get the next array
> index.  Yep.  If I change to (/i,2,3,4,5,6,i).  The 17 becomes 21.
> 
> File a bug report.
> 


Best Regards,
Feng Wang

--
Creative Compiler Research Group,
National University of Defense Technology, China.


	

	
		
___________________________________________________________ 
ÑÅ»¢Ãâ·ÑGÓÊÏ䣭ÖйúµÚÒ»¾øÎÞÀ¬»øÓʼþɧÈų¬´óÓÊÏä
http://cn.mail.yahoo.com/?id=77071
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050707/483c56ab/attachment.ksh>


More information about the Fortran mailing list