* [PATCH] Fix PR79776
@ 2017-03-27 10:56 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2017-03-27 10:56 UTC (permalink / raw)
To: gcc-patches
Bootstrapped / tested on x86_64-unknown-linux-gnu, applied.
Richard.
2017-03-27 Richard Biener <rguenther@suse.de>
PR ipa/79776
* tree-ssa-structalias.c (associate_varinfo_to_alias): Skip
inlined thunk clones.
* g++.dg/ipa/pr79776.C: New testcase.
Index: gcc/tree-ssa-structalias.c
===================================================================
*** gcc/tree-ssa-structalias.c (revision 246489)
--- gcc/tree-ssa-structalias.c (working copy)
*************** struct pt_solution ipa_escaped_pt
*** 7615,7621 ****
static bool
associate_varinfo_to_alias (struct cgraph_node *node, void *data)
{
! if ((node->alias || node->thunk.thunk_p)
&& node->analyzed)
insert_vi_for_tree (node->decl, (varinfo_t)data);
return false;
--- 7615,7623 ----
static bool
associate_varinfo_to_alias (struct cgraph_node *node, void *data)
{
! if ((node->alias
! || (node->thunk.thunk_p
! && ! node->global.inlined_to))
&& node->analyzed)
insert_vi_for_tree (node->decl, (varinfo_t)data);
return false;
Index: gcc/testsuite/g++.dg/ipa/pr79776.C
===================================================================
*** gcc/testsuite/g++.dg/ipa/pr79776.C (nonexistent)
--- gcc/testsuite/g++.dg/ipa/pr79776.C (working copy)
***************
*** 0 ****
--- 1,29 ----
+ // PR ipa/71146
+ // { dg-do compile }
+ // { dg-options "-O3 -fipa-pta" }
+
+ typedef enum { X } E;
+ struct A {
+ virtual void bar ();
+ };
+ struct B {
+ virtual E fn (const char *, int, int *) = 0;
+ };
+ struct C : A, B {
+ E fn (const char *, int, int *);
+ void fn2 ();
+ B *foo;
+ };
+ void C::fn2 () {
+ if (!foo)
+ return;
+ foo->fn (0, 0, 0);
+ }
+ E
+ C::fn (const char *, int, int *)
+ {
+ fn2 ();
+ foo = 0;
+ fn (0, 0, 0);
+ return X;
+ }
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-03-27 10:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-27 10:56 [PATCH] Fix PR79776 Richard Biener
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).