The ABI exception helpers like __throw were being created by first
looking for them, and then adding if not found.  Primarily because
libitm wasn't declaring them with the correct exception specifiers.  I
fixed libitm a while back, so let's just use push_library_fn and let
the symbol table machinery deal with duplicates.  push_library_fn was
making the assumtion there wasn't already a decl available, by always
returning the new decl.  Bad things would happen if there was a
duplicate, because duplicate_decls explicitly gcc_frees the new decl.
Fixed by having it return whatever pushdecl returns.

            gcc/cp/
* decl.c (push_library_fn): Return the decl pushdecl_toplevel returns.
            * except.c (verify_library_fn): Replace with ...
            (declare_library_fn_1): ... this fn.  Always push the fn.
            (declare_library_fn): Call it.
            (build_throw): Call declare_library_fn_1.
            gcc/testsuite/
            * g++.dg/eh/builtin10.C: Adjust expected errors.
            * g++.dg/eh/builtin11.C: Likewise.
            * g++.dg/eh/builtin5.C: Likewise.
            * g++.dg/eh/builtin6.C: Likewise.
            * g++.dg/eh/builtin7.C: Likewise.
            * g++.dg/eh/builtin9.C: Likewise.
            * g++.dg/parse/crash55.C: Likewise.

--
Nathan Sidwell

Reply via email to