This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Object size checking (stage 2 project)
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 10 May 2005 17:47:13 -0400
- Subject: Re: [PATCH] Object size checking (stage 2 project)
- References: <20050502174001.GP17420@devserv.devel.redhat.com>
On Mon, May 02, 2005 at 01:40:01PM -0400, Jakub Jelinek wrote:
> +/* Simple pass to optimize all __builtin_object_size () builtins. */
> +
> +static void
> +compute_object_sizes (void)
> +{
> + basic_block bb;
> + FOR_EACH_BB (bb)
> + {
> + block_stmt_iterator i;
> + for (i = bsi_start (bb); !bsi_end_p (i); bsi_next (&i))
> + {
>
I don't like this part. __builtin_object_size is an almost
perfect fit for using the SSA propagator. You are duplicating
much of the propagation functionality in ssa_propagate. Any
particular reason why not to use the propagator?
It would simplify this implementation and, maybe, catch cases you
are not handling now (though I cannot tell for sure, you do seem
to be doing merge operations and whatnot).
I have no opinion on the builtin bits. I'm only looking at the
propagation stuff. Using the propagator would prevent duplicate
effort and simplify maintenance.
Diego.