mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-17 05:10:28 +08:00
re PR rtl-optimization/6189 (Regression from 3.0.x: g++ -O3 generates wrong code)
PR optimization/6189 * semantics.c (genrtl_start_function): Don't free DECL_SAVED_FUNCTION_DATA for inline functions. [[Split portion of a mixed commit.]] From-SVN: r52083.2
This commit is contained in:
parent
edf5cd1d1d
commit
02f136ee0d
24
gcc/testsuite/g++.dg/opt/nrv3.C
Normal file
24
gcc/testsuite/g++.dg/opt/nrv3.C
Normal file
@ -0,0 +1,24 @@
|
||||
// PR optimization/6189
|
||||
// Bug: we forgot about foo's nrv after writing it out.
|
||||
// { dg-options -O3 }
|
||||
// { dg-do run }
|
||||
|
||||
struct A
|
||||
{
|
||||
int i;
|
||||
};
|
||||
|
||||
|
||||
A foo ()
|
||||
{
|
||||
A a;
|
||||
a.i = 42;
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
A b = foo();
|
||||
return b.i != 42;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user