PR c++/18984
* pointer-set.c (pointer_set_contains): Add back.
* pointer-set.h (pointer_set_contains): Add back.
2004-12-21 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/18984
* cp-gimplify.c (cp_genericize_r): Don't insert first but instead
check to see if contains the pointer. Insert the statement before
returning.
2004-12-21 Andrew Pinski <pinskia@physics.uc.edu>
PR C++/18984
* g++.dg/eh/ctor3.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92470
138bc75d-0d04-0410-961f-
82ee72b054a4
+2004-12-21 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/18984
+ * pointer-set.c (pointer_set_contains): Add back.
+ * pointer-set.h (pointer_set_contains): Add back.
+
2004-12-21 Richard Henderson <rth@redhat.com>
* gimplify.c (eval_save_expr): New.
+2004-12-21 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/18984
+ * cp-gimplify.c (cp_genericize_r): Don't insert first but instead
+ check to see if contains the pointer. Insert the statement before
+ returning.
+
2004-12-21 Nathan Sidwell <nathan@codesourcery.com>
PR c++/14075
}
/* Other than invisiref parms, don't walk the same tree twice. */
- if (pointer_set_insert (p_set, stmt))
+ if (pointer_set_contains (p_set, stmt))
{
*walk_subtrees = 0;
return NULL_TREE;
to lower this construct before scanning it, so we need to lower these
before doing anything else. */
else if (TREE_CODE (stmt) == CLEANUP_STMT)
- {
- *stmt_p = build2 (CLEANUP_EH_ONLY (stmt) ? TRY_CATCH_EXPR
- : TRY_FINALLY_EXPR,
- void_type_node,
- CLEANUP_BODY (stmt),
- CLEANUP_EXPR (stmt));
- pointer_set_insert (p_set, *stmt_p);
- }
+ *stmt_p = build2 (CLEANUP_EH_ONLY (stmt) ? TRY_CATCH_EXPR
+ : TRY_FINALLY_EXPR,
+ void_type_node,
+ CLEANUP_BODY (stmt),
+ CLEANUP_EXPR (stmt));
+
+ pointer_set_insert (p_set, *stmt_p);
return NULL;
}
XDELETE (pset);
}
+/* Returns nonzero if PSET contains P. P must be nonnull.
+
+ Collisions are resolved by linear probing. */
+int
+pointer_set_contains (struct pointer_set_t *pset, void *p)
+{
+ size_t n = hash1 (p, pset->n_slots, pset->log_slots);
+
+ while (true)
+ {
+ if (pset->slots[n] == p)
+ return 1;
+ else if (pset->slots[n] == 0)
+ return 0;
+ else
+ {
+ ++n;
+ if (n == pset->n_slots)
+ n = 0;
+ }
+ }
+}
+
/* Subroutine of pointer_set_insert. Inserts P into an empty
element of SLOTS, an array of length N_SLOTS. Returns nonzero
if P was already present in N_SLOTS. */
struct pointer_set_t *pointer_set_create (void);
void pointer_set_destroy (struct pointer_set_t *pset);
+int pointer_set_contains (struct pointer_set_t *pset, void *p);
int pointer_set_insert (struct pointer_set_t *pset, void *p);
#endif /* POINTER_SET_H */
+2004-12-21 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR C++/18984
+ * g++.dg/eh/ctor3.C: New test.
+
2004-12-21 Eric Botcazou <ebotcazou@libertysurf.fr>
* objc.dg/stabs-1.m: Allow section name to be quoted and
--- /dev/null
+// PR C++/18984
+// We just to ICE as we did not add a
+// deference to invisible by reference
+// variable
+
+// { dg-do compile }
+
+
+struct Str
+{
+ Str(const char *chars);
+ Str& operator=(const char *chars);
+ virtual operator char*() const;
+};
+Str _localName(Str fullname)
+{
+ return (char*)fullname;
+}