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 ICE with PTRMEM_CST (PR c++/70869)


On Thu, Jul 7, 2016 at 2:23 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Thu, Jul 07, 2016 at 12:32:02PM -0400, Jason Merrill wrote:
>> Hmm, I wonder if walk_tree_1 should walk into DECL_EXPR like it does into
>> BIND_EXPR_VARS.  But your patch is OK.
>
> Well, walk_tree_1 does walk into DECL_EXPR, but cp_genericize_r says
> *walk_subtrees on the VAR_DECL inside of it.
> When walking BIND_EXPR_VARS, it doesn't walk the vars themselves, but
>             /* Walk the DECL_INITIAL and DECL_SIZE.  We don't want to walk
>                into declarations that are just mentioned, rather than
>                declared; they don't really belong to this part of the tree.
>                And, we can see cycles: the initializer for a declaration
>                can refer to the declaration itself.  */
>             WALK_SUBTREE (DECL_INITIAL (decl));
>             WALK_SUBTREE (DECL_SIZE (decl));
>             WALK_SUBTREE (DECL_SIZE_UNIT (decl));
> Do you mean walk_tree_1 should walk DECL_INITIAL/DECL_SIZE/DECL_SIZE_UNIT
> of the var mentioned in the DECL_EXPR?  Then for many vars (which are both
> mentioned in BIND_EXPR_VARS and in DECL_EXPR) it would walk them twice.

Yes, that's what I meant.  Or perhaps since this is a C++ FE issue,
cp_walk_subtrees should walk those fields for artificial variables.

Jason


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