[Bug fortran/89363] RANK incorrect for unallocated allocatable

2019-03-12 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89363

Paul Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Paul Thomas  ---
Fixed on trunk.

Thanks for the report.

Paul

[Bug fortran/89363] RANK incorrect for unallocated allocatable

2019-03-12 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89363

--- Comment #3 from Paul Thomas  ---
Author: pault
Date: Tue Mar 12 13:40:51 2019
New Revision: 269612

URL: https://gcc.gnu.org/viewcvs?rev=269612=gcc=rev
Log:
2019-03-12  Paul Thomas  

PR fortran/89363
PR fortran/89364
* trans-expr.c (set_dtype_for_unallocated): New function.
(gfc_conv_gfc_desc_to_cfi_desc): Call it for allocatable and
pointer arguments.
(gfc_conv_procedure_call): Likewise. Also, set the ubound of
the final dimension to -1 for assumed rank formal args that are
associated with assumed size arrays.
* trans-intrinsic.c (gfc_conv_intrinsic_bound): Return -1 for
the final dimension of assumed rank entities that are argument
associated with assumed size arrays.
(gfc_conv_intrinsic_shape): Likewise return -1 for the final
dimension of the shape intrinsic.

2019-03-12  Paul Thomas  

PR fortran/89363
* gfortran.dg/assumed_rank_16.f90: New test.

PR fortran/89364
* gfortran.dg/assumed_rank_17.f90: New test.


Added:
trunk/gcc/testsuite/gfortran.dg/assumed_rank_16.f90
trunk/gcc/testsuite/gfortran.dg/assumed_rank_17.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-expr.c
trunk/gcc/fortran/trans-intrinsic.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/89363] RANK incorrect for unallocated allocatable

2019-02-21 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89363

Paul Thomas  changed:

   What|Removed |Added

 CC||pault at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |pault at gcc dot gnu.org

--- Comment #2 from Paul Thomas  ---
This is not part of the ISO_Fortran_binding implementation but is clearly
associated with it.

I can see how to fix it and will get on with it today.

Paul

[Bug fortran/89363] RANK incorrect for unallocated allocatable

2019-02-19 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89363

Dominique d'Humieres  changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-02-19
 Ever confirmed|0   |1

--- Comment #1 from Dominique d'Humieres  ---
With 8.2.0 and trunk (9.0) I get

 FAIL procr   1 F

and from at least 4.8 up to 7.4, I get

 FAIL procr   0 F

Note that if I add

  print *, rank(x)

before

  call procr(x,flag)

I get 2.