[PATCH] fortran/97652 - workaround missing canonicalization of PDT types

Richard Biener rguenther@suse.de
Tue Nov 3 11:34:16 GMT 2020


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?

2020-11-03  Richard Biener  <rguenther@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;
     }
 
-- 
2.26.2


More information about the Gcc-patches mailing list