From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7784 invoked by alias); 21 Feb 2014 14:58:01 -0000 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 Received: (qmail 7750 invoked by uid 48); 21 Feb 2014 14:57:56 -0000 From: "valeryweber at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/60302] New: ICE with c_f_pointer and android cross compiler Date: Fri, 21 Feb 2014 14:58:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: valeryweber at hotmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-02/txt/msg02257.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60302 Bug ID: 60302 Summary: ICE with c_f_pointer and android cross compiler Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: valeryweber at hotmail dot com Dear All I get an ICE while cross (android, ndk-toolchains 4.9c) compiling (gcc-trunk) the following code. The problem seems to arises in c_f_pointer. Please let me know if more info is needed. Thanks v cat gcc_reshaper.f90 module reshaper implicit none contains subroutine reshape_inplace_c2_c2(tgt_x, new_shape, ptr_x) use, intrinsic :: iso_c_binding implicit none complex(8), target, intent(in) :: tgt_x(1,*) integer, intent(in) :: new_shape(:) complex(8), pointer, intent(out) :: ptr_x(:,:) type(c_ptr) :: loc_x loc_x = c_loc(tgt_x) call c_f_pointer(loc_x, ptr_x, new_shape) end subroutine reshape_inplace_c2_c2 end module reshaper +++++++++ /home/vwe/libs/gcc/test/tmp2/prefix/bin/arm-linux-androideabi-gfortran -c gcc_reshaper.f90 *** glibc detected *** /home/vwe/libs/gcc/test/tmp2/prefix/libexec/gcc/arm-linux-androideabi/4.9.0/f951: double free or corruption (fasttop): 0x00000000036c5b60 *** ======= Backtrace: ========= /lib64/libc.so.6[0x308147cb3e] /home/vwe/libs/gcc/test/tmp2/prefix/libexec/gcc/arm-linux-androideabi/4.9.0/f951(_Z21gfc_check_c_f_pointerP8gfc_exprS0_S0_+0x191)[0x577c61] /home/vwe/libs/gcc/test/tmp2/prefix/libexec/gcc/arm-linux-androideabi/4.9.0/f951(_Z27gfc_intrinsic_sub_interfaceP8gfc_codei+0xee)[0x5b1dee] /home/vwe/libs/gcc/test/tmp2/prefix/libexec/gcc/arm-linux-androideabi/4.9.0/f951[0x5eef29] /home/vwe/libs/gcc/test/tmp2/prefix/libexec/gcc/arm-linux-androideabi/4.9.0/f951[0x5f3d7d] /home/vwe/libs/gcc/test/tmp2/prefix/libexec/gcc/arm-linux-androideabi/4.9.0/f951[0x5f58df] /home/vwe/libs/gcc/test/tmp2/prefix/libexec/gcc/arm-linux-androideabi/4.9.0/f951[0x5f57e8] /home/vwe/libs/gcc/test/tmp2/prefix/libexec/gcc/arm-linux-androideabi/4.9.0/f951(_Z11gfc_resolveP13gfc_namespace+0x66)[0x5e66b6] /home/vwe/libs/gcc/test/tmp2/prefix/libexec/gcc/arm-linux-androideabi/4.9.0/f951(_Z14gfc_parse_filev+0x29b)[0x5dbd9b] /home/vwe/libs/gcc/test/tmp2/prefix/libexec/gcc/arm-linux-androideabi/4.9.0/f951[0x6199f6] /home/vwe/libs/gcc/test/tmp2/prefix/libexec/gcc/arm-linux-androideabi/4.9.0/f951[0xa21cbc] /home/vwe/libs/gcc/test/tmp2/prefix/libexec/gcc/arm-linux-androideabi/4.9.0/f951(_Z11toplev_mainiPPc+0xa18)[0xa23978] /lib64/libc.so.6(__libc_start_main+0xf5)[0x3081421a05] /home/vwe/libs/gcc/test/tmp2/prefix/libexec/gcc/arm-linux-androideabi/4.9.0/f951[0x56aa99] ======= Memory map: ======== 00400000-01638000 r-xp 00000000 fd:03 7609006 /home/vwe/libs/gcc/test/tmp2/prefix/libexec/gcc/arm-linux-androideabi/4.9.0/f951 01838000-0183e000 r--p 01238000 fd:03 7609006 /home/vwe/libs/gcc/test/tmp2/prefix/libexec/gcc/arm-linux-androideabi/4.9.0/f951 0183e000-0184c000 rw-p 0123e000 fd:03 7609006 /home/vwe/libs/gcc/test/tmp2/prefix/libexec/gcc/arm-linux-androideabi/4.9.0/f951 0184c000-0192d000 rw-p 00000000 00:00 0 03646000-036e6000 rw-p 00000000 00:00 0 [heap] 3080c00000-3080c20000 r-xp 00000000 fd:02 1458068 /usr/lib64/ld-2.16.so 3080e20000-3080e21000 r--p 00020000 fd:02 1458068 /usr/lib64/ld-2.16.so 3080e21000-3080e22000 rw-p 00021000 fd:02 1458068 /usr/lib64/ld-2.16.so 3080e22000-3080e23000 rw-p 00000000 00:00 0 3081400000-30815ad000 r-xp 00000000 fd:02 1458069 /usr/lib64/libc-2.16.so 30815ad000-30817ad000 ---p 001ad000 fd:02 1458069 /usr/lib64/libc-2.16.so 30817ad000-30817b1000 r--p 001ad000 fd:02 1458069 /usr/lib64/libc-2.16.so 30817b1000-30817b3000 rw-p 001b1000 fd:02 1458069 /usr/lib64/libc-2.16.so 30817b3000-30817b8000 rw-p 00000000 00:00 0 3081c00000-3081c03000 r-xp 00000000 fd:02 1458072 /usr/lib64/libdl-2.16.so 3081c03000-3081e02000 ---p 00003000 fd:02 1458072 /usr/lib64/libdl-2.16.so 3081e02000-3081e03000 r--p 00002000 fd:02 1458072 /usr/lib64/libdl-2.16.so 3081e03000-3081e04000 rw-p 00003000 fd:02 1458072 /usr/lib64/libdl-2.16.so 3082000000-3082100000 r-xp 00000000 fd:02 1458079 /usr/lib64/libm-2.16.so 3082100000-30822ff000 ---p 00100000 fd:02 1458079 /usr/lib64/libm-2.16.so 30822ff000-3082300000 r--p 000ff000 fd:02 1458079 /usr/lib64/libm-2.16.so 3082300000-3082301000 rw-p 00100000 fd:02 1458079 /usr/lib64/libm-2.16.so 3082c00000-3082c15000 r-xp 00000000 fd:02 1458080 /usr/lib64/libgcc_s-4.7.2-20121109.so.1 3082c15000-3082e14000 ---p 00015000 fd:02 1458080 /usr/lib64/libgcc_s-4.7.2-20121109.so.1 3082e14000-3082e15000 r--p 00014000 fd:02 1458080 /usr/lib64/libgcc_s-4.7.2-20121109.so.1 3082e15000-3082e16000 rw-p 00015000 fd:02 1458080 /usr/lib64/libgcc_s-4.7.2-20121109.so.1 7fde6cc1d000-7fde6d04d000 rw-p 00000000 00:00 0 7fde6d04d000-7fde6d074000 rw-p 00000000 00:00 0 7fff3e292000-7fff3e2b3000 rw-p 00000000 00:00 0 [stack] 7fff3e329000-7fff3e32b000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] f951: internal compiler error: Aborted 0xa217af crash_signal /home/vwe/libs/gcc/test/android-ndk-r9c/src/build/../gcc/gcc-4.8/gcc/toplev.c:337 0x577c60 gfc_check_c_f_pointer(gfc_expr*, gfc_expr*, gfc_expr*) /home/vwe/libs/gcc/test/android-ndk-r9c/src/build/../gcc/gcc-4.8/gcc/fortran/check.c:3956 0x5b1ded gfc_intrinsic_sub_interface(gfc_code*, int) /home/vwe/libs/gcc/test/android-ndk-r9c/src/build/../gcc/gcc-4.8/gcc/fortran/intrinsic.c:4377 0x5eef28 resolve_unknown_s /home/vwe/libs/gcc/test/android-ndk-r9c/src/build/../gcc/gcc-4.8/gcc/fortran/resolve.c:3252 0x5eef28 resolve_call /home/vwe/libs/gcc/test/android-ndk-r9c/src/build/../gcc/gcc-4.8/gcc/fortran/resolve.c:3370 0x5f3d7c resolve_code /home/vwe/libs/gcc/test/android-ndk-r9c/src/build/../gcc/gcc-4.8/gcc/fortran/resolve.c:9931 0x5f58de resolve_codes /home/vwe/libs/gcc/test/android-ndk-r9c/src/build/../gcc/gcc-4.8/gcc/fortran/resolve.c:14577 0x5f57e7 resolve_codes /home/vwe/libs/gcc/test/android-ndk-r9c/src/build/../gcc/gcc-4.8/gcc/fortran/resolve.c:14563 0x5e66b5 gfc_resolve /home/vwe/libs/gcc/test/android-ndk-r9c/src/build/../gcc/gcc-4.8/gcc/fortran/resolve.c:14605 0x5e66b5 gfc_resolve(gfc_namespace*) /home/vwe/libs/gcc/test/android-ndk-r9c/src/build/../gcc/gcc-4.8/gcc/fortran/resolve.c:14591 0x5dbd9a gfc_parse_file() /home/vwe/libs/gcc/test/android-ndk-r9c/src/build/../gcc/gcc-4.8/gcc/fortran/parse.c:4672 0x6199f5 gfc_be_parse_file /home/vwe/libs/gcc/test/android-ndk-r9c/src/build/../gcc/gcc-4.8/gcc/fortran/f95-lang.c:188 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. +++++++ The cross compiler was build with ./build/tools/build-gcc.sh --build-out=/home/vwe/libs/gcc/test/tmp2 --binutils-version=2.22.90 --mpfr-version=3.1.2 --mpc-version=1.0 --gmp-version=5.1.3 --gdb-version=7.7 --cloog-version=0.18.1 --ppl-version=1.1 --isl-version=0.12 --try-64 /home/vwe/libs/gcc/test/android-ndk-r9c/src /home/vwe/libs/gcc/test/android-ndk-r9c arm-linux-androideabi-4.8