Skip to content

Commit

Permalink
PR ipa/64978
Browse files Browse the repository at this point in the history
	* ipa-cp.c (gather_caller_stats): Skip thunks.
	(propagate_constants_topo): Skip aliases.

	* g++.dg/torture/pr64978.C: New testcase.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220557 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
hubicka committed Feb 10, 2015
1 parent caa5e7f commit 675f181
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
6 changes: 6 additions & 0 deletions gcc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2015-02-09 Jan Hubicka <hubicka@ucw.cz>

PR ipa/64978
* ipa-cp.c (gather_caller_stats): Skip thunks.
(propagate_constants_topo): Skip aliases.

2015-02-09 Kaz Kojima <kkojima@gcc.gnu.org>

PR target/64761
Expand Down
7 changes: 2 additions & 5 deletions gcc/ipa-cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,10 +560,7 @@ gather_caller_stats (struct cgraph_node *node, void *data)
struct cgraph_edge *cs;

for (cs = node->callers; cs; cs = cs->next_caller)
if (cs->caller->thunk.thunk_p)
cs->caller->call_for_symbol_thunks_and_aliases (gather_caller_stats,
stats, false);
else
if (!cs->caller->thunk.thunk_p)
{
stats->count_sum += cs->count;
stats->freq_sum += cs->frequency;
Expand Down Expand Up @@ -2643,7 +2640,7 @@ propagate_constants_topo (struct ipa_topo_info *topo)
for (cs = v->callees; cs; cs = cs->next_callee)
if (ipa_edge_within_scc (cs)
&& propagate_constants_accross_call (cs))
push_node_to_stack (topo, cs->callee);
push_node_to_stack (topo, cs->callee->function_symbol ());
v = pop_node_from_stack (topo);
}

Expand Down
5 changes: 5 additions & 0 deletions gcc/testsuite/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2015-02-08 Jan Hubicka <hubicka@ucw.cz>

PR ipa/64978
* g++.dg/torture/pr64978.C: New testcase.

2015-02-09 Jakub Jelinek <jakub@redhat.com>

PR sanitizer/64981
Expand Down
30 changes: 30 additions & 0 deletions gcc/testsuite/g++.dg/torture/pr64978.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* { dg-do compile } */
class A {
public:
A(int, int);
};
class B {
public:
void m_fn1(bool, const int *, int &);
unsigned m_fn2();
};
namespace {
class C {
B &VTables;
void m_fn3(A, unsigned, const int *, int &);

public:
int VFTableBuilder_VisitedBases;
B VFTableBuilder_VTables;
C() : VTables(VFTableBuilder_VTables) {
m_fn3(A(0, 0), 0, 0, VFTableBuilder_VisitedBases);
}
};
}
int a;
void C::m_fn3(A, unsigned, const int *, int &) {
for (;;)
1 ? VTables.m_fn2() : 0;
}
void B::m_fn1(bool, const int *, int &) { C(); }
unsigned B::m_fn2() { m_fn1(0, 0, a); }

0 comments on commit 675f181

Please sign in to comment.