* [PATCH, PR 61211] Fix a bug in clone_of_p verification
@ 2014-05-30 22:46 Martin Jambor
2014-06-17 18:56 ` Martin Jambor
0 siblings, 1 reply; 3+ messages in thread
From: Martin Jambor @ 2014-05-30 22:46 UTC (permalink / raw)
To: GCC Patches; +Cc: Jan Hubicka
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.
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;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH, PR 61211] Fix a bug in clone_of_p verification
2014-05-30 22:46 [PATCH, PR 61211] Fix a bug in clone_of_p verification Martin Jambor
@ 2014-06-17 18:56 ` Martin Jambor
2014-06-20 5:06 ` Jan Hubicka
0 siblings, 1 reply; 3+ messages in thread
From: Martin Jambor @ 2014-06-17 18:56 UTC (permalink / raw)
To: GCC Patches, Jan Hubicka
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.
>
> 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;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH, PR 61211] Fix a bug in clone_of_p verification
2014-06-17 18:56 ` Martin Jambor
@ 2014-06-20 5:06 ` Jan Hubicka
0 siblings, 0 replies; 3+ messages in thread
From: Jan Hubicka @ 2014-06-20 5:06 UTC (permalink / raw)
To: GCC Patches, Jan Hubicka
> 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;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-20 5:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-30 22:46 [PATCH, PR 61211] Fix a bug in clone_of_p verification Martin Jambor
2014-06-17 18:56 ` Martin Jambor
2014-06-20 5:06 ` Jan Hubicka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).