public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "valeryweber at hotmail dot com" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-60302-4@http.gcc.gnu.org/bugzilla/> (raw)

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 <http://source.android.com/source/report-bugs.html> 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


             reply	other threads:[~2014-02-21 14:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-21 14:58 valeryweber at hotmail dot com [this message]
2014-02-21 15:13 ` [Bug fortran/60302] [4.9 Regression] " dominiq at lps dot ens.fr
2014-02-21 19:25 ` janus at gcc dot gnu.org
2014-02-21 19:47 ` janus at gcc dot gnu.org
2014-02-21 20:19 ` pault at gcc dot gnu.org
2014-02-21 22:29 ` burnus at gcc dot gnu.org
2014-02-21 22:55 ` janus at gcc dot gnu.org
2014-02-21 22:59 ` janus at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-60302-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).