Re: [PATCH] PR fortran/102458 - ICE tree check: expected array_type, have pointer_type in gfc_conv_array_initializer, at fortran/trans-array.c:6136

2021-09-25 Thread Thomas Koenig via Fortran

On 23.09.21 21:47, Harald Anlauf via Fortran wrote:

Dear Fortranners,

we missed certain intrinsics as being disallowed in constant expressions,
which lead to an ICE when these intrinsics were used in a specification
expression with an initializer.  The intrinsics in question are listed in
F2018:10.1.2.

As discussed in the PR, Steve recommended to omit TRANSFER from that list,
as it is special and might need separate treatment.  I also could not come
up with a case where TRANSFER should not have simplified to a constant and
we would run into an issue.  (We could leave that job to Gerhard... ;-).

However, in testing I encountered a case involving TRANSFER that is not
properly simplified, which seems orthogonal to the present case.  I would
like to handle this separately.  This case is mentioned in the testcase,
but commented out.

Regtested on x86_64-pc-linux-gnu.  OK for mainline?


It was actually 10.1.12 :-)

OK for trunk.

Thanks for the patch!

Best regards

Thomas


Re: [Patch] Fortran: Fix associated intrinsic with assumed rank [PR101334] [was: [PATCH, Fortran] Fixes for F2018 C838 (PR fortran/101334)]

2021-09-25 Thread Thomas Koenig via Fortran

On 23.09.21 21:13, Tobias Burnus wrote:

On 20.09.21 09:58, Tobias Burnus wrote:


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, ... giving a bogus error when
passing one as the first argument to the ASSOCIATED intrinsic.  ...


...  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.


I fixed that issue + extended the testcase.

OK for mainline?


Hi Tobias,

looks good to me.

Thanks for the patch!

Best regards

Thomas