https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66227
janus at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |janus at gcc dot gnu.org Summary|[OOP] EXTENDS_TYPE_OF n |[5/6/7 Regression] [OOP] |returns wrong result for |EXTENDS_TYPE_OF n returns |polymorphic variable |wrong result for |allocated to extended type |polymorphic variable | |allocated to extended type --- Comment #3 from janus at gcc dot gnu.org --- 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. I think this is a (very old) regression caused by PR 41850: gfortran 4.5 gets all the values right!