https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92208
--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Christophe Lyon from comment #7)
> On gcc-9, the patch introduced regressions, seen on arm and aarch64:
On trunk, the following was needed (PR92277, r277661) – but I it did
not trigger on the branch with x86_64. Seemingly, for arm and aarch64
it does trigger.
Can you try the following patch? (Re-diffed for GCC 9):
--- ../../fortran/trans-expr.c (revision 277818)
+++ ../../fortran/trans-expr.c (working copy)
@@ -5029,2 +5029,6 @@ gfc_conv_gfc_desc_to_cfi_desc
+ bool is_artificial = (INDIRECT_REF_P (parmse->expr)
+ ? DECL_ARTIFICIAL (TREE_OPERAND (parmse->expr, 0))
+ : DECL_ARTIFICIAL (parmse->expr));
+
/* Unallocated allocatable arrays and unassociated pointer arrays
@@ -5047,3 +5051,3 @@ gfc_conv_gfc_desc_to_cfi_desc
- if (type && DECL_ARTIFICIAL (parmse->expr)
+ if (type && is_artificial
&& type != gfc_get_element_type (TREE_TYPE (parmse->expr)))
@@ -5059,4 +5063,3 @@ gfc_conv_gfc_desc_to_cfi_desc
}
- else if (type == NULL_TREE
- || (!is_subref_array (e) && !DECL_ARTIFICIAL (parmse->expr)))
+ else if (type == NULL_TREE || (!is_subref_array (e) && !is_artificial))
{