Re: Syntax check for IMPLICIT statement



On Sun, 27 Apr 2008 21:15:11 -0600, "James Van Buskirk" <not_valid@xxxxxxxxxxx> wrote:

-|"James Van Buskirk" <not_valid@xxxxxxxxxxx> wrote in message
-|news:wpmdnYLdJ7wLl4jVnZ2dnUVZ_jednZ2d@xxxxxxxxxxxxxx
-|
-|> As you can see, this program is capable of reproducing the ifort
-|> error but I haven't been able to make a small program that
-|> reproduces the gfortran ICE.
-|
-|I still haven't been able to distill the above-mentioned ICE, but
-|here's a pretty small one:
-|
-|C:\gfortran\clf\startest>type bug1.f90
-|module bug1
-| use ISO_C_BINDING
-| implicit none
-| contains
-| subroutine sub1(x)
-| type(C_PTR) x
-| write(*,'(z16.16)') transfer(x,0_C_INTPTR_T)
-| end subroutine sub1
-| subroutine sub2(x)
-| type(C_FUNPTR) x
-| write(*,'(z16.16)') transfer(x,0_C_INTPTR_T)
-| end subroutine sub2
-|end module bug1
-|
-|program test
-| use bug1
-| implicit none
-| call sub1(transfer(7_C_INTPTR_T,C_NULL_PTR))
-| call sub2(transfer(7_C_INTPTR_T,C_NULL_FUNPTR))
-|end program test

This one fails using g95

Skip

-|
-|C:\gfortran\clf\startest>gfortran bug1.f90 -obug1
-|bug1.f90:7: internal compiler error: Segmentation fault
-|Please submit a full bug report,
-|with preprocessed source if appropriate.
-|See <http://gcc.gnu.org/bugs.html> for instructions.
-|
-|What seems to be getting gfortran down is the TRANSFERs in
-|the actual arguments. Switching to C_LOC for the invocation
-|of sub1 fixes that call up, but for sub2 you have to go all
-|the way to a temporary variable to prevent ICE:
-|
-|C:\gfortran\clf\startest>type bug1a.f90
-|module bug1
-| use ISO_C_BINDING
-| implicit none
-| contains
-| subroutine sub1(x)
-| type(C_PTR) x
-| write(*,'(z16.16)') transfer(x,0_C_INTPTR_T)
-| end subroutine sub1
-| subroutine sub2(x)
-| type(C_FUNPTR) x
-| write(*,'(z16.16)') transfer(x,0_C_INTPTR_T)
-| end subroutine sub2
-| subroutine sub3() bind(C)
-| end subroutine sub3
-|end module bug1
-|
-|program test
-| use bug1
-| implicit none
-| integer, target :: i
-| type(C_FUNPTR) p
-|
-| p = C_FUNLOC(sub3)
-| call sub1(C_LOC(i))
-| call sub2(C_FUNLOC(sub3)) ! Causes ICE
-| call sub2(p) ! No ICE
-|end program test
-|
-|C:\gfortran\clf\startest>gfortran bug1a.f90 -obug1a
-|bug1a.f90: In function 'test':
-|bug1a.f90:25: internal compiler error: in expand_expr_addr_expr_1, at
-|expr.c:680
-|3
-|Please submit a full bug report,
-|with preprocessed source if appropriate.
-|See <http://gcc.gnu.org/bugs.html> for instructions.

.



Relevant Pages

  • Re: Syntax check for IMPLICIT statement
    ... reproduces the gfortran ICE. ... end subroutine sub1 ... end module bug1 ... end program test ...
    (comp.lang.fortran)
  • Re: C Fortran mixing languages
    ... CVF generates _ice as object name no matter what case is used ... in subroutine ICE's name ...
    (comp.lang.fortran)
  • Re: LEN() of unallocated array
    ... > Now, AFAIK, the above subroutine is legal Fortran; ... > end program test ... CVF compiles above ok, but has a runtime access error on execution. ... allocate ) ...
    (comp.lang.fortran)
  • Re: Conditional Variable Type Declarations
    ... subroutine ReadData(ioUnit, keywordDimens, int_vector, string_vector) ... end program test ... this is provided by placing Readdata in a module in the above example. ...
    (comp.lang.fortran)
  • Re: Modifying subroutine or function arguments
    ... end program test ... subroutine do ... Specify the INTENT for all applicable arguments. ... I don't have gfortran handily ...
    (comp.lang.fortran)