http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54788
Dominique d'Humieres <dominiq at lps dot ens.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2013-06-27 Ever confirmed|0 |1 --- Comment #6 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- I still get an ICE for the second test in comment #1 at revision 200429. The backtrace is Program received signal SIGSEGV, Segmentation fault. gfc_array_size (array=0x141b148d0, result=0x7fff5fbfd300) at ../../work/gcc/fortran/array.c:2087 2087 if (as->type == AS_ASSUMED_RANK) (gdb) bt #0 gfc_array_size (array=0x141b148d0, result=0x7fff5fbfd300) at ../../work/gcc/fortran/array.c:2087 #1 0x000000010003f1a0 in gfc_check_pointer_assign (lvalue=0x141b143f0, rvalue=0x141b148d0) at ../../work/gcc/fortran/expr.c:3648 #2 0x00000001000a060e in resolve_code (code=<value optimized out>, ns=<value optimized out>) at ../../work/gcc/fortran/resolve.c:9815 #3 0x00000001000a18c4 in resolve_codes (ns=<value optimized out>) at ../../work/gcc/fortran/resolve.c:14474 #4 0x0000000100091f1d in gfc_resolve (ns=<value optimized out>) at ../../work/gcc/fortran/resolve.c:14502 #5 0x0000000100085f2b in gfc_parse_file () at ../../work/gcc/fortran/parse.c:4442 #6 0x00000001000c6316 in gfc_be_parse_file () at ../../work/gcc/fortran/f95-lang.c:189 #7 0x0000000100793294 in compile_file () at ../../work/gcc/toplev.c:544 #8 0x0000000100795389 in toplev_main (argc=2, argv=0x7fff5fbfd7a8) at ../../work/gcc/toplev.c:1872 #9 0x0000000100009ca4 in start (pc=<value optimized out>, bases=0x0) at ../../../work/libgcc/config/unwind-dw2-fde-darwin.c:272 With the following (untested) patch --- ../_clean/gcc/fortran/array.c 2013-06-08 11:35:26.000000000 +0200 +++ gcc/fortran/array.c 2013-06-27 11:06:24.000000000 +0200 @@ -2084,7 +2084,7 @@ spec_size (gfc_array_spec *as, mpz_t *re mpz_t size; int d; - if (as->type == AS_ASSUMED_RANK) + if (!as || as->type == AS_ASSUMED_RANK) return false; mpz_init_set_ui (*result, 1); one gets the error a(0:0) => b 1 Error: Rank remapping target must be rank 1 or simply contiguous at (1)