From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23208 invoked by alias); 6 Sep 2008 19:16:08 -0000 Received: (qmail 22353 invoked by uid 48); 6 Sep 2008 19:14:47 -0000 Date: Sat, 06 Sep 2008 19:16:00 -0000 Message-ID: <20080906191447.22352.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/34199] segfault for TRANSFER integer to TYPE(C_PTR) In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "dominiq at lps dot ens dot fr" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-09/txt/msg00765.txt.bz2 ------- Comment #8 from dominiq at lps dot ens dot fr 2008-09-06 19:14 ------- Extracted from http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/c553e0034bab977c the following code 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 gives with trunk and 4.3.2 pr34199_3.f90:7: internal compiler error: Bus error Please submit a full bug report, -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34199