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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #5 from anlauf at gcc dot gnu.org ---
The ICE occurs for both SUM and PRODUCT of SHAPE,LBOUND,UBOUND of the
assumed-rank dummy.

The ICE points to gfc_conv_intrinsic_arith:

4929          gfc_conv_ss_startstride (&loop);

The difference between assumed-shape vs. assumed-rank argument is:

(gdb) p *loop->ss->info->expr->shape->_mp_d
$86 = 1

vs.

(gdb) p loop->ss->info->expr->shape
$88 = (mpz_t *) 0x0

Now gfc_conv_ss_startstride should be able to handle assumed-rank,
but then we die here:

(gdb) l 4811,4826
4811                    arg = expr->value.function.actual->expr;
4812                    if (arg->rank == -1)
4813                      {
4814                        gfc_se se;
4815                        tree rank, tmp;
4816
4817                        /* The rank (hence the return value's shape) is
unknown,
4818                           we have to retrieve it.  */
4819                        gfc_init_se (&se, NULL);
4820                        se.descriptor_only = 1;
4821                        gfc_conv_expr (&se, arg);
4822                        /* This is a bare variable, so there is no
preliminary
4823                           or cleanup code.  */
4824                        gcc_assert (se.pre.head == NULL_TREE
4825                                    && se.post.head == NULL_TREE);
4826                        rank = gfc_conv_descriptor_rank (se.expr);

Reply via email to