Commit ae1f6fce by Martin Jambor Committed by Martin Jambor

re PR tree-optimization/45875 (ice in gimple_fold_obj_type_ref_known_binfo with -O2)

2010-10-21  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/45875
	* tree.c (get_binfo_at_offset): Remove initial zero offset test.

	* testsuite/g++.dg/ipa/pr45875.C: New test.

From-SVN: r165780
parent 9e2995b2
2010-10-21 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/45875
* tree.c (get_binfo_at_offset): Remove initial zero offset test.
2010-10-21 Nathan Froyd <froydnj@codesourcery.com> 2010-10-21 Nathan Froyd <froydnj@codesourcery.com>
* tree-into-ssa.c (rewrite_update_enter_block): Remove unused * tree-into-ssa.c (rewrite_update_enter_block): Remove unused
2010-10-21 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/45875
* g++.dg/ipa/pr45875.C: New test.
2010-10-21 Ira Rosen <irar@il.ibm.com> 2010-10-21 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/46049 PR tree-optimization/46049
......
/* { dg-do compile } */
/* { dg-options "-O3 -fno-early-inlining -fno-ipa-cp" } */
extern "C" void abort (void);
class A
{
public:
virtual int foo (int i);
};
class B
{
public:
class A confusion;
};
int A::foo (int i)
{
return i + 1;
}
int __attribute__ ((noinline,noclone)) get_input(void)
{
return 1;
}
static int middleman_a (class A *obj, int i)
{
return obj->foo (i);
}
static int middleman_b (class B *obj, int i)
{
return middleman_a (&obj->confusion, i);
}
int main (int argc, char *argv[])
{
class B b;
int i, j = get_input ();
for (i = 0; i < j; i++)
if (middleman_b (&b, j) != 2)
abort ();
return 0;
}
...@@ -10893,9 +10893,6 @@ get_binfo_at_offset (tree binfo, HOST_WIDE_INT offset, tree expected_type) ...@@ -10893,9 +10893,6 @@ get_binfo_at_offset (tree binfo, HOST_WIDE_INT offset, tree expected_type)
{ {
tree type; tree type;
if (offset == 0)
return binfo;
type = TREE_TYPE (binfo); type = TREE_TYPE (binfo);
while (offset > 0) while (offset > 0)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment