PR tree-optimization/88372 - alloc_size attribute is ignored on function pointers
authorMartin Sebor <msebor@redhat.com>
Fri, 14 Dec 2018 22:45:55 +0000 (22:45 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Fri, 14 Dec 2018 22:45:55 +0000 (15:45 -0700)
commit302db8ba6180906dd9a8c4ce670aff804f921fab
tree257c476ecc81a6f345864f453f153057cf7f98de
parent3e6837c2a56f47c6b3156bbc12a9e89611412f83
PR tree-optimization/88372 - alloc_size attribute is ignored on function pointers

gcc/ChangeLog:

PR tree-optimization/88372
* calls.c (maybe_warn_alloc_args_overflow): Handle function pointers.
* tree-object-size.c (alloc_object_size): Same.  Simplify.
* doc/extend.texi (Object Size Checking): Update.
(Other Builtins): Add __builtin_object_size.
(Common Type Attributes): Add alloc_size.
(Common Variable Attributes): Ditto.

gcc/testsuite/ChangeLog:

PR tree-optimization/88372
* gcc.dg/Walloc-size-larger-than-18.c: New test.
* gcc.dg/builtin-object-size-19.c: Same.

From-SVN: r267158
gcc/ChangeLog
gcc/calls.c
gcc/doc/extend.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Walloc-size-larger-than-18.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/builtin-object-size-19.c [new file with mode: 0644]
gcc/tree-object-size.c