public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/50974] New: ICE on invalid on function used as variable
@ 2011-11-03  5:19 abenson at caltech dot edu
  2011-11-03  8:25 ` [Bug fortran/50974] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: abenson at caltech dot edu @ 2011-11-03  5:19 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50974

             Bug #: 50974
           Summary: ICE on invalid on function used as variable
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: abenson@caltech.edu


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

module Test_Mod
  implicit none
  private

contains

  double precision function Func1()
    implicit none
    Func1=Func2
    return
  end function Func1

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

end module Test_Mod

$ gfortran -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc-4.7/bin/gfortran
COLLECT_LTO_WRAPPER=/usr/local/gcc-4.7/libexec/gcc/i686-pc-linux-gnu/4.7.0/lto-wrapper
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)
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 <http://gcc.gnu.org/bugs.html> for instructions.

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

This bug seems similar to Bug 40678
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=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).


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-03 15:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-03  5:19 [Bug fortran/50974] New: ICE on invalid on function used as variable abenson at caltech dot edu
2011-11-03  8:25 ` [Bug fortran/50974] " rguenth at gcc dot gnu.org
2011-11-03 14:56 ` [Bug fortran/50974] [4.7 regression] " kargl at gcc dot gnu.org
2011-11-03 15:03 ` [Bug fortran/50974] " kargl at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).