https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64980
--- Comment #11 from Mikael Morin <mikael at gcc dot gnu.org> --- Created attachment 34755 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34755&action=edit Another proposed fix (In reply to Bernd Edlinger from comment #10) > Yes, but I have no idea how to know how the result is going to be > used, in gfc_conv_procedure_call, line 4544. If you have an idea > how to detect this case, that would be great. It is used as argument to the procedure, and also added to the interface mapping mechanism through gfc_add_interface_mapping. >From there, it is dropped if the resulting size can be determined by other means; otherwised it is used to set the array result bounds. The attached patch (untested so far) makes a copy of the reference before passing it through VIEW_CONVERT_EXPR. It avoids the second V_C_E at least. > > Until yesterday, I thought the result is always used in a procedure call > context, and I thought we only have aliasing violations on different > variations of the same principal class, but that was also wrong. What I don't understand is why there isn't something alike needed for non-class arrays? They also use different variations of the same principal class, don't they?