OSDN Git Service

PR optimization/6189
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 9 Apr 2002 17:02:43 +0000 (17:02 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 9 Apr 2002 17:02:43 +0000 (17:02 +0000)
        * semantics.c (genrtl_start_function): Don't free
        DECL_SAVED_FUNCTION_DATA for inline functions.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52083 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/g++.dg/opt/nrv3.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/opt/nrv3.C b/gcc/testsuite/g++.dg/opt/nrv3.C
new file mode 100644 (file)
index 0000000..2ec5977
--- /dev/null
@@ -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;
+}