re PR tree-optimization/64715 (__builtin_object_size (..., 1) fails to locate subobject)
authorJakub Jelinek <jakub@redhat.com>
Thu, 26 Mar 2015 13:19:59 +0000 (14:19 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 26 Mar 2015 13:19:59 +0000 (14:19 +0100)
commit672ff0b6fd7f43aa5415bff60ab212b893b9f474
tree103331a842bf4bd31af5f4ef2d0b06f0304344e3
parentd00dce2749c652a0d63b646695249a9c5a820b94
re PR tree-optimization/64715 (__builtin_object_size (..., 1) fails to locate subobject)

PR tree-optimization/64715
* passes.def: Add another instance of pass_object_sizes before
ccp1.
* tree-object-size.c (pass_object_sizes::execute): In
first_pass_instance, only handle __bos (, 1) and __bos (, 3)
calls, and keep the call in the IL, as {MIN,MAX}_EXPR of the
__bos result and the computed constant.  Remove redundant
checks, obsoleted by gimple_call_builtin_p test.

* gcc.dg/builtin-object-size-15.c: New test.
* gcc.dg/pr64715-1.c: New test.
* gcc.dg/pr64715-2.c: New test.

From-SVN: r221694
gcc/ChangeLog
gcc/passes.def
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/builtin-object-size-15.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr64715-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr64715-2.c [new file with mode: 0644]
gcc/tree-object-size.c