aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Stump <mrs@cygnus.com>1996-03-09 19:44:47 +0000
committerMike Stump <mrs@gcc.gnu.org>1996-03-09 19:44:47 +0000
commit934c6b1387597fff9318c602ef4050194a25d271 (patch)
tree8346d1c9d3825e57badc5c5013e5fdeb1add300d
parent2a888d4cd0492cb7f0e00bee497da7e9a01bf439 (diff)
downloadgcc-934c6b1387597fff9318c602ef4050194a25d271.zip
gcc-934c6b1387597fff9318c602ef4050194a25d271.tar.gz
gcc-934c6b1387597fff9318c602ef4050194a25d271.tar.bz2
85th Cygnus<->FSF quick merge
From-SVN: r11505
-rw-r--r--gcc/cp/ChangeLog15
-rw-r--r--gcc/cp/decl.c13
-rw-r--r--gcc/cp/tree.c18
3 files changed, 37 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 42ac898..7e7006f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,18 @@
+Fri Mar 8 11:47:26 1996 Mike Stump <mrs@cygnus.com>
+
+ * tree.c (unsave_expr): Don't unsave, UNSAVE_EXPRs.
+
+Fri Mar 8 11:29:06 1996 Mike Stump <mrs@cygnus.com>
+
+ * decl.c (cp_finish_decl): The exception regions have to be
+ nested, not overlapping. We start the exception region for a
+ decl, after it has been fully built, and all temporaries for it
+ have been cleaned up.
+
+Thu Mar 7 17:46:06 1996 Mike Stump <mrs@cygnus.com>
+
+ * tree.c (vec_binfo_member): Don't core dump if we have no bases.
+
Thu Mar 7 14:11:49 1996 Jason Merrill <jason@yorick.cygnus.com>
* tree.def: Add RETURN_INIT.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index c9d5c42..602ddc2 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -6769,7 +6769,15 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
&& cleanup == NULL_TREE
&& DECL_NAME (decl))
TREE_USED (decl) = 0;
+ }
+ /* Cleanup any temporaries needed for the initial value. */
+ expand_cleanups_to (old_cleanups);
+ pop_temp_slots ();
+ pop_temp_slots ();
+ target_temp_slot_level = old_temp_level;
+ if (DECL_SIZE (decl) && type != error_mark_node)
+ {
/* Store the cleanup, if there was one. */
if (cleanup)
{
@@ -6778,11 +6786,6 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
decl);
}
}
- /* Cleanup any temporaries needed for the initial value. */
- expand_cleanups_to (old_cleanups);
- pop_temp_slots ();
- pop_temp_slots ();
- target_temp_slot_level = old_temp_level;
}
finish_end0:
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 6334f3d..65c8f8a 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1761,12 +1761,19 @@ break_out_target_exprs (t)
return mapcar (t, bot_manip);
}
+/* Arrange for an expression to be expanded multiple independent
+ times. This is useful for cleanup actions, as the backend can
+ expand them multiple times in different places. */
tree
unsave_expr (expr)
tree expr;
{
tree t;
+ /* If this is already protected, no sense in protecting it again. */
+ if (TREE_CODE (expr) == UNSAVE_EXPR)
+ return expr;
+
t = build1 (UNSAVE_EXPR, TREE_TYPE (expr), expr);
TREE_SIDE_EFFECTS (t) = TREE_SIDE_EFFECTS (expr);
return t;
@@ -1984,16 +1991,19 @@ can_free (obstack, t)
}
/* Return first vector element whose BINFO_TYPE is ELEM.
- Return 0 if ELEM is not in VEC. */
+ Return 0 if ELEM is not in VEC. VEC may be NULL_TREE. */
tree
vec_binfo_member (elem, vec)
tree elem, vec;
{
int i;
- for (i = 0; i < TREE_VEC_LENGTH (vec); ++i)
- if (elem == BINFO_TYPE (TREE_VEC_ELT (vec, i)))
- return TREE_VEC_ELT (vec, i);
+
+ if (vec)
+ for (i = 0; i < TREE_VEC_LENGTH (vec); ++i)
+ if (elem == BINFO_TYPE (TREE_VEC_ELT (vec, i)))
+ return TREE_VEC_ELT (vec, i);
+
return NULL_TREE;
}