This is the mail archive of the 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]

ICE on invalid on function used as variable

Calling a function without the trailing () causes an ICE in gfortran 4.7.0
(r180805). For example:

module Test_Mod
  implicit none


  double precision function Func1()
    implicit none
  end function Func1

  double precision function Func2(arg1)
    implicit none
    double precision, intent(in) :: arg1
  end function Func2

end module Test_Mod

$ gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.7/configure --prefix=/usr/local/gcc-4.7
--enable-languages=c,c++,fortran --disable-multilib
Thread model: posix
gcc version 4.7.0 20111102 (experimental) (GCC) 

$ gfortran -c test.F90 -o test.o
test.F90: In function âfunc1â:
test.F90:7:0: error: invalid types in conversion to floating point
real(kind=8) (*<T44f>) (real(kind=8) & restrict)
__result_func1.0 = (real(kind=8)) func2;

test.F90:7:0: internal compiler error: verify_gimple failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <> for instructions.

Adding () to the call to Func2 correctly results in an error being reported.

This bug seems similar to Bug 40678 which was present in 4.1, 
4.2 and 4.3 but went away in 4.4 and 4.5 (not sure about 4.6).

I've opened a PR for this:



* Andrew Benson:

* Galacticus:

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