Commit c3337b44 by Jason Merrill Committed by Jason Merrill

Don't use a separate CLASSTYPE_AS_BASE if it's the same size.

	* class.c (layout_class_type): Don't use a separate
	CLASSTYPE_AS_BASE if it's the same size.

From-SVN: r272618
parent a3c8d7fb
2019-06-24 Jason Merrill <jason@redhat.com>
* class.c (layout_class_type): Don't use a separate
CLASSTYPE_AS_BASE if it's the same size.
2019-06-23 Marek Polacek <polacek@redhat.com>
* call.c (convert_default_arg): Use DEFERRED_PARSE instead of
......
......@@ -6453,6 +6453,12 @@ layout_class_type (tree t, tree *virtuals_p)
/* Let the back end lay out the type. */
finish_record_layout (rli, /*free_p=*/true);
/* If we didn't end up needing an as-base type, don't use it. */
if (CLASSTYPE_AS_BASE (t) != t
&& tree_int_cst_equal (TYPE_SIZE (t),
TYPE_SIZE (CLASSTYPE_AS_BASE (t))))
CLASSTYPE_AS_BASE (t) = t;
if (TYPE_SIZE_UNIT (t)
&& TREE_CODE (TYPE_SIZE_UNIT (t)) == INTEGER_CST
&& !TREE_OVERFLOW (TYPE_SIZE_UNIT (t))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment