re PR tree-optimization/55683 (ICE in inline_call, at ipa-inline-transform.c:270)

PR tree-optimization/55683
	* g++.dg/ipa/devirt-9.C: New testcase.

	* ipa-prop.c (try_make_edge_direct_virtual_call): Look into constants for binfo.

From-SVN: r194606
This commit is contained in:
Jan Hubicka 2012-12-19 12:42:30 +01:00 committed by Jan Hubicka
parent 47b33e4c65
commit da942ca0e2
4 changed files with 48 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2012-12-18 Jan Hubicka <jh@suse.cz>
PR tree-optimization/55683
* ipa-prop.c (try_make_edge_direct_virtual_call): Look into constants for binfo.
2012-12-19 Terry Guo <terry.guo@arm.com>
* config/arm/arm.c (thumb_find_work_register): Check argument

View file

@ -2223,9 +2223,16 @@ try_make_edge_direct_virtual_call (struct cgraph_edge *ie,
binfo = ipa_value_from_jfunc (new_root_info, jfunc);
if (!binfo || TREE_CODE (binfo) != TREE_BINFO)
if (!binfo)
return NULL;
if (TREE_CODE (binfo) != TREE_BINFO)
{
binfo = gimple_extract_devirt_binfo_from_cst (binfo);
if (!binfo)
return NULL;
}
binfo = get_binfo_at_offset (binfo, ie->indirect_info->offset,
ie->indirect_info->otr_type);
if (binfo)

View file

@ -1,3 +1,8 @@
2012-12-18 Jan Hubicka <jh@suse.cz>
PR tree-optimization/55683
* g++.dg/ipa/devirt-9.C: New testcase.
2012-12-19 Terry Guo <terry.guo@arm.com>
* gcc.target/arm/thumb-find-work-register.c: New.

View file

@ -0,0 +1,30 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-inline" } */
double foo ();
struct B
{
bool b1 () { return b3 (); }
void b2 ();
virtual bool b3 ();
};
struct C
{
C () {}
bool
c1 (float x, float y)
{
if (x != c3 || y != c4)
c2.b2 ();
return c2.b1 ();
}
B c2;
float c3, c4;
};
void
bar ()
{
static C c;
c.c1 (60, (int) foo ());
}
/* { dg-final { scan-ipa-dump "Discovered a virtual call to a known target" "inline" } } */