Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-12-02 Thread Jeff Law
On 11/29/2016 08:22 PM, Martin Sebor wrote: That said, I defer to you on how to proceed here. I'm prepared to do the work(*) but I do worry about jeopardizing the chances of this patch and the others making it into 7.0. So would it make sense to just init/fini the b_o_s framework in your pass

Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-12-02 Thread Jeff Law
On 11/29/2016 08:22 PM, Martin Sebor wrote: That said, I defer to you on how to proceed here. I'm prepared to do the work(*) but I do worry about jeopardizing the chances of this patch and the others making it into 7.0. So would it make sense to just init/fini the b_o_s framework in your pass

Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-29 Thread Martin Sebor
That said, I defer to you on how to proceed here. I'm prepared to do the work(*) but I do worry about jeopardizing the chances of this patch and the others making it into 7.0. So would it make sense to just init/fini the b_o_s framework in your pass and for builtin expansion? I think that

Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-23 Thread Martin Sebor
On 11/23/2016 01:30 PM, Jeff Law wrote: On 11/23/2016 01:09 PM, Martin Sebor wrote: I hadn't thought of extending the gimple-ssa-sprintf pass to all the memxxx and strxxx builtins. The _chk functions are already being handled in builtins.c so calling compute_builtin_object_size for the

Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-23 Thread Jeff Law
On 11/23/2016 01:09 PM, Martin Sebor wrote: I hadn't thought of extending the gimple-ssa-sprintf pass to all the memxxx and strxxx builtins. The _chk functions are already being handled in builtins.c so calling compute_builtin_object_size for the non-checking ones there and detecting overflow

Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-23 Thread Martin Sebor
On 11/23/2016 12:47 PM, Jeff Law wrote: On 11/23/2016 12:32 PM, Martin Sebor wrote: My worry here would be a hash collision. Then we'd be using object sizes from the wrong function. Ah, right, that might explain the ICE I just noticed during Ada bootstrap. Is there some other way to

Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-23 Thread Jeff Law
On 11/23/2016 12:32 PM, Martin Sebor wrote: My worry here would be a hash collision. Then we'd be using object sizes from the wrong function. Ah, right, that might explain the ICE I just noticed during Ada bootstrap. Is there some other way to uniquely identify a function? A DECL_UID maybe?

Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-23 Thread Martin Sebor
On 11/23/2016 12:10 PM, Jeff Law wrote: On 11/23/2016 11:26 AM, Martin Sebor wrote: My only real concern here is that if we call compute_builtin_object_size without having initialized the passes, then we initialize, compute, then finalize. Subsequent calls will go through the same process --

Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-23 Thread Jeff Law
On 11/23/2016 11:26 AM, Martin Sebor wrote: My only real concern here is that if we call compute_builtin_object_size without having initialized the passes, then we initialize, compute, then finalize. Subsequent calls will go through the same process -- the key being each one re-computes the

Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-23 Thread Martin Sebor
My only real concern here is that if we call compute_builtin_object_size without having initialized the passes, then we initialize, compute, then finalize. Subsequent calls will go through the same process -- the key being each one re-computes the internal state which might get expensive.

Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-22 Thread Jeff Law
On 11/08/2016 05:09 PM, Martin Sebor wrote: The -Wformat-length checker relies on the compute_builtin_object_size function to determine the size of the buffer it checks for overflow. The function returns either a size computed by the tree-object-size pass for objects referenced by the

PING 2 [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-21 Thread Martin Sebor
Ping. Still looking for a review of the patch below: On 11/16/2016 10:33 AM, Martin Sebor wrote: I'm looking for a review of the patch below: https://gcc.gnu.org/ml/gcc-patches/2016-11/msg00779.html Thanks On 11/08/2016 05:09 PM, Martin Sebor wrote: The -Wformat-length checker relies on

PING [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-16 Thread Martin Sebor
I'm looking for a review of the patch below: https://gcc.gnu.org/ml/gcc-patches/2016-11/msg00779.html Thanks On 11/08/2016 05:09 PM, Martin Sebor wrote: The -Wformat-length checker relies on the compute_builtin_object_size function to determine the size of the buffer it checks for overflow.

[PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-08 Thread Martin Sebor
The -Wformat-length checker relies on the compute_builtin_object_size function to determine the size of the buffer it checks for overflow. The function returns either a size computed by the tree-object-size pass for objects referenced by the __builtin_object_size intrinsic (if it's used in the