https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78668

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
Author: msebor
Date: Sun Dec  4 17:48:44 2016
New Revision: 243231

URL: https://gcc.gnu.org/viewcvs?rev=243231&root=gcc&view=rev
Log:
PR c/78668 - aligned_alloc, realloc, et al. missing attribute alloc_size

gcc/ChangeLog:

        PR c/78668
        * builtin-attrs.def (ATTR_ALLOC_SIZE, ATTR_RETURNS_NONNULL): New
        identifier tree nodes.
        (ATTR_ALLOCA_SIZE_1_NOTHROW_LEAF_LIST): New attribute list.
        (ATTR_MALLOC_SIZE_1_NOTHROW_LIST): Same.
        (ATTR_MALLOC_SIZE_1_NOTHROW_LEAF_LIST): Same.
        (ATTR_MALLOC_SIZE_1_2_NOTHROW_LEAF_LIST): Same.
        (ATTR_ALLOC_SIZE_2_NOTHROW_LEAF_LIST): Same.
        * builtins.def (aligned_alloc, calloc, malloc, realloc):
        Add attribute alloc_size.
        (alloca): Add attribute alloc_size and returns_nonnull.

gcc/testsuite/ChangeLog:

        PR c/78668
        * gcc.dg/builtin-alloc-size.c: New test.


Added:
    trunk/gcc/testsuite/gcc.dg/builtin-alloc-size.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/builtin-attrs.def
    trunk/gcc/builtins.def
    trunk/gcc/testsuite/ChangeLog

Reply via email to