This is the mail archive of the
mailing list for the GCC project.
Re: Annotate free as leaf
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 28 Aug 2013 09:35:54 +0200
- Subject: Re: Annotate free as leaf
- Authentication-results: sourceware.org; auth=none
- References: <20130828072128 dot GB8260 at kam dot mff dot cuni dot cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Aug 28, 2013 at 09:21:28AM +0200, Jan Hubicka wrote:
> while adding LEAF attributes, I apparently missed free. Malloc is already annotated.
> Fixed thus. Comitted as obvoius.
Given that glibc headers mark free as leaf and nothing has been reported
against it, it is probably fine; but you've ignored the comment that
told you to adjust also BUILT_IN_TM_FREE.
> --- ChangeLog (revision 202003)
> +++ ChangeLog (working copy)
> @@ -1,5 +1,9 @@
> 2013-08-26 Jan Hubicka <email@example.com>
> + * builtins.def (free): Declare leaf.
> +2013-08-26 Jan Hubicka <firstname.lastname@example.org>
> * cgraph.c (cgraph_propagate_frequency): Do not assume that virtual
> methods can not be called indirectly when their address is not taken.
> Index: builtins.def
> --- builtins.def (revision 202000)
> +++ builtins.def (working copy)
> @@ -694,7 +694,7 @@ DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSLL,
> DEF_EXT_LIB_BUILTIN (BUILT_IN_FORK, "fork", BT_FN_PID, ATTR_NOTHROW_LIST)
> DEF_GCC_BUILTIN (BUILT_IN_FRAME_ADDRESS, "frame_address", BT_FN_PTR_UINT, ATTR_NULL)
> /* [trans-mem]: Adjust BUILT_IN_TM_FREE if BUILT_IN_FREE is changed. */
> -DEF_LIB_BUILTIN (BUILT_IN_FREE, "free", BT_FN_VOID_PTR, ATTR_NOTHROW_LIST)
> +DEF_LIB_BUILTIN (BUILT_IN_FREE, "free", BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
> DEF_GCC_BUILTIN (BUILT_IN_FROB_RETURN_ADDR, "frob_return_addr", BT_FN_PTR_PTR, ATTR_NULL)
> DEF_EXT_LIB_BUILTIN (BUILT_IN_GETTEXT, "gettext", BT_FN_STRING_CONST_STRING, ATTR_FORMAT_ARG_1)
> DEF_C99_BUILTIN (BUILT_IN_IMAXABS, "imaxabs", BT_FN_INTMAX_INTMAX, ATTR_CONST_NOTHROW_LEAF_LIST)