PR tree-optimization/71831 - __builtin_object_size poor results with no
authorMartin Sebor <msebor@redhat.com>
Fri, 2 Sep 2016 02:14:50 +0000 (02:14 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Fri, 2 Sep 2016 02:14:50 +0000 (20:14 -0600)
commit05a647564aab92f73fc28631a1bb0311ee8f38f9
tree8330dbb112ec47bbcf763663d1bd7051721bb3a6
parent910f2f3d8a3bccb6f65b9a99e6c36f409829f4f8
PR tree-optimization/71831 - __builtin_object_size poor results with no

PR tree-optimization/71831 - __builtin_object_size poor results with no
optimization

gcc/testsuite/ChangeLog:

PR tree-optimization/71831
* gcc.dg/builtin-object-size-16.c: New test.
* gcc.dg/builtin-object-size-17.c: New test.

gcc/ChangeLog:

PR tree-optimization/71831
* tree-object-size.h: Return bool instead of the size and add
argument for the size.
* tree-object-size.c (compute_object_offset): Update signature.
(addr_object_size): Same.
(compute_builtin_object_size): Return bool instead of the size
and add argument for the size.  Handle POINTER_PLUS_EXPR when
optimization is disabled.
(expr_object_size): Adjust.
(plus_stmt_object_size): Adjust.
(pass_object_sizes::execute): Adjust.
* builtins.c (fold_builtin_object_size): Adjust.
* doc/extend.texi (Object Size Checking): Update.
* ubsan.c (instrument_object_size): Adjust.

From-SVN: r239953
gcc/ChangeLog
gcc/builtins.c
gcc/doc/extend.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/builtin-object-size-16.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/builtin-object-size-17.c [new file with mode: 0644]
gcc/tree-object-size.c
gcc/tree-object-size.h
gcc/ubsan.c