Commit 3075b327 by Nathan Sidwell Committed by Nathan Sidwell

PR c++/13114, c++/13115

	PR c++/13114, c++/13115
	* class.c (layout_empty_base): Propagate the move of an empty base
	to offset zero.

From-SVN: r74573
parent 77fec971
2003-12-12 Nathan Sidwell <nathan@codesourcery.com>
PR c++/13114, c++/13115
* class.c (layout_empty_base): Propagate the move of an empty base
to offset zero.
PR c++/12881
* method.c (make_thunk): Deal with thunk aliases when searching
for a thunk. Robustify assertion.
......
......@@ -3576,14 +3576,18 @@ layout_empty_base (tree binfo, tree eoc, splay_tree offsets)
/* This routine should only be used for empty classes. */
my_friendly_assert (is_empty_class (basetype), 20000321);
alignment = ssize_int (CLASSTYPE_ALIGN_UNIT (basetype));
if (abi_version_at_least (2))
BINFO_OFFSET (binfo) = size_zero_node;
if (warn_abi && !integer_zerop (BINFO_OFFSET (binfo)))
warning ("offset of empty base `%T' may not be ABI-compliant and may"
"change in a future version of GCC",
BINFO_TYPE (binfo));
if (!integer_zerop (BINFO_OFFSET (binfo)))
{
if (abi_version_at_least (2))
propagate_binfo_offsets
(binfo, size_diffop (size_zero_node, BINFO_OFFSET (binfo)));
else if (warn_abi)
warning ("offset of empty base `%T' may not be ABI-compliant and may"
"change in a future version of GCC",
BINFO_TYPE (binfo));
}
/* This is an empty base class. We first try to put it at offset
zero. */
if (layout_conflict_p (binfo,
......
......@@ -2,7 +2,7 @@
// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 12 Dec 2003 <nathan@codesourcery.com>
// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
// Origin: grigory@stl.sarov.ru
// PR c++/12881. ICE in thunk generation
......
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