This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Fix up DECL_ARG_TYPE (PR c++/36631)
On Thu, Nov 06, 2008 at 11:04:40AM +0100, Richard Guenther wrote:
> >> Why not just defer *all* computation of DECL_ARG_TYPE until converting
> >> to generic? I don't think the C++ front-end actually uses it, and I
> >> don't think it should.
> >
> > Not all functions go through conversion to generic, nor are referenced by
> > some function during genericization, say in
> > struct A { A (); ~A (); };
> > void foo (A, A, A);
> > static void (*fnptr) (A, A, A) = foo;
> > int main ()
> > {
> > fnptr (A (), A(), A());
> > }
> > where would DECL_ARG_TYPE be set for foo? Only during optimizations
> > GCC figures out that fnptr is actually const (being static and never
> > modified in the CU) and constant propagates it.
>
> Can we do it from the gimplification langhook?
That doesn't help at all, nothing is gimplified that isn't genericized
first. But DECL_INITIAL of static vars isn't genericized nor gimplified.
Jakub