This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [libgfortran] Change complex type letter to 'z'
- From: Feng Wang <wf_cs at yahoo dot com>
- To: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- Cc: fortran <fortran at gcc dot gnu dot org>, patch <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 27 Dec 2003 21:26:26 +0800 (CST)
- Subject: Re: [libgfortran] Change complex type letter to 'z'
--- Steve Kargl <sgk@troutmask.apl.washington.edu> 的正文:> On Sat, Dec 27,
2003 at 03:10:33PM +0800, Feng Wang wrote:
> > The patch has been flooded with the integer tide. I have to pull it out
> > myself :-o How about it on earth, Paul, Steven and Toon? The advancing
> complex
> > bug fixing need this patch.
> >
> > r~
> > Feng Wang
> >
> > --- Feng Wang <wf_cs@yahoo.com> writing??
> > > Hi, all
> > > The front end of fortran uses 'z' as the complex type letter. But
> > > libgfortran
> > > uses 'c'and this will cause link error. This patch fixes this.
> > > The libgfortran ChangeLog entry:
> > > 2003-12-16 Feng Wang <fengwang@nudt.edu.cn>
> >
>
> Your patch, IMHO, is perfectly backwards. Complex is
> spelled with a "c" not a "z".
gfc_type_letter() in intrinsic.c returnes 'z' to BT_COMPLEX. This is used by
iresolve functions to form the name of functions to call the library function.
Howerver the libgfortran use 'c' as the complex type letter. This cause to link
error.
Does your gfortran pass the test program?
! Program to test the MATMUL intrinsic
program intrinsic_matmul
implicit none
integer, dimension(2, 3) :: a
complex, dimension(3, 2) :: c
complex, dimension(2, 2) :: z
a = reshape((/1, 2, 2, 3, 3, 4/), (/2, 3/))
c = reshape((/(1.0, 2.0), (2.0, 3.0), (3.0, 4.0), (4.0, 5.0), (5.0, 6.0), &
(6.0, 7.0)/), (/3,2/))
z = matmul(a, c)
if (any(z .ne. reshape((/(14.0, 20.0), (20.0, 29.0), (32.0, 38.0),&
(47.0, 56.0)/), (/2, 2/)))) call abort
end program
>
> --
> Steve
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com