From: Mike Stump Date: Sat, 9 Mar 1996 19:44:47 +0000 (+0000) Subject: 85th Cygnus<->FSF quick merge X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=934c6b1387597fff9318c602ef4050194a25d271;p=gcc.git 85th Cygnus<->FSF quick merge From-SVN: r11505 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 42ac898b237..7e7006fdb0c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,18 @@ +Fri Mar 8 11:47:26 1996 Mike Stump + + * tree.c (unsave_expr): Don't unsave, UNSAVE_EXPRs. + +Fri Mar 8 11:29:06 1996 Mike Stump + + * 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 + + * tree.c (vec_binfo_member): Don't core dump if we have no bases. + Thu Mar 7 14:11:49 1996 Jason Merrill * tree.def: Add RETURN_INIT. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index c9d5c42286c..602ddc2098e 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 6334f3de4cb..65c8f8af1b3 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; }