public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/50659] New: ICE on invalid with procedure interface
@ 2011-10-07 17:20 abenson at caltech dot edu
  2011-10-07 18:23 ` [Bug fortran/50659] [F03] " janus at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: abenson at caltech dot edu @ 2011-10-07 17:20 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50659
           Summary: ICE on invalid with procedure interface
    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


:: arrSize
end module Size_Mod

module Test_Mod
!  use Size_Mod !! Works if module used here.
  implicit none
  private
  public :: Init, Proc1

contains

  subroutine Init(Proc_Get)
    implicit none
    procedure(Proc1), pointer, intent(inout) :: Proc_Get

    return
  end subroutine Init

  function Proc1(arg1) result (res)
    use Size_Mod !! Fails if module used here.
    implicit none
    double precision, dimension(arrSize) :: res
    double precision, intent(in) :: arg1

    return
  end function Proc1

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 20111007 (experimental) (GCC)

$ gfortran -c test.F90 -o test.o
f951: internal compiler error: in replace_symbol, at fortran/expr.c:4155
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

The code is presumably invalid, because the "arrSize" variable (defined in 
Size_Mod) isn't in scope where Proc1 is used as a procedure interface - moving 
the "use Size_Mod" so that "arrSize" is in scope throughout the "Test_Mod" 
module makes the ICE go away.

The ICE also seems to occur in 4.6.1.

Interestingly, 4.4.5 compiles without complaint, unless I remove "Proc1" from 
the "public" statement in which case it instead complains "Error: Interface 
'proc1' of procedure 'proc_get' at (1) must be explicit". My understanding is 
that Proc1 should have an explicit interface as it's in a module.


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

end of thread, other threads:[~2011-10-20 12:37 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-07 17:20 [Bug fortran/50659] New: ICE on invalid with procedure interface abenson at caltech dot edu
2011-10-07 18:23 ` [Bug fortran/50659] [F03] " janus at gcc dot gnu.org
2011-10-07 18:46 ` janus at gcc dot gnu.org
2011-10-07 19:33 ` janus at gcc dot gnu.org
2011-10-07 20:37 ` janus at gcc dot gnu.org
2011-10-07 20:43 ` [Bug fortran/50659] [4.5/4.6/4.7 Regression] " janus at gcc dot gnu.org
2011-10-07 23:06 ` janus at gcc dot gnu.org
2011-10-08 10:49 ` [Bug fortran/50659] [4.5/4.6/4.7 Regression] [F03] ICE with PROCEDURE statement janus at gcc dot gnu.org
2011-10-08 10:55 ` dominiq at lps dot ens.fr
2011-10-08 11:12 ` [Bug fortran/50659] [4.4/4.5/4.6/4.7 " janus at gcc dot gnu.org
2011-10-08 11:20 ` janus at gcc dot gnu.org
2011-10-08 15:09 ` janus at gcc dot gnu.org
2011-10-09 11:34 ` janus at gcc dot gnu.org
2011-10-10 11:31 ` rguenth at gcc dot gnu.org
2011-10-12 18:54 ` janus at gcc dot gnu.org
2011-10-13 15:04 ` janus at gcc dot gnu.org
2011-10-15 12:16 ` janus at gcc dot gnu.org
2011-10-15 12:18 ` janus at gcc dot gnu.org
2011-10-20 12:37 ` dodji 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).