summaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-18 11:24:24 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-18 11:24:24 +0000
commitae1df41de87b315c59d9d90cdaa4e1af663c12c2 (patch)
treeacc35e62bb34fcb06c3819084139135516383189 /gcc/cp/class.c
parentee8f08ae575e9024cf752040bb8cd94c448894d5 (diff)
downloadgcc-ae1df41de87b315c59d9d90cdaa4e1af663c12c2.tar.gz
PR c++/3948 -- C++ ABI change, followup to 2001-12-18 patch.
* class.c (finish_struct_bits): Also set TREE_ADDRESSABLE for a type with a nontrivial destructor. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50959 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 8923916b17f..1c0c526ecb8 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -1879,15 +1879,16 @@ finish_struct_bits (t)
}
}
- /* If this type has a copy constructor, force its mode to be BLKmode, and
- force its TREE_ADDRESSABLE bit to be nonzero. This will cause it to
- be passed by invisible reference and prevent it from being returned in
- a register.
+ /* If this type has a copy constructor or a destructor, force its mode to
+ be BLKmode, and force its TREE_ADDRESSABLE bit to be nonzero. This
+ will cause it to be passed by invisible reference and prevent it from
+ being returned in a register.
Also do this if the class has BLKmode but can still be returned in
registers, since function_cannot_inline_p won't let us inline
functions returning such a type. This affects the HP-PA. */
if (! TYPE_HAS_TRIVIAL_INIT_REF (t)
+ || TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)
|| (TYPE_MODE (t) == BLKmode && ! aggregate_value_p (t)
&& CLASSTYPE_NON_AGGREGATE (t)))
{