This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/34199] New: segfault for TRANSFER integer to TYPE(C_PTR)


Found by James Van Buskirk at
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/c8dd08d6da052499/

The following program gives an ICE in transfer; one may argue whether it is
valid or not, but I would expect that it works on all systems.

The crash occurs in:

==28354==    at 0x477713: gfc_interpret_derived (target-memory.c:422)
==28354==    by 0x4773DE: gfc_target_interpret_expr (target-memory.c:474)
==28354==    by 0x46AA47: gfc_simplify_transfer (simplify.c:4103)
==28354==    by 0x42A6A2: do_simplify (intrinsic.c:3186)

which is:
      ptr = TREE_INT_CST_LOW (DECL_FIELD_OFFSET (cmp->backend_decl));

Using NAG f95 and ifort, it works and prints ".FALSE.".


program bug2_transfer
   use ISO_C_BINDING
   implicit none
   type(C_PTR) C_NULL_PTR1

   C_NULL_PTR1 = transfer(0_C_INTPTR_T, C_NULL_PTR1)
!   write(*,'(a)') trim(merge('.TRUE. ','.FALSE.', &
!      C_ASSOCIATED(C_NULL_PTR1)))
end program bug2_transfer


-- 
           Summary: segfault for TRANSFER integer to TYPE(C_PTR)
           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=34199


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