PR31692 - Wrong code when passing function name as result to procedures

Tobias Burnus burnus@net-b.de
Thu May 3 16:00:00 GMT 2007


Hi again,

Tobias Burnus wrote:
> How about the following test? I did not test yet your patch ;-)
>   
But I should have done so!

>       if(foo1(n) /= [ 1,2,3 ]) call abort()
>       if(foo2(n) /= [ 1,2,3 ]) call abort()
>   
There is an "any( .... /= ...)" missing.

In addition, gfortran gets it wrong for foo2:
foo2 (__result, n)
{ // ...
    __result->data = _gfortran_allocate64_array (__result->data, size.0, 0);
  bar1 ((int4 *) n, __result);

The function call is wrong. bar1 expects an "array(*)" not an "array(:)".

foo1 does do it correctly:
    __result.0 = (int4[0:D.1413] *) __result->data;
  bar1 ((int4 *) n, __result.0);


Tobias



More information about the Fortran mailing list