https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91661

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-09-04
                 CC|                            |kargl at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from kargl at gcc dot gnu.org ---
Well, this is rather disconcerting.

(gdb) s
is_constant_array_expr (e=0x202f10d20) at ../../gccx/gcc/fortran/simplify.c:222
(gdb) list
224
225       if (e->expr_type == EXPR_VARIABLE && e->rank > 0
226           && e->symtree->n.sym->attr.flavor == FL_PARAMETER)
227         gfc_simplify_expr (e, 1);
228
229       if (e->expr_type != EXPR_ARRAY || !gfc_is_constant_expr (e))
230         return false;
231
232       for (c = gfc_constructor_first (e->value.constructor);
233            c; c = gfc_constructor_next (c))
(gdb) p *e
$3 = {expr_type = EXPR_CONSTANT, ts = {type = BT_INTEGER, kind = 4, u = {
      derived = 0x0, cl = 0x0, pad = 0}, interface = 0x0, is_c_interop = 0, 
    is_iso_c = 0, f90_type = BT_UNKNOWN, deferred = false, 
    interop_kind = 0x0}, rank = 1, shape = 0x0, symtree = 0x0, ref = 0x0, 

So, gfc_simplify_expr (e, 1) has reduced b(a(1)) to an EXPR_CONSTANT
with rank = 1.  Whoops, that's not good.

Reply via email to