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

--- Comment #7 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to Harald Anlauf from comment #5)
> You probably hit something that's just not yet implemented:
> 
> trans-expr.c:
> 
> (gdb) list 4083,4096
> 4083        case GFC_ISYM_LBOUND:
> 4084        case GFC_ISYM_UBOUND:
> 4085            /* TODO These implementations of lbound and ubound do not
> limit if
> 4086               the size < 0, according to F95's 13.14.53 and 13.14.113. 
> */
> 4087
> 4088          if (!sym->as || sym->as->rank == 0)
> 4089            return false;
> 4090
> 4091          if (arg2 && arg2->expr_type == EXPR_CONSTANT)
> 4092            d = mpz_get_si (arg2->value.integer) - 1;
> 4093          else
> 4094            /* TODO: If the need arises, this could produce an array of
> 4095               ubound/lbounds.  */
> 4096            gcc_unreachable ();

Harald,

You are quite right. Declaring 'operate' as

real :: operate(1:PRODUCT([UBOUND(A,1),UBOUND(A,2),UBOUND(A,3)]))

works as expected.

There has to be some way to simplify this, since it happens correctly in
specification expressions. On to it....

Cheers

Paul

Reply via email to