public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/32797]  New: [ISO C Binding] Internal Error: gfc_basic_typename(): Undefined type
@ 2007-07-17 18:09 burnus at gcc dot gnu dot org
  2007-07-23  9:32 ` [Bug fortran/32797] " burnus at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-07-17 18:09 UTC (permalink / raw)
  To: gcc-bugs

The following - valid? - program produces an ICE in gfortran.

Full program: http://atom.princeton.edu/donev/Fortran/DLL/dlfcn.f90
(Should be checked after the problem in the snippet below has been fixed.)


END MODULE ISO_C_UTILITIES
                         1
Internal Error at (1):
gfc_basic_typename(): Undefined type

(This snippet compiles with g95 and NAG f95, however, the generated C code of
NAG f95 does not compile with gcc ["In function
'iso_c_utilities_MP_c_f_string': conflicting types for 'strlen'"].)


MODULE ISO_C_UTILITIES
   USE ISO_C_BINDING
   implicit none
   CHARACTER(C_CHAR), DIMENSION(1), SAVE, TARGET, PRIVATE :: dummy_string="?"
CONTAINS
   FUNCTION C_F_STRING(CPTR) RESULT(FPTR)
      TYPE(C_PTR), INTENT(IN) :: CPTR ! The C address
      CHARACTER(KIND=C_CHAR), DIMENSION(:), POINTER :: FPTR
      INTERFACE
         FUNCTION strlen(string) RESULT(len) BIND(C,NAME="strlen")
            USE ISO_C_BINDING
            TYPE(C_PTR), VALUE :: string ! A C pointer
         END FUNCTION
      END INTERFACE
      CALL C_F_POINTER(FPTR=FPTR, CPTR=CPTR, SHAPE=[strlen(CPTR)])
   END FUNCTION
END MODULE ISO_C_UTILITIES


-- 
           Summary: [ISO C Binding] Internal Error: gfc_basic_typename():
                    Undefined type
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org
OtherBugsDependingO 32630
             nThis:


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


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

end of thread, other threads:[~2007-07-23 17:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-17 18:09 [Bug fortran/32797] New: [ISO C Binding] Internal Error: gfc_basic_typename(): Undefined type burnus at gcc dot gnu dot org
2007-07-23  9:32 ` [Bug fortran/32797] " burnus at gcc dot gnu dot org
2007-07-23 17:47 ` burnus at gcc dot gnu dot org
2007-07-23 17:52 ` burnus at gcc dot gnu dot 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).