Hi All! Proposed patch to: PR100040 - Wrong code with intent out assumed-rank allocatable PR100029 - ICE on subroutine call with allocatable polymorphic assumed-rank argument Patch tested only on x86_64-pc-linux-gnu. Made sure the code also recognized assumed-rank arrays as full arrays. Changed the order of free and class to class conversion so that the free occurs first so that there are no problems with freeing an unexpected type of transformed class. Thank you very much. Best regards, José Rui Fortran: Fix ICE and wrong code emission [PR100029, PR100040] gcc/fortran/ChangeLog: PR fortran/100040 * trans-expr.c (gfc_conv_class_to_class): add code to have assumed-rank arrays recognized as full arrays and fix the type of the array assignment. PR fortran/100029 * trans-expr.c (gfc_conv_procedure_call): change order of code blocks, such that the free occurs first. gcc/testsuite/ChangeLog: PR fortran/100029 * gfortran.dg/PR100029.f90: New test. PR fortran/100040 * gfortran.dg/PR100040.f90: New test.