diff options
author | Jason Merrill <jason@redhat.com> | 2002-06-18 12:05:31 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2002-06-18 12:05:31 -0400 |
commit | 83b14b884703a989f1ac97df97588fddbc979c5a (patch) | |
tree | 98c55d8452bda03001636a7d267a1f324d91b761 | |
parent | 3831381763ca5f41d6f7406d590e1e38a8531e1c (diff) | |
download | gcc-83b14b884703a989f1ac97df97588fddbc979c5a.zip gcc-83b14b884703a989f1ac97df97588fddbc979c5a.tar.gz gcc-83b14b884703a989f1ac97df97588fddbc979c5a.tar.bz2 |
C++ ABI changes.
* class.c (build_base_field): Set DECL_PACKED.
(layout_class_type): Don't use tail padding of PODs.
* mangle.c (write_unqualified_name): Fix template conversion op
mangling.
From-SVN: r54747
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/class.c | 8 | ||||
-rw-r--r-- | gcc/cp/mangle.c | 11 |
3 files changed, 26 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4da4bd4..21ced62 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2002-06-14 Jason Merrill <jason@redhat.com> + + C++ ABI changes. + * class.c (build_base_field): Set DECL_PACKED. + (layout_class_type): Don't use tail padding of PODs. + * mangle.c (write_unqualified_name): Fix template conversion op + mangling. + 2002-06-16 Richard Henderson <rth@redhat.com> PR opt/6793 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 1be2897..09a0385 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -3837,6 +3837,8 @@ build_base_field (rli, binfo, empty_p, offsets, t) DECL_SIZE_UNIT (decl) = CLASSTYPE_SIZE_UNIT (basetype); DECL_ALIGN (decl) = CLASSTYPE_ALIGN (basetype); DECL_USER_ALIGN (decl) = CLASSTYPE_USER_ALIGN (basetype); + /* Tell the backend not to round up to TYPE_ALIGN. */ + DECL_PACKED (decl) = 1; if (!integer_zerop (DECL_SIZE (decl))) { @@ -4978,6 +4980,12 @@ layout_class_type (t, empty_p, vfuns_p, CLASSTYPE_SIZE (t) = bitsize_zero_node; CLASSTYPE_SIZE_UNIT (t) = size_zero_node; } + /* If this is a POD, we can't reuse its tail padding. */ + else if (!CLASSTYPE_NON_POD_P (t)) + { + CLASSTYPE_SIZE (t) = TYPE_SIZE (t); + CLASSTYPE_SIZE_UNIT (t) = TYPE_SIZE_UNIT (t); + } else { CLASSTYPE_SIZE (t) = TYPE_BINFO_SIZE (t); diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 12888ac..996b027 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -988,8 +988,17 @@ write_unqualified_name (decl) { /* Conversion operator. Handle it right here. <operator> ::= cv <type> */ + tree type; + if (decl_is_template_id (decl, NULL)) + { + tree fn_type = get_mostly_instantiated_function_type (decl, NULL, + NULL); + type = TREE_TYPE (fn_type); + } + else + type = TREE_TYPE (DECL_NAME (decl)); write_string ("cv"); - write_type (TREE_TYPE (DECL_NAME (decl))); + write_type (type); } else if (DECL_OVERLOADED_OPERATOR_P (decl)) { |