re PR ipa/60600 (ICE in ipa_get_indirect_edge_target_1)
2014-03-25 Martin Jambor <mjambor@suse.cz> PR ipa/60600 * ipa-cp.c (ipa_get_indirect_edge_target_1): Redirect type inconsistent devirtualizations to __builtin_unreachable. testsuite/ * g++.dg/ipa/pr60600.C: New test. From-SVN: r208818
This commit is contained in:
parent
1cbba79d07
commit
b5165eb022
@ -1,3 +1,9 @@
|
|||||||
|
2014-03-25 Martin Jambor <mjambor@suse.cz>
|
||||||
|
|
||||||
|
PR ipa/60600
|
||||||
|
* ipa-cp.c (ipa_get_indirect_edge_target_1): Redirect type
|
||||||
|
inconsistent devirtualizations to __builtin_unreachable.
|
||||||
|
|
||||||
2014-03-25 Marek Polacek <polacek@redhat.com>
|
2014-03-25 Marek Polacek <polacek@redhat.com>
|
||||||
|
|
||||||
PR c/35449
|
PR c/35449
|
||||||
|
17
gcc/ipa-cp.c
17
gcc/ipa-cp.c
@ -1639,11 +1639,18 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
|
|||||||
return NULL_TREE;
|
return NULL_TREE;
|
||||||
target = gimple_get_virt_method_for_binfo (token, binfo);
|
target = gimple_get_virt_method_for_binfo (token, binfo);
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_CHECKING
|
|
||||||
if (target)
|
if (target && !possible_polymorphic_call_target_p (ie,
|
||||||
gcc_assert (possible_polymorphic_call_target_p
|
cgraph_get_node (target)))
|
||||||
(ie, cgraph_get_node (target)));
|
{
|
||||||
#endif
|
if (dump_file)
|
||||||
|
fprintf (dump_file,
|
||||||
|
"Type inconsident devirtualization: %s/%i->%s\n",
|
||||||
|
ie->caller->name (), ie->caller->order,
|
||||||
|
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (target)));
|
||||||
|
target = builtin_decl_implicit (BUILT_IN_UNREACHABLE);
|
||||||
|
cgraph_get_create_node (target);
|
||||||
|
}
|
||||||
|
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2014-03-25 Martin Jambor <mjambor@suse.cz>
|
||||||
|
|
||||||
|
PR ipa/60600
|
||||||
|
* g++.dg/ipa/pr60600.C: New test.
|
||||||
|
|
||||||
2014-03-25 John David Anglin <danglin@gcc.gnu.org>
|
2014-03-25 John David Anglin <danglin@gcc.gnu.org>
|
||||||
|
|
||||||
PR testsuite/58013
|
PR testsuite/58013
|
||||||
|
34
gcc/testsuite/g++.dg/ipa/pr60600.C
Normal file
34
gcc/testsuite/g++.dg/ipa/pr60600.C
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/* { dg-do compile } */
|
||||||
|
/* { dg-options "-O3 -fdump-ipa-cp" } */
|
||||||
|
|
||||||
|
struct data {
|
||||||
|
data(int);
|
||||||
|
};
|
||||||
|
|
||||||
|
struct top {
|
||||||
|
virtual int topf();
|
||||||
|
};
|
||||||
|
|
||||||
|
struct intermediate: top {
|
||||||
|
int topf() /* override */ { return 0; }
|
||||||
|
};
|
||||||
|
|
||||||
|
struct child1: top {
|
||||||
|
void childf()
|
||||||
|
{
|
||||||
|
data d(topf());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct child2: intermediate {};
|
||||||
|
|
||||||
|
void test(top& t)
|
||||||
|
{
|
||||||
|
child1& c = static_cast<child1&>(t);
|
||||||
|
c.childf();
|
||||||
|
child2 d;
|
||||||
|
test(d);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* { dg-final { scan-ipa-dump "Type inconsident devirtualization" "cp" } } */
|
||||||
|
/* { dg-final { cleanup-ipa-dump "cp" } } */
|
Loading…
Reference in New Issue
Block a user