[PATCH, Fortran] Fixes for F2018 C838 (PR fortran/101334)

Tobias Burnus tobias@codesourcery.com
Mon Sep 20 07:58:18 GMT 2021


On 20.09.21 06:01, Sandra Loosemore wrote:
> This patch fixes some bugs in handling of assumed-rank arguments
> revealed by the TS29113 testsuite, allowing xfails to be removed from
> those testcases.  It was previously failing to diagnose an error when
> passing an assumed-rank argument to a procedure via a non-assumed-rank
> dummy, and giving a bogus error when passing one as the first argument
> to the ASSOCIATED intrinsic.  Both fixes turned out to be 1-liners.
> OK to commit?

OK - however, I think you should first commit your follow-up/second patch (fix testsuite)
to avoid intermittent test-suite fails.

Additionally, if I try the following testcase, which is now permitted, I get
two ICEs. Can you check?

* The first one seems to be a bug in gfc_conv_intrinsic_function, which
   assumes also for assumed rank that if the first argument is an array,
   the second argument must also be an array.

* For the second one, I see in the dump:
     p->dim[p->dtype.rank + -1].stride
   is seems as '-1' is gfc_array_index_type while 'dtype.rank' is signed_char_type_node.


(Disclaimer: I don't have a clean tree, but I think this issue not affected
by my patches.)

subroutine foo(p, lp, lpd)
   use iso_c_binding
   implicit none (type, external)
   real, pointer :: p(..)
   real, pointer :: lp
   real, pointer :: lpd(:,:)

! gfc_conv_expr_descriptor, at fortran/trans-array.c:7324
   if (associated(p, lp)) stop 1

! verify_gimple: type mismatch in binary expression - signed char, signed char, integer(kind=8), _4 = _3 + -1;
   if (associated(p, lpd)) stop 1
end



Tobias

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955


More information about the Fortran mailing list