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)


Jakub Jelinek wrote:
> On Wed, Nov 05, 2008 at 07:51:23AM -0800, Mark Mitchell wrote:
>> Jakub Jelinek wrote:
>>
>>> The following patch has been bootstrapped/regtested on x86_64-linux.
>>>
>>> 2008-11-04  Jakub Jelinek  <jakub@redhat.com>
>>>
>>> 	PR c++/36631
>>> 	* cp-gimplify.c (cp_genericize_r): For FUNCTION_DECLs ensure
>>> 	DECL_ARG_TYPE of all PARM_DECLs is correct.
>>>
>>> 	* g++.dg/template/call5.C: New test.
>> 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

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.

The implementation of type_passed_as in the C++ front-end doesn't appear
to use any functionality specific to the front-end.  How about just
computing DECL_ARG_TYPE lazily when something needs it?

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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