This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] |
On Sun, Jan 23, 2005 at 10:14:45AM -0800, Steve Kargl wrote: > The problem is well described in the PR, but I'll summarize here. > The following program is valid Fortran 95. > > program a > complex(8) z > z = (1.d0,1.d0) > print *, conjg(z) > end program a > > Currently, gfortran will resolve conjg() to use the intrinsic > function dconjg(). The problem is that if -std=f95 is given > to gfortran, then dconjg is not included in list of intrinsic > function because it is not a specific name for the generic > function conjg(). > > The attached patch has changed intrinsic.c to use _conjg() as > the double complex version of conjg() for -std=f95 and it > makes dconjg() an alias of _conjg() for -std=gnu. > > Now, with the attached patch and if the above program is > > program a > complex(8) z > z = (1.d0,1.d0) > print *, dconjg(z) > end program a > > kargl[226] gfc -o cg -std=f95 cg.f90 > /var/tmp/ccDKKFVt.o(.text+0x4f): In function `MAIN__': > : undefined reference to `dconjg_' > collect2: ld returned 1 exit status > > which is acceptable because neither "implicit none" nor > "intrinsic dconjg" were used. If either of these statements > are included you get error messages from gfortran. > > 2005-01-23 Steven G. Kargl <kargls@comcast.net> > > PR 18565 > * intrinsic.c (add_function): Change dconjg to _conjg and mark > with GFC_STD_F95; make dcongj an alias of _conjg marked with > GFC_STD_GNU. > All complex(8) intrinsic function that do not have a corresponding specific name were handled wrong if -std=f95 is given on the command line. The attach patch fixes all of these, not just conjg. Bootstrapped and regtested on amd64-*-freebsd 2005-01-27 Steven G. Kargl <kargls@comcast.net> PR 18565 * intrinsic.c (add_function): Permit complex(8) version for generic names without corresponding specific names. -- steve
Attachment:
intrinsic.c.diff
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |