This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ patch] one more missed mark_used
On 07 Aug 2003 10:43:58 -0700, Mark Mitchell <mark@codesourcery.com> wrote:
> On Thu, 2003-08-07 at 10:30, Jason Merrill wrote:
>> On 02 Aug 2003 13:24:05 -0700, Mark Mitchell <mark@codesourcery.com> wrote:
>>
>> >> + /* Avoid useless walking of complex type and declaration nodes. */
>> >> + if (TYPE_P (*tp) || DECL_P (*tp))
>> >
>> > You should be careful about this test. For example, I expect that you
>> > will now not walk the initializers of declarations, which might contain
>> > pointers-to-members, or statement-expressions containing try/catch
>> > blocks.
>>
>> Actually, this isn't true either--we walk to DECL_INITIAL from the
>> DECL_STMT, not from the _DECL itself.
>
> Well, I'll just keep making up stuff, and let you keep debunking it. :-)
>
> Do we know that types never have these things inside them? For example,
> in the expressions that appear in TYPE_DOMAIN for ARRAY_TYPEs, or the
> template arguments to instantiations of CLASS_TYPEs?
We don't, but I think we also don't care. If a template argument is
relevant to the generated code, it will appear in an expression. If a VLA
type is used in a decl, we catch it that way because we also walk the size
of a decl from the DECL_STMT.
Jason