On 10/20/21 3:41 PM, Tobias Burnus wrote:
Hi Sandra,

On 20.10.21 22:03, Sandra Loosemore wrote:
The one that was most concerning was an ICE when calling the SHAPE intrinsic with an assumed-rank class type argument ... In this case, SHAPE was calling a library function and trying to copy the array contents to a temporary, which is really stupid because SHAPE only needs to look at the descriptor and not the array contents.  I thought we could handle this inline the same as UBOUND and LBOUND, by extending gfc_trans_intrinsic_bound, and avoid the library function entirely.

Then, I found some other existing problems in gfc_trans_intrinsic_bound; the conditional it was building to test for the extent-zero special cases for LBOUND and UBOUND was completely wrong, and the compile-time test for the assumed-rank/assumed-size case was wrong too.  So I ended up rewriting large parts of that function.

I also fixed a bug in the SIZE intrinsic where it was not taking the class types into account.  (SIZE is already being handled inline in a separate place, otherwise I might've merged it into gfc_trans_intrinsic_bound as well.)

Thanks for your efforts!

LGTM with the changelog path fix, without the gfc_tree_array_size attribute change and with the indentation fix.

Thanks, committed now with those fixes. You are right that I'd made that change to gfc_tree_array_size before I pulled your alternate fix for that, and didn't realize that my hack had become redundant.

-Sandra

Reply via email to