This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix builtin asm redirection (PR middle-end/39443)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]