This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR 61211] Fix a bug in clone_of_p verification
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Fri, 20 Jun 2014 07:06:04 +0200
- Subject: Re: [PATCH, PR 61211] Fix a bug in clone_of_p verification
- Authentication-results: sourceware.org; auth=none
- References: <20140530224603 dot GA23341 at virgil dot suse> <20140617185641 dot GE29831 at virgil dot suse>
> Ping.
>
> Thanks,
>
> Martin
>
>
> On Sat, May 31, 2014 at 12:46:03AM +0200, Martin Jambor wrote:
> > Hi,
> >
> > after a clone is materialized, its clone_of field is cleared which in
> > PR 61211 leads to a failure in the skipped_thunk path in clone_of_p in
> > cgraph.c, which then leads to a false positive verification failure.
> >
> > Fixed by the following patch. Bootstrapped and tested on x86_64-linux
> > on both the trunk and the 4.9 branch. OK for both?
> >
> > Thanks,
> >
> > Martin
> >
> >
> > 2014-05-30 Martin Jambor <mjambor@suse.cz>
> >
> > PR ipa/61211
> > * cgraph.c (clone_of_p): Allow skipped_branch to deal with
> > expanded clones.
OK, thanks!
Honza
> >
> > diff --git a/gcc/cgraph.c b/gcc/cgraph.c
> > index ff65b86..f18f977 100644
> > --- a/gcc/cgraph.c
> > +++ b/gcc/cgraph.c
> > @@ -2566,11 +2566,16 @@ clone_of_p (struct cgraph_node *node, struct cgraph_node *node2)
> > skipped_thunk = true;
> > }
> >
> > - if (skipped_thunk
> > - && (!node2->clone_of
> > - || !node2->clone.args_to_skip
> > - || !bitmap_bit_p (node2->clone.args_to_skip, 0)))
> > - return false;
> > + if (skipped_thunk)
> > + {
> > + if (!node2->clone.args_to_skip
> > + || !bitmap_bit_p (node2->clone.args_to_skip, 0))
> > + return false;
> > + if (node2->former_clone_of == node->decl)
> > + return true;
> > + else if (!node2->clone_of)
> > + return false;
> > + }
> >
> > while (node != node2 && node2)
> > node2 = node2->clone_of;