https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94050
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> --- So quite obviously *a* fix would be --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -6705,6 +6705,7 @@ layout_class_type (tree t, tree *virtuals_p) /* If we didn't end up needing an as-base type, don't use it. */ if (CLASSTYPE_AS_BASE (t) != t + && !CLASSTYPE_USER_ALIGN (t) && tree_int_cst_equal (TYPE_SIZE (t), TYPE_SIZE (CLASSTYPE_AS_BASE (t)))) CLASSTYPE_AS_BASE (t) = t; (needs a comment of course). Since the original fix was to avoid creating extra copies for LTO purposes, this slight degradation should not be too bad?