This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Object size checking (stage 2 project)


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]