OSDN Git Service

85th Cygnus<->FSF quick merge
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 9 Mar 1996 19:44:47 +0000 (19:44 +0000)
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 9 Mar 1996 19:44:47 +0000 (19:44 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11505 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/tree.c

index 42ac898..7e7006f 100644 (file)
@@ -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.
index c9d5c42..602ddc2 100644 (file)
@@ -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:
 
index 6334f3d..65c8f8a 100644 (file)
@@ -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;
 }