* call.c (build_call): Still evaluate the actual argument.
* class.c (is_empty_class): Update for -fnew-abi.
* decl2.c: -fnew-abi implies -fsquangle.
* method.c (do_build_assign_ref): Don't do anything to copy
an empty class.
(do_build_copy_constructor): Likewise.
* call.c (build_over_call): Likewise.
From-SVN: r19029
+Mon Apr 6 02:25:05 1998 Jason Merrill <jason@yorick.cygnus.com>
+
+ * call.c (build_call): Still evaluate the actual argument.
+ * class.c (is_empty_class): Update for -fnew-abi.
+
+ * decl2.c: -fnew-abi implies -fsquangle.
+
+ * method.c (do_build_assign_ref): Don't do anything to copy
+ an empty class.
+ (do_build_copy_constructor): Likewise.
+ * call.c (build_over_call): Likewise.
+
Sat Apr 4 18:43:58 1998 Jason Merrill <jason@yorick.cygnus.com>
* tree.c (avoid_overlap): Return a value.
TREE_TYPE (t) = TREE_TYPE (TREE_VALUE (tmp));
RTL_EXPR_RTL (t) = const0_rtx;
RTL_EXPR_SEQUENCE (t) = NULL_RTX;
- TREE_VALUE (tmp) = t;
+ TREE_VALUE (tmp) = build (COMPOUND_EXPR, TREE_TYPE (t),
+ TREE_VALUE (tmp), t);
}
function = build_nt (CALL_EXPR, function, parms, NULL_TREE);
{
tree to = stabilize_reference
(build_indirect_ref (TREE_VALUE (args), 0));
+
+ /* Don't copy the padding byte; it might not have been allocated
+ if to is a base subobject. */
+ if (is_empty_class (DECL_CLASS_CONTEXT (fn)))
+ return to;
+
val = build (INIT_EXPR, DECL_CONTEXT (fn), to, arg);
TREE_SIDE_EFFECTS (val) = 1;
return build_unary_op (ADDR_EXPR, val, 0);
}
else if (DECL_NAME (fn) == ansi_opname[MODIFY_EXPR]
&& copy_args_p (fn)
- && TYPE_HAS_TRIVIAL_ASSIGN_REF (DECL_CONTEXT (fn)))
+ && TYPE_HAS_TRIVIAL_ASSIGN_REF (DECL_CLASS_CONTEXT (fn)))
{
tree to = stabilize_reference
(build_indirect_ref (TREE_VALUE (converted_args), 0));
+
+ /* Don't copy the padding byte; it might not have been allocated
+ if to is a base subobject. */
+ if (is_empty_class (DECL_CLASS_CONTEXT (fn)))
+ return to;
+
arg = build_indirect_ref (TREE_VALUE (TREE_CHAIN (converted_args)), 0);
val = build (MODIFY_EXPR, TREE_TYPE (to), to, arg);
TREE_SIDE_EFFECTS (val) = 1;
{
tree t;
- if (! IS_AGGR_TYPE (type) || TYPE_BINFO_BASETYPES (type))
+ if (! IS_AGGR_TYPE (type))
+ return 0;
+
+ if (flag_new_abi)
+ return CLASSTYPE_SIZE (type) == integer_zero_node;
+
+ if (TYPE_BINFO_BASETYPES (type))
return 0;
t = TYPE_FIELDS (type);
while (t && TREE_CODE (t) != FIELD_DECL)
int flag_weak = 1;
-int flag_new_abi = 1;
+/* Nonzero to enable experimental ABI changes. */
+
+int flag_new_abi;
/* Maximum template instantiation depth. Must be at least 17 for ANSI
compliance. */
{"check-new", &flag_check_new, 1},
{"repo", &flag_use_repository, 1},
{"for-scope", &flag_new_for_scope, 2},
- {"weak", &flag_weak, 1},
- {"new-abi", &flag_new_abi, 1}
+ {"weak", &flag_weak, 1}
};
/* Decode the string P as a language-specific option.
error ("-fno-ansi-overloading is no longer supported");
found = 1;
}
+ else if (!strcmp (p, "new-abi"))
+ {
+ flag_new_abi = 1;
+ flag_do_squangling = 1;
+ }
+ else if (!strcmp (p, "no-new-abi"))
+ {
+ flag_new_abi = 0;
+ flag_do_squangling = 0;
+ }
else if (!strncmp (p, "template-depth-", 15))
{
char *endp = p + 15;
parm = TREE_CHAIN (parm);
parm = convert_from_reference (parm);
- if (TYPE_HAS_TRIVIAL_INIT_REF (current_class_type))
+ if (TYPE_HAS_TRIVIAL_INIT_REF (current_class_type)
+ && is_empty_class (current_class_type))
+ /* Don't copy the padding byte; it might not have been allocated
+ if *this is a base subobject. */;
+ else if (TYPE_HAS_TRIVIAL_INIT_REF (current_class_type))
{
t = build (INIT_EXPR, void_type_node, current_class_ref, parm);
TREE_SIDE_EFFECTS (t) = 1;
parm = convert_from_reference (parm);
- if (TYPE_HAS_TRIVIAL_ASSIGN_REF (current_class_type))
+ if (TYPE_HAS_TRIVIAL_ASSIGN_REF (current_class_type)
+ && is_empty_class (current_class_type))
+ /* Don't copy the padding byte; it might not have been allocated
+ if *this is a base subobject. */;
+ else if (TYPE_HAS_TRIVIAL_ASSIGN_REF (current_class_type))
{
tree t = build (MODIFY_EXPR, void_type_node, current_class_ref, parm);
TREE_SIDE_EFFECTS (t) = 1;