https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89266
--- Comment #7 from Harald Anlauf <anlauf at gmx dot de> --- (In reply to Harald Anlauf from comment #6) > The problem might be here: > > check.c: gfc_calculate_transfer_sizes > > 5482 /* Calculate the size of the source. */ > 5483 *source_size = gfc_target_expr_size (source); > 5484 if (*source_size == 0) > 5485 return false; > > Shouldn't the case tested here be handled differently? Commenting out the lines 5484-5485 makes the testcase compile, but regtesting fails for transfer_check_3.f90: /work/gnu/svn/build-trunk/gcc/f951 transfer_check_3.f90 -Wsurprising transfer_check_3.f90:32:22: 32 | i = transfer (record_type(1:j), i) ! gave a warning | 1 Warning: Intrinsic TRANSFER at (1) has partly undefined result: source size 0 < result size 4 [-Wsurprising] cgbrfsx test It appears that we shall we need to be able to distinguish size 0 source from unknown size. Thus we could change change gfc_target_expr_size and adjust its other users.