https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101310
--- Comment #1 from sandra at gcc dot gnu.org --- Looks like 3 bugs for the price of 1! First off the loop to fill in the result dimensions in CFI_section seemed to be applying the base adjustment twice in different ways, or something like that. I've rewritten and simplified that code. The section-3 and section-3p test cases were themselves buggy. I swear I fixed one of bugs before but I must have discarded that change along with some failed experiments/debugging code for the bug above. Finally, fc-out-descriptor-7 was failing because it uses the same pointer array as both source and result, and CFI_section was messing with the dimensions in result before computing the base address adjustment from source. This ended up not having anything to do with the result array being intent(out). I'm going to add some more test cases and regression-test before posting the patch, but I do have fixes for all 3 bugs now.