This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tuples][patch] Convert pass_object_sizes to tuples
On Tue, Mar 18, 2008 at 11:38:25AM -0700, Bill Maddox wrote:
> On Tue, Mar 18, 2008 at 11:14 AM, Diego Novillo <dnovillo@google.com> wrote:
>
> > Hmm, no. I don't think this is possible now. We call
> > compute_builtin_object_size mostly from fold_builtin_object_size,
> > which is only invoked during GIMPLE optimization.
> >
> > If it is possible to call this code path from GENERIC, we should have
> > a Good Reason. If not, I would like to block this possibility.
>
> fold_builtin_object_size can be called from fold_builtin_call_array,
> which is in turn is invoked from build_call_expr and build_function_call_expr.
> These are called in the front-end (c-omp.c) and back-end (rtx stuff in
> expr.c) as well as middle-end passes. It is likely that there is no reason
> why we need to do the object size optimization in all of theses cases,
> but, as the code is presently structured, it looks like it can happen in
> multiple places.
Folding __builtin_object_size already in the C/C++ frontends is useful, allows
to get rid of lots of garbage (glibc headers use this heavily for many
functions). But not handling CALL_EXPRs there is something we can live with
I think, just please don't gcc_assert it can't be seen there, because it
can, just let it fall through to return unknown[object_size_type] which
means it won't be folded right away.
Jakub