This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] tree-optimization/71831 - __builtin_object_size poor results with no optimization
- From: Jeff Law <law at redhat dot com>
- To: Martin Sebor <msebor at gmail dot com>, Jakub Jelinek <jakub at redhat dot com>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 25 Aug 2016 13:18:51 -0600
- Subject: Re: [PATCH] tree-optimization/71831 - __builtin_object_size poor results with no optimization
- Authentication-results: sourceware.org; auth=none
- References: <57B78897.6050708@gmail.com> <20160820072633.GA14857@tucnak.redhat.com> <57BA0F39.2000808@gmail.com>
On 08/21/2016 02:29 PM, Martin Sebor wrote:
gcc-71831.w.diff
PR tree-optimization/71831 - __builtin_object_size poor results with no
optimization
gcc/testsuite/ChangeLog:
2016-08-21 Martin Sebor <msebor@redhat.com>
PR tree-optimization/71831
* gcc.dg/builtin-object-size-16.c: New test.
* gcc.dg/builtin-object-size-17.c: New test.
gcc/ChangeLog:
2016-08-21 Martin Sebor <msebor@redhat.com>
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.
So just to be sure, this change really only helps with our ability to
discover object sizes with -O0. Essentially when the objsz pass isn't
run. That's my reading and I just want to make sure I read it correctly.
Assuming that is the intent here, this is OK for the trunk.
jeff