+2003-05-21 Jason Merrill <jason@redhat.com>
+
+ * init.c (build_vec_delete): Copy the address into a temporary
+ variable before calling build_vec_delete_1.
+ * decl2.c (delete_sanity): Don't call stabilize_reference.
+
2003-05-21 Nathan Sidwell <nathan@codesourcery.com>
* pt.c (register_specialization): Update the decl's location,
if (TREE_CODE (exp) == OFFSET_REF)
exp = resolve_offset_ref (exp);
exp = convert_from_reference (exp);
- t = stabilize_reference (exp);
- t = build_expr_type_conversion (WANT_POINTER, t, true);
+ t = build_expr_type_conversion (WANT_POINTER, exp, true);
if (t == NULL_TREE || t == error_mark_node)
{
int use_global_delete;
{
tree type;
+ tree rval;
+ tree base_init = NULL_TREE;
if (TREE_CODE (base) == OFFSET_REF)
base = resolve_offset_ref (base);
type = TREE_TYPE (base);
- base = stabilize_reference (base);
-
if (TREE_CODE (type) == POINTER_TYPE)
{
/* Step back one from start of vector, and read dimension. */
tree cookie_addr;
if (TREE_SIDE_EFFECTS (base))
- base = save_expr (base);
+ {
+ base_init = get_target_expr (base);
+ base = TARGET_EXPR_SLOT (base_init);
+ }
type = strip_array_types (TREE_TYPE (type));
cookie_addr = build (MINUS_EXPR,
build_pointer_type (sizetype),
type = strip_array_types (type);
base = build_unary_op (ADDR_EXPR, base, 1);
if (TREE_SIDE_EFFECTS (base))
- base = save_expr (base);
+ {
+ base_init = get_target_expr (base);
+ base = TARGET_EXPR_SLOT (base_init);
+ }
}
else
{
return error_mark_node;
}
- return build_vec_delete_1 (base, maxindex, type, auto_delete_vec,
+ rval = build_vec_delete_1 (base, maxindex, type, auto_delete_vec,
use_global_delete);
+ if (base_init)
+ rval = build (COMPOUND_EXPR, TREE_TYPE (rval), base_init, rval);
+
+ return rval;
}