PR c/78668 - aligned_alloc, realloc, et al. missing attribute alloc_size
commitb9861e25aa6ad85cc96bce9ba38be4e9afa65b21
authormsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 4 Dec 2016 17:48:44 +0000 (4 17:48 +0000)
committermsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 4 Dec 2016 17:48:44 +0000 (4 17:48 +0000)
treea2b92f8621a6149627fede384c04f7664300a214
parent0954239c2ef364da24fe9157936e59b784240807
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243231 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/builtin-attrs.def
gcc/builtins.def
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/builtin-alloc-size.c [new file with mode: 0644]