public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34199]  New: segfault for TRANSFER integer to TYPE(C_PTR)
@ 2007-11-22 21:48 burnus at gcc dot gnu dot org
  2007-11-24 23:03 ` [Bug fortran/34199] " burnus at gcc dot gnu dot org
                   ` (14 more replies)
  0 siblings, 15 replies; 19+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-11-22 21:48 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 19+ messages in thread
[parent not found: <bug-34199-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2010-12-19 11:24 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-22 21:48 [Bug fortran/34199] New: segfault for TRANSFER integer to TYPE(C_PTR) burnus at gcc dot gnu dot org
2007-11-24 23:03 ` [Bug fortran/34199] " burnus at gcc dot gnu dot org
2007-11-25  3:11 ` pinskia at gcc dot gnu dot org
2008-02-24 14:04 ` fxcoudert at gcc dot gnu dot org
2008-02-25 12:09 ` fxcoudert at gcc dot gnu dot org
2008-03-08 19:14 ` fxcoudert at gcc dot gnu dot org
2008-04-28 12:35 ` burnus at gcc dot gnu dot org
2008-05-14 23:24 ` fxcoudert at gcc dot gnu dot org
2008-09-06 19:13 ` dominiq at lps dot ens dot fr
2008-09-06 19:16 ` dominiq at lps dot ens dot fr
2008-09-06 21:17 ` dominiq at lps dot ens dot fr
2009-04-21 16:02 ` jakub at gcc dot gnu dot org
2009-07-22 10:35 ` jakub at gcc dot gnu dot org
2009-10-15 12:53 ` jakub at gcc dot gnu dot org
2010-01-21 13:19 ` jakub at gcc dot gnu dot org
2010-04-30  8:57 ` jakub at gcc dot gnu dot org
     [not found] <bug-34199-4@http.gcc.gnu.org/bugzilla/>
2010-10-01 11:49 ` jakub at gcc dot gnu.org
2010-12-19 10:54 ` dominiq at lps dot ens.fr
2010-12-19 11:24 ` burnus 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).