This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix builtin asm redirection (PR middle-end/39443)
- From: Ian Lance Taylor <iant at google dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 17 Mar 2009 07:18:41 -0700
- Subject: Re: [PATCH] Fix builtin asm redirection (PR middle-end/39443)
- References: <20090312170334.GT4561@tyan-ft48-01.lab.bos.redhat.com>
Jakub Jelinek <jakub@redhat.com> writes:
> 2009-03-12 Jakub Jelinek <jakub@redhat.com>
>
> PR middle-end/39443
> * optabs.c (set_user_assembler_libfunc): New function.
> * expr.h (set_user_assembler_libfunc): New prototype.
> * c-common.c: Include libfuncs.h.
> (set_builtin_user_assembler_name): Call set_user_assembler_libfunc
> for memcmp, memset, memcpy, memmove and abort.
>
> * gcc.dg/pr39443.c: New test.
> + id = get_identifier (name);
> + hash = htab_hash_string (name);
> + slot = htab_find_slot_with_hash (libfunc_decls, id, hash, INSERT);
> + decl = (tree) *slot;
> + gcc_assert (decl);
> + set_user_assembler_name (decl, asmspec);
> + return XEXP (DECL_RTL (decl), 0);
Since this code is never going to actually insert anything into the hash
table, I think it would be a tiny bit clearer if you write it as
slot = htab_find_slot_with_hash (libfunc_decls, id, hash, NO_INSERT);
gcc_assert (slot);
decl = (tree) *slot;
set_user_assembler_name (decl, asmspec);
OK with that change.
Thanks.
Ian