Extracted from PR 34741 :

$ cat bar.f90
  character, pointer :: ptr(:)
  allocate(ptr(1))
  ptr = transfer('a',ptr)
  end
$ gfortran bar.f90 
f951: internal compiler error: Floating point exception
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ gdb ~/libexec/gcc/i686-pc-linux-gnu/4.3.0/f951 
GNU gdb 6.6.90.20070912-debian
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
Using host libthread_db library "/lib/i686/cmov/libthread_db.so.1".
(gdb) r bar.f90
Starting program: /home/ig25/libexec/gcc/i686-pc-linux-gnu/4.3.0/f951 bar.f90

Program received signal SIGFPE, Arithmetic exception.
0x080b1855 in gfc_simplify_transfer (source=0x89b5478, mold=0x89b54e8, 
    size=0x0) at ../../../gcc/trunk/gcc/fortran/simplify.c:4140
4140              result_length = source_size / result_elt_size;
(gdb) p result_elt_size 
$1 = 0
(gdb) bt
#0  0x080b1855 in gfc_simplify_transfer (source=0x89b5478, mold=0x89b54e8, 
    size=0x0) at ../../../gcc/trunk/gcc/fortran/simplify.c:4140
#1  0x08071189 in do_simplify (specific=0x899faa0, e=0x89b5408)
    at ../../../gcc/trunk/gcc/fortran/intrinsic.c:3191
#2  0x08071f87 in gfc_intrinsic_func_interface (expr=0x89b5408, error_flag=1)
    at ../../../gcc/trunk/gcc/fortran/intrinsic.c:3450
#3  0x080a5e3f in gfc_resolve_expr (e=0x89b5408)
    at ../../../gcc/trunk/gcc/fortran/resolve.c:1629
#4  0x080a932e in resolve_code (code=0x89b5628, ns=0x89b42b0)
    at ../../../gcc/trunk/gcc/fortran/resolve.c:6104
#5  0x080ab29c in resolve_codes (ns=0x89b42b0)
    at ../../../gcc/trunk/gcc/fortran/resolve.c:8996
#6  0x080ab2d3 in gfc_resolve (ns=0x89b42b0)
    at ../../../gcc/trunk/gcc/fortran/resolve.c:9015
#7  0x0809c4b8 in gfc_parse_file ()
    at ../../../gcc/trunk/gcc/fortran/parse.c:3380
#8  0x080c54a5 in gfc_be_parse_file (set_yydebug=0)
    at ../../../gcc/trunk/gcc/fortran/f95-lang.c:260
#9  0x0836954c in toplev_main (argc=2, argv=0xbfecab94)
    at ../../../gcc/trunk/gcc/toplev.c:1042
#10 0x0811161f in main (argc=Cannot access memory at address 0x0
) at ../../../gcc/trunk/gcc/main.c:35


-- 
           Summary: ICE in TRANSFER with pointer mold
           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: tkoenig at gcc dot gnu dot org
OtherBugsDependingO 31237
             nThis:


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34761

Reply via email to