[Bug c/78668] aligned_alloc, realloc, et al. missing attribute alloc_size

2016-12-04 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78668

Martin Sebor  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Blocks||78284
 Resolution|--- |FIXED

--- Comment #3 from Martin Sebor  ---
Fixed by r243231.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78284
[Bug 78284] warn on malloc with very large arguments

[Bug c/78668] aligned_alloc, realloc, et al. missing attribute alloc_size

2016-12-04 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78668

--- Comment #2 from Martin Sebor  ---
Author: msebor
Date: Sun Dec  4 17:48:44 2016
New Revision: 243231

URL: https://gcc.gnu.org/viewcvs?rev=243231=gcc=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

[Bug c/78668] aligned_alloc, realloc, et al. missing attribute alloc_size

2016-12-03 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78668

Martin Sebor  changed:

   What|Removed |Added

   Keywords||missed-optimization
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-12-03
   Assignee|unassigned at gcc dot gnu.org  |msebor at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Sebor  ---
I have a patch.