re PR rtl-optimization/6086 (Reload misoptimizes DImode PREINC on PPC)
2002-04-07 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> PR optimization/6086 * g++.dg/opt/preinc1.C: New test. From-SVN: r52001
This commit is contained in:
parent
0dccd146ba
commit
eeec38a804
|
@ -1,3 +1,8 @@
|
|||
2002-04-07 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
|
||||
|
||||
PR optimization/6086
|
||||
* g++.dg/opt/preinc1.C: New test.
|
||||
|
||||
2002-04-06 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/5571
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
// PR optimization/6086
|
||||
// { dg-do run }
|
||||
// { dg-options "-O" }
|
||||
|
||||
extern "C" void abort (void);
|
||||
|
||||
struct A
|
||||
{
|
||||
A (int x, int y);
|
||||
int a, b;
|
||||
int foo () { return a; }
|
||||
int bar () { return b; }
|
||||
};
|
||||
|
||||
struct B
|
||||
{
|
||||
virtual ~B ();
|
||||
virtual A baz () const;
|
||||
};
|
||||
|
||||
struct C
|
||||
{
|
||||
A foo () const;
|
||||
B *c;
|
||||
};
|
||||
|
||||
A C::foo () const
|
||||
{
|
||||
int x, y;
|
||||
x = c->baz ().foo ();
|
||||
y = c->baz ().bar ();
|
||||
return A (x, y);
|
||||
}
|
||||
|
||||
A B::baz () const
|
||||
{
|
||||
return A (4, 8);
|
||||
}
|
||||
|
||||
A::A (int x, int y)
|
||||
{
|
||||
a = x;
|
||||
b = y;
|
||||
}
|
||||
|
||||
B::~B ()
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
C the_c;
|
||||
B the_b;
|
||||
the_c.c = &the_b;
|
||||
if (the_c.foo().a != 4)
|
||||
abort ();
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue