[Bug fortran/66227] [5/6/7 Regression] [OOP] EXTENDS_TYPE_OF n returns wrong result for polymorphic variable allocated to extended type
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Nov 15 16:29:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66227
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |janus at gcc dot gnu.org
--- Comment #4 from janus at gcc dot gnu.org ---
(In reply to janus from comment #3)
> Confirmed. What's funny is that all eight cases are simplified to
> compile-time constants. That clearly shouldn't be. Probably there's a bug in
> gfc_simplify_extends_type_of.
The regression is due to r168579. The following patch fixes it:
Index: simplify.c
===================================================================
--- simplify.c (Revision 242412)
+++ simplify.c (Arbeitskopie)
@@ -2531,11 +2531,7 @@
mold->ts.u.derived->components->ts.u.derived)
&& !gfc_type_is_extension_of
(mold->ts.u.derived->components->ts.u.derived,
- a->ts.u.derived))
- || (a->ts.type == BT_CLASS && mold->ts.type == BT_DERIVED
- && !gfc_type_is_extension_of
- (mold->ts.u.derived,
- a->ts.u.derived->components->ts.u.derived)))
+ a->ts.u.derived)))
return gfc_get_logical_expr (gfc_default_logical_kind, &a->where, false);
if (mold->ts.type == BT_DERIVED
More information about the Gcc-bugs
mailing list