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: [C++ PATCH] Fix up DECL_ARG_TYPE (PR c++/36631)


On Mon, Nov 10, 2008 at 02:44:53PM -0800, Mark Mitchell wrote:
> Jason Merrill wrote:
> > Mark Mitchell wrote:
> >> That may be -- but I think the basic point remains true.  DECL_ARG_TYPE
> >> is not a front-end concept.  It's an implementation detail, describing
> >> how exactly the argument is passed.  As such, it really should be left
> >> to the middle-end to compute as needed.
> > 
> > Well, it depends on the ABI, which can be language-specific.
> 
> Indeed, but this seems to me like an appropriate place for a langhook,
> if one is required.  It's language-specific information that's required
> as part of the lowering process from language-specific trees to GENERIC
> and/or GIMPLE.
> 
> I guess my basic point is that by deferring this until that point, we're
> guaranteed to avoid problems with incomplete types.  If we try to do it
> before the translation unit is completely processed, then we're at risk
> of getting it wrong.  So, a lazy approach (whether by making
> DECL_ARG_TYPE itself actually invoke a hook if the value is NULL, or by
> doing it at the point of gimplification, or some other strategy) seems
> safest.

We also have an option to not check this at gimplification time, but later
on (e.g. during GIMPLE lowering).  It just has to be done before early
inlining.  GIMPLE lowering is called from within cgraph_optimize, so
we might just go through all the FUNCTION_DECLs we've created at
cp_write_global_declarations time and compute DECL_ARG_TYPE for all their
arguments at that point.

	Jakub


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