https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92996
anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2019-12-18 CC| |anlauf at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from anlauf at gcc dot gnu.org --- Funny. Setting a breakpoint in match.c, after 3086 /* Use the machinery for an initialization expression to reduce the 3087 stop-code to a constant. */ 3088 gfc_init_expr_flag = true; 3089 gfc_reduce_init_expr (e); 3090 gfc_init_expr_flag = false; I get for case 0 (a(:) is variable): (gdb) p e->expr_type $5 = EXPR_VARIABLE (gdb) p e->rank $6 = 1 whereas for case 1 (a(:) is parameter): (gdb) p e->expr_type $7 = EXPR_ARRAY (gdb) p e->rank $8 = 0 How can that happen? This is the reason it later misses the part: 3107 if (e->rank != 0) 3108 { 3109 gfc_error ("STOP code at %L must be scalar", &e->where); 3110 goto cleanup; 3111 }