------- Comment #5 from burnus at gcc dot gnu dot org 2009-02-25 18:30 ------- Confirm. Also works with NAG f95. It fails with 4.1 to 4.4 and thus it does not seem to be a regression.
It fails in spec_dimen_size for "dimen=1, as->rank=1". Some more debugging information from gfc_array_dimen_size: - array->symtree->n.sym->name == "fd" (this is the function "FD") - array->symtree->n.sym->as == { rank = 1, type = AS_DEFERRED, ... } - array->rank == 2 Thus the interesting thing is that the EXPR_FUNCTION is RANK 2 while the symbol is only RANK 1. A backtrace shows that it occurs for a MATMUL. The problem seems to be constructs like: ptr = MATMUL(FD(a, i), value(b)) where not FUNCTION FD(x) should be called but FUNCTION FD_array_one(x, i) as there is INTERFACE FD MODULE PROCEDURE FD, FD_one, FD_array_one, FD_matrix_one END INTERFACE #0 gfc_array_dimen_size (array=0x1329450, dimen=1, result=0x7fffffffd370) at array.c:2036 #1 0x0000000000412da8 in identical_dimen_shape (a=0x1329450, ai=1, b=0x1329690, bi=2) at check.c:386 #2 0x00000000004149f2 in gfc_check_matmul (matrix_a=0x1329450, matrix_b=0x1329690) at check.c:1869 #3 0x000000000043371c in check_specific (specific=0x11857a0, expr=0x1329000, error_flag=0) at intrinsic.c:3461 #4 0x0000000000433a43 in gfc_intrinsic_func_interface (expr=0x1329000, error_flag=0) at intrinsic.c:3667 #5 0x000000000046fb9d in resolve_function (expr=0x1329000) at resolve.c:1689 #6 0x000000000046bd2a in gfc_resolve_expr (e=0x1329000) at resolve.c:4754 -- burnus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- OtherBugsDependingO| |32834 nThis| | GCC host triplet|x86_64-unknown-linux-gnu | GCC target triplet|x86_64-unknown-linux-gnu | Keywords| |ice-on-valid-code Priority|P4 |P3 Summary|ICE on module compilation |ICE with MATMUL, | |specific/generic functions | |and rank checking http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39304