+2011-10-07 Mikael Morin <mikael.morin@sfr.fr>
+
+ * trans-array.c (gfc_conv_ss_startstride): Support zero rank loop.
+
2011-10-07 Mikael Morin <mikael.morin@sfr.fr>
* trans-array.c (gfc_conv_section_startstride): Move code to
loop->dimen = 0;
/* Determine the rank of the loop. */
- for (ss = loop->ss;
- ss != gfc_ss_terminator && loop->dimen == 0; ss = ss->loop_chain)
+ for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain)
{
switch (ss->type)
{
case GFC_SS_COMPONENT:
loop->dimen = ss->data.info.dimen;
loop->codimen = ss->data.info.codimen;
- break;
+ goto done;
/* As usual, lbound and ubound are exceptions!. */
case GFC_SS_INTRINSIC:
case GFC_ISYM_UBOUND:
loop->dimen = ss->data.info.dimen;
loop->codimen = 0;
- break;
+ goto done;
case GFC_ISYM_LCOBOUND:
case GFC_ISYM_UCOBOUND:
case GFC_ISYM_THIS_IMAGE:
loop->dimen = ss->data.info.dimen;
loop->codimen = ss->data.info.codimen;
- break;
+ goto done;
default:
break;
/* We should have determined the rank of the expression by now. If
not, that's bad news. */
- gcc_assert (loop->dimen + loop->codimen != 0);
+ gcc_unreachable ();
+done:
/* Loop over all the SS in the chain. */
for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain)
{