On 03.11.20 12:34, Richard Biener wrote:
This marks PDT types as needing structural comparison for TBAA
if we didn't pick up a canonical variant (which we should IMHO
always do). This workaround fixes the gfortran.dg/pdt_14.f03
fail which materializes as testsuite timeout which is quite
annoying.
Bootstrap / regtest pending on x86_64-unknown-linux-gnu.
OK?
OK as workaround; still, the question is why it does not find its
sibling – thus, we shall keep the PR open (or open a follow-up PR) to
fix it properly.
Tobias
2020-11-03 Richard Biener <rguent...@suse.de>
PR fortran/97652
gcc/fortran
* trans-types.c (gfc_get_derived_type): When we didn't find
a canonical type mark it for structual equality.
---
gcc/fortran/trans-types.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index b7129dcbe6d..4643fff243f 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -2647,6 +2647,8 @@ gfc_get_derived_type (gfc_symbol * derived, int codimen)
typenode = make_node (RECORD_TYPE);
TYPE_NAME (typenode) = get_identifier (derived->name);
TYPE_PACKED (typenode) = flag_pack_derived;
+ if (!got_canonical)
+ SET_TYPE_STRUCTURAL_EQUALITY (typenode);
derived->backend_decl = typenode;
}
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander
Walter