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]

[gfortran] Fix PR 18565


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.


-- 
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]